
# Set these to the location of the RSA and DES libraries
RSAREF	= ../../rsaref/install/rsaref.a
RSAINC	= ../../rsaref/source
DES	= ../../des/libdes.a
DESINC	= ../../des

# The local objects, targets, etc.
OBJ	= auth.o
OBJS	= authcrypt.o fastrand.o rsacrypt.o
LIBRSA	= librsa.a
LIBDES	= libdes.a
CFLAGS	= $(AFLAGS) -I.. -I$(RSAINC) -I$(DESINC)

all: genkeys $(OBJ)

genkeys: genkeys.o rsacrypt.o ../packet.o $(LIBRSA)
	$(CC) -o $@ genkeys.o rsacrypt.o ../packet.o -L. -lrsa

$(OBJ): $(OBJS) $(LIBRSA) $(LIBDES)
	ld -r -o $@ $(OBJS) -L. -lrsa -ldes

authcrypt.o: libdes.h

libdes.h: $(DESINC)/des.h
	ln -s $< $@

$(LIBRSA): $(RSAREF)
	ln -s $< $@

$(LIBDES): $(DES)
	ln -s $< $@

clean:
	rm -f $(OBJ) $(OBJS) $(LIBRSA) $(LIBDES) libdes.h genkeys.o genkeys
