# Makefile:	anidel@mikonos.dia.unisa.it 28/10/96

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

#.PHONY: all install clean

EXECUTABLES=tcfslogin tcfslogout tcfsgenkey passwd
INSTALLDIR=/usr/local/bin

TCFSDIR=.
SRCDIR=$(TCFSDIR)/src
CRYPTDIR=$(TCFSDIR)/crypt

CC=gcc
CFLAGS= -w -O2 $(DEFINES) -I$(TCFSDIR)/include -I../../ -I/home/ermmau/tcfs
LDFLAGS= -O2 -L.
LOADLIBES=

TCFSGENKEYOBJ=$(CRYPTDIR)/md5.o $(CRYPTDIR)/md5_if.o $(SRCDIR)/tcfsencode.o \
	../../des.o $(SRCDIR)/keyboard.o $(SRCDIR)/tcfsgenkey.o \
	$(SRCDIR)/gettcfskey.o

TCFSINOBJ=$(SRCDIR)/tcfsdecode.o $(SRCDIR)/gettcfskey.o $(SRCDIR)/tcfslogin.o \
	../../des.o

TCFSOUTOBJ=$(SRCDIR)/tcfsdecode.o $(SRCDIR)/gettcfskey.o \
	$(SRCDIR)/tcfslogout.o ../../des.o

PASSWDOBJ=$(SRCDIR)/tcfsencode.o $(SRCDIR)/tcfsdecode.o $(SRCDIR)/passwd.o \
	../../des.o

all:	$(EXECUTABLES)

install: 
	install -m 7555 -g root -o root -s tcfslogin $(INSTALLDIR)
	install -m 7555 -g root -o root -s tcfslogout $(INSTALLDIR)
	install -m 7555 -g root -o root -s tcfsgenkey $(INSTALLDIR)

tcfsgenkey: $(TCFSGENKEYOBJ)
	$(CC) -o tcfsgenkey $(TCFSGENKEYOBJ)

tcfslogin: $(TCFSINOBJ)
	$(CC) -o tcfslogin $(TCFSINOBJ)

tcfslogout: $(TCFSOUTOBJ)
	$(CC) -o tcfslogout $(TCFSOUTOBJ)

tcfsviewkey: $(TCFSVIEWOBJ)
	$(CC) -o tcfsviewkey $(TCFSVIEWOBJ)

passwd: $(PASSWDOBJ)
	$(CC) -o passwd $(PASSWDOBJ)

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