# Makefile:	anidel@mikonos.dia.unisa.it 04/02/96

#
# Please make no change to the lines below unless you know what are you doing
#

.PHONY: all install clean

EXECUTABLES=tcfslogin tcfslogout tcfsgenkey tcfsviewkey passwd lsecure chsecure

TCFSDIR=../..

CFLAGS= -w -O2 $(DEFINES) -I/usr/include/isode -I$(TCFSDIR)
LDFLAGS= -O2 -L.
LOADLIBES=-lsecude

TCFSGENKEYOBJ=tcfsencode.o d3des.o gettcfskey.o keyboard.o tcfsgenkey.o

TCFSINOBJ=tcfsdecode.o d3des.o gettcfskey.o tcfslogin.o

TCFSOUTOBJ=tcfsdecode.o d3des.o gettcfskey.o tcfslogout.o

TCFSVIEWOBJ=tcfsviewkey.o d3des.o gettcfskey.o tcfsdecode.o

PASSWDOBJ=tcfsencode.o tcfsdecode.o d3des.o passwd.o

LSECUREOBJ=lsecure.o $(TCFSDIR)/tcfs_prot_xdr.o

CHSECUREOBJ=chsecure.o $(TCFSDIR)/tcfs_prot_xdr.o

all:	$(EXECUTABLES) install_local

install_local:
	@install -s -m 755 tcfslogin ../bin/
	@install -s -m 755 tcfslogout ../bin/
	@install -s -m 711 tcfsgenkey ../bin/
	@install -s -m 755 tcfsviewkey ../bin/
	@install -s -m 4711 passwd ../bin/
	@install -s -m 755 lsecure ../bin/
	@install -s -m 755 chsecure ../bin/

tcfsgenkey: $(TCFSGENKEYOBJ)

tcfslogin: $(TCFSINOBJ)

tcfslogout: $(TCFSOUTOBJ)

tcfsviewkey: $(TCFSVIEWOBJ)

passwd: $(PASSWDOBJ)

lsecure: $(LSECUREOBJ)

chsecure: $(CHSECUREOBJ)

chsecure.c: ../../tcfs_prot.h ../../tcfs_prot_xdr.c

lsecure.c: ../../tcfs_prot.h ../../tcfs_prot_xdr.c

../../tcfs_prot_xdr.c: ../../tcfs_prot.x
	@(cd $(TCFSDIR); make tcfs_prot_xdr.c)

../../tcfs_prot.h: ../../tcfs_prot.x
	@(cd $(TCFSDIR); make tcfs_prot.h)

clean:
	@echo Cleaning src...
	@rm -f *.o $(EXECUTABLES)
