#
# T.C.F.S. Library 0.1 $Revision: 2.7 $
#
# Authors:	Giuseppe Cattaneo, <cattaneo@udsab.dia.unisa.it>
#		Giuseppe Persiano, <giuper@udsab.dia.unisa.it>
#		Luigi Catuogno, <luicat@mikonos.dia.unisa.it>
#		Angelo Celentano, <angcel@mikonos.dia.unisa.it>
#		Andrea Cozzolino, <andcoz@mikonos.dia.unisa.it>
#		Aniello Del Sorbo, <anidel@mikonos.dia.unisa.it>
#		Ermelindo Mauriello, <ermmau@mikonos.dia.unisa.it>
#
# Permission  to use,  copy,  and modify this  software  without fee
# is hereby granted, provided that this entire notice is included in
# all  copies  of  any  software  which  is  or includes  a copy  or
# modification of this  software and in all copies of the supporting
# documentation for such software.
#
# This  software maybe  be used for  any purpose provided  the above 
# copyright  notice  is  retained.  It is  supplied as  is, with  no 
# warranty expressed or implied.
#/

#
#       $Source: /home/anidel/Wip/TCFS-2.2.0a/tcfslib-0.3/RCS/Makefile,v $
#        $State: Exp $
#
#     $Revision: 2.7 $
#       $Author: anidel $
#         $Date: 1998/12/11 10:24:09 $
#       $Locker:  $
#/

# -+-_== 

OBJS=src/tcfs_keymaint.o src/tcfs_dbmaint.o src/encode.o src/decode.o \
	src/md5_if.o src/md5.o src/des.o src/gentcfskey.o

SRCS=src/tcfs_keymaint.c src/tcfs_dbmaint.c src/encode.c src/decode.c \
	src/md5_if.c src/md5.c src/des.c src/gentcfskey.c

DEFINES=-DGDBM_SUPPORT
CFLAGS=-W -pedantic -g $(DEFINES) -Iinclude -shared
CC=gcc

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

all: static shared 

dep:
	makedepend $(SRCS)

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

shared: $(OBJS)
	$(CC) -shared -Wl,-soname,$(TCFSLIB).so $(DEFINES) -o $(TCFSLIBNAME) $(OBJS) -lgdbm

pam_module: pam_tcfs.o lib
	$(LD) -x -shared pam_tcfs.o \
	-L. -lpam -ldl -lpam_misc -lgdbm -ltcfs -o pam_tcfs.so

install: shared static
	install -o root -g root -m644 $(TCFSLIB).a /usr/lib
	install -o root -g root -m644 include/tcfs* /usr/include
	install -o root -g root -m644 $(TCFSLIBNAME) /usr/lib
	ldconfig

clean:
	@rm -f *.a *.so.* src/*.o
