#
# Author: Noel V Aguilar
# CGI-LIB Library
# Release 1.4
#
# This library is free softare; you can redistribute it
# and/or modify it.
#
# You can compile this library by simply running 'make'
# and then copy the cgi-lib.a to the your lib directory
# and the cgi-lib.h and html-lib.h files into your
# include directory manually.  This will allow the linker
# to automatically include the library or you can copy the
# files to where your development is being done and link it
# manually.
#
# For updates or to report bugs please go to:
# http://www.geocities.com/SiliconValley/Vista/6493/
#
# This library is distributed in the hope that it will be
# useful but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.
#
# CC = gcc
#-----------------------------------------------------
TOPDIR  :=  $(shell /bin/pwd)
TOPDIR  :=  $(TOPDIR)/../..

include $(TOPDIR)/prerules.mk
#-----------------------------------------------------
CFLAGS +=-fPIC -Wall -c -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_SYS_IOCTL_H=1

OBJS= pack.o unpack.o copy.o gen_uuid.o isnull.o unparse.o compare.o clear.o parse.o




all: libuuid

%.c : %.o
	$(CC) $(CFLAGS) $<

libuuid: $(OBJS)
	$(CC) -shared -Wl,-soname,libuuid.so.0 -o libuuid.so.0.0 $(OBJS)
	$(STRIP) libuuid.so.0.0
	ln -sf libuuid.so.0.0 libuuid.so.0
	ln -sf libuuid.so.0 libuuid.so
	cp -afv libuuid* $(COMM_LIB_PATH)

clean:
	@echo Cleaning up
	rm -f *.[od]
	rm -f libuuid*
	rm -f $(COMM_LIB_PATH)/libuuid*

install:
	cp -afv libuuid.so*  $(T_LIB)

