 #      $Source: /home/fergia/CVS//tcfs-openbsd/tcfslib-1.0.0/lib/Makefile,v $
 #      $Revision: 1.1.1.1 $
 #      $Date: 2000/06/07 12:21:31 $
 #      $State: Exp $
 #      $Author: fergia $
 #      $Lockers$

LIBDIR=          /usr/tcfs/lib
ETCDIR=          /usr/tcfs/etc

OBJS=	tcfs_key.o tcfs_database.o tcfs_base64.o tcfs_errno.o tcfs_genkey.o \
	tcfs_global.o tcfs_flags.o tcfs_tab.o md5_if.o md5.o des.o 

SRCS=	tcfs_key.c tcfs_database.c tcfs_base64.c tcfs_errno.c tcfs_genkey.c \
	tcfs_global.c tcfs_flags.c tcfs_tab.o md5_if.c md5.c des.c


LD=		-L/usr/local/lib -lgdbm  
CFLAGS=		-shared -fPIC -W -pedantic -g -I../include -I/usr/local/include\
		#-DTCFS_DEBUG
CC=		gcc
LINKEDITOR=	ld

TCFSLIB=libtcfs
MAJOR=1
MINOR=0
TCFSLIBNAME=$(TCFSLIB).so.$(MAJOR).$(MINOR)

all: static shared   

dep:
	makedepend $(SRCS)

static: $(OBJS)
	ar r $(TCFSLIB).a $(OBJS)
	ranlib $(TCFSLIB).a

shared: $(OBJS)
	$(LINKEDITOR) -shared -soname $(TCFSLIB).so -o $(TCFSLIBNAME) $(OBJS) \
	$(LD) 
 

install:
	install -d -o root -g wheel -m755 $(ETCDIR)
	install -d -o root -g wheel -m755 $(LIBDIR)
	install -c -o root -g wheel -m644 $(TCFSLIB).a $(LIBDIR)
	install -c -o root -g wheel -m644 $(TCFSLIBNAME) $(LIBDIR)

uninstall:
	rm -f $(LIBDIR)/$(TCFSLIB).a $(LIBDIR)/$(TCFSLIB).so \
	$(LIBDIR)/$(TCFSLIBNAME)

clean:
	rm -f *.o *.a *.so.*  
