#	Change config to match the .mk file that you are using

CONFIG = ../config/system.mk

include $(CONFIG)

#	Do not change anything below here. It should be set by config

GK_SRC = genkeys.c $(RANDOMC)
GK_OBJS = genkeys.o $(RANDOMO)

KM_SRC = keyman.c data.c getpath.c
KM_OBJS = keyman.o data.o getpath.o

# for people with braindead 'cc's that don't like -c foo.c -o foo.o
# and a hosed make
.c.o: ; $(CC) $(CFLAGS) -c $*.c

LIBS = $(RSA_LIBS) $(EXTRALIBS)

INCS = $(RSA_INCS) $(EXTRAINCS)

CFLAGS = $(OPT) $(RSA_FLAGS) $(FLAGS) $(INCS) $(DIRS)

all: $(PMAKE) genkeys keyman

genkeys: $(GK_OBJS)
	$(CC) $(CFLAGS) -o $@ $(GK_OBJS) $(LIBS)

keyman: $(KM_OBJS)
	$(CC) $(CFLAGS) -o $@ $(KM_OBJS) $(LIBS)

clean:
	/bin/rm -f *.o make.out core *~ #*#
	rmdependencies
	
reallyclean:  clean 
	rm -f genkeys keyman

uninstall:
	-cd $(LIBDIR); rm -f genkeys keyman

install: genkeys keyman
	-@if [ ! -d $(LIBDIR) ]; then \
          /bin/mkdir $(LIBDIR); \
        fi
	$(INSTALL) $(INSTALLOPTS) genkeys $(LIBDIR)/genkeys
	$(INSTALL) $(INSTALLOPTS) keyman $(LIBDIR)/keyman

depend:
	makedepend $(CFLAGS) -f Makefile $(GK_SRC) $(KM_SRC) 

rmdependencies:
	makedepend

#####
# DO NOT DELETE THIS LINE -- make depend depends on it.
