# Makefile for libsnk: SNK access for login and friends
#

DESLIBDIR=../des

# set DESLIB to the des library you need to use
DESLIB=$(DESLIBDIR)/libdes.a

SYSLIBS=

# the default is USE_RAND.  override this with specific cases below
RANDOM=-DUSE_RAND

CFLAGS=$(RANDOM) -O

OBJS=snk.o snkaccess.o snkfiles.o snk_getpass.o snk_crypt.o rand.o \
       snk_ftp.o snk_encrypt.o

RANLIB=ranlib

what:
	@echo This Makefile is not to be invoked directly 1>&2; exit 1


# For systems which require use of random/srandom, add "RANDOM=-DUSE_RANDOM"
# to corresponding "@make all" line below:

386bsd bsdi bsd44 freebsd ultrix4 sunos4 newsos4 decosf1 linux:
	@make all

hpux9:
	@make all RANLIB=echo

sysv4 sunos5 irix5:
	@make all SYSLIBS=-lnsl RANLIB=echo

all: libsnk.a snkkey

libsnk.a: $(OBJS)
	rm -f libsnk.a
	ar rv libsnk.a $(OBJS)
	$(RANLIB) libsnk.a

snk_encrypt.o: snk_encrypt.c
	$(CC) $(CFLAGS) -I$(DESLIBDIR) -c $<

snkkey: snkkey.o rand.o snk_encrypt.o
	cc -o snkkey snkkey.o rand.o snk_encrypt.o $(DESLIB)

clean:
	rm -f *.o libsnk.a snkkey core

#
# include file dependencies
#

snk.o: snk.c snk.h
snk_crypt.o: snk_crypt.c snk.h
snk_ftp.o: snk_ftp.c snk.h
snk_getpass.o: snk_getpass.c snk.h
snkfiles.o: snkfiles.c snk.h
snkkey.o: snkkey.c snk.h

