# /*******************************************************************************/
# /*                                                                             */
# /*  Copyright 2005 Pascal Gloor <pascal.gloor@spale.com>                       */
# /*                                                                             */
# /*  Licensed under the Apache License, Version 2.0 (the "License");            */
# /*  you may not use this file except in compliance with the License.           */
# /*  You may obtain a copy of the License at                                    */
# /*                                                                             */
# /*     http://www.apache.org/licenses/LICENSE-2.0                              */
# /*                                                                             */
# /*  Unless required by applicable law or agreed to in writing, software        */
# /*  distributed under the License is distributed on an "AS IS" BASIS,          */
# /*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   */
# /*  See the License for the specific language governing permissions and        */
# /*  limitations under the License.                                             */
# /*                                                                             */
# /*******************************************************************************/

include ../make.defs

all: memmem hexval errors user internal libcgi

libcgi:
	$(PRINTFL) libcgi
	@$(CC) $(LDFLAGS) -o libcgi.so.1 errors.o hexval.o memmem.o user.o internal.o && echo OK
	$(PRINTFL) libcgi
	@$(AR) libcgi.a.1 user.o hexval.o errors.o internal.o memmem.o && echo OK

errors:
	$(PRINTFC) $@.o
	@$(CC) $(CFLAGS) -o $@.o -c $@.c && echo OK

hexval:
	$(PRINTFC) $@.o
	@$(CC) $(CFLAGS) -o $@.o -c $@.c && echo OK

memmem:
	$(PRINTFC) $@.o
	@$(CC) $(CFLAGS) -o $@.o -c $@.c && echo OK

user:
	$(PRINTFC) $@.o
	@$(CC) $(CFLAGS) -o $@.o -c $@.c && echo OK

internal:
	$(PRINTFC) $@.o
	@$(CC) $(CFLAGS) -o $@.o -c $@.c && echo OK

install:
	$(INSTALL) -m 444 libcgi.so.1 $(PREFIX)/lib
	$(INSTALL) -m 444 libcgi.a.1  $(PREFIX)/lib
	$(LN) libcgi.so.1 $(PREFIX)/lib/libcgi.so
	$(LN) libcgi.a.1 $(PREFIX)/lib/libcgi.a

clean:
	$(RM) memmem.o
	$(RM) user.o
	$(RM) internal.o
	$(RM) hexval.o
	$(RM) errors.o
	$(RM) user.o
	$(RM) libcgi.so.1
	$(RM) libcgi.a.1
