
 #      $Source: /home/fergia/CVS/tcfs-openbsd/tcfsutils-1.0.0/src/Makefile,v $
 #      $Revision: 1.2 $
 #      $Date: 2000/06/07 13:24:22 $
 #      $State: Exp $
 #      $Author: fergia $
 #      $Lockers$
 
MANDIR =         /usr/tcfs/man
BINDIR =         /usr/tcfs/bin
SBINDIR =        /usr/tcfs/sbin

MAJOR=		1	
MINOR=		0
RELEASE=	0


OBJS=	auth.o tcfsaddgroup.o tcfsadduser.o tcfsgenkey.o tcfsputkey.o \
	tcfsrmgroup.o tcfsrmkey.o tcfsrmuser.o tcfsflag.o tcfsrun.o tcfstat.o \
	tcfsrecover.o

SRCS=	auth.c tcfsaddgroup.c tcfsadduser.c tcfsgenkey.c tcfsputkey.c \
	tcfsrmgroup.c tcfsrmkey.c tcfsrmuser.c  tcfsflag.c tcfsrun.c tcfstat.c \
	tcfsrecover.c

NORMAL_BINSS=tcfsgenkey tcfsputkey tcfsrmkey tcfsrun tcfstat tcfsrecover
NORMAL_BINS=tcfsflag 
ROOT_BINS=tcfsadduser tcfsrmuser tcfsaddgroup tcfsrmgroup
BINS=$(NORMAL_BINS) $(NORMAL_BINSS) $(ROOT_BINS)

CC=gcc


CFLAGS=-Wall -g -I/usr/tcfs/include -I../include\
	-DMAJOR=$(MAJOR) -DMINOR=$(MINOR) -DRELEASE=$(RELEASE) #-DTCFS_DEBUG

#/usr/tcfs/lib must ne directory in wich tcfslib was installed
LDFLAGS=-L/usr/tcfs/lib -L/usr/local/lib -ltcfs 

all: $(BINS) 

tcfsadduser: tcfsadduser.o 
	$(CC) tcfsadduser.o -o tcfsadduser  $(LDFLAGS)

tcfsrmuser: tcfsrmuser.o
	$(CC) tcfsrmuser.o -o tcfsrmuser  $(LDFLAGS)

tcfsrmkey: tcfsrmkey.o 
	$(CC) tcfsrmkey.o -o tcfsrmkey $(LDFLAGS)

tcfsrmgroup: tcfsrmgroup.o 
	$(CC) tcfsrmgroup.o -o tcfsrmgroup $(LDFLAGS)

tcfsaddgroup: tcfsaddgroup.o auth.o
	$(CC) tcfsaddgroup.o auth.o -o tcfsaddgroup $(LDFLAGS)


tcfsgenkey: tcfsgenkey.o auth.o 
	$(CC) tcfsgenkey.o auth.o -o tcfsgenkey $(LDFLAGS)

tcfsputkey: tcfsputkey.o auth.o 
	$(CC) tcfsputkey.o auth.o -o tcfsputkey $(LDFLAGS)

tcfsflag: tcfsflag.o
	$(CC) tcfsflag.o -o tcfsflag $(LDFLAGS)

tcfsrun: tcfsrun.o
	$(CC) tcfsrun.o -o tcfsrun $(LDFLAGS)

tcfstat: tcfstat.o
	$(CC) tcfstat.o -o tcfstat $(LDFLAGS)

tcfsrecover: tcfsrecover.o
	$(CC) tcfsrecover.o -o tcfsrecover $(LDFLAGS)

dep:
	makedepend $(SRCS)

clean:
	rm -f *.o $(BINS)

install: $(BINS)
	install -d -g wheel -o root -m755 $(BINDIR) $(SBINDIR)
	install -c -g wheel -o root -m4755 $(NORMAL_BINSS) $(BINDIR)
	install -c -g wheel -o root -m755 $(NORMAL_BINS) $(BINDIR)
	install -c -g wheel -o root -m755 $(ROOT_BINS) $(SBINDIR)

uninstall:
	cd $(BINDIR) ; rm -f $(NORMAL_BINS) ; rm -f $(NORMAL_BINSS) 
	cd $(SBINDIR) ; rm -f $(ROOT_BINS)

