###
# This program is copyright Alec Muffett 1993. The author disclaims all
# responsibility or liability with respect to it's usage or its effect
# upon hardware or computer systems, and maintains copyright as set out
# in the "LICENCE" document which accompanies distributions of Crack v4.0
# and upwards.
###

###
# You MIGHT want to remove "-Bstatic" if you're not on SunOS machines.
# If you ARE, then leave it and suffer a few extra Kb for security's sake
###

#SunOS users (and others?) should consider static linking of their passwd binary
#CFLAGS= -O -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"' -Bstatic

CFLAGS	= $(RPM_OPT_FLAGS) -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"'
LDFLAGS	= -L../cracklib -lcrack
LIBS	= ../cracklib/libcrack.so
sbindir = /usr/sbin

all:	packer unpacker testnum teststr testlib
	touch all

packer: packer.o $(LIBS)
	$(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)

unpacker: unpacker.o $(LIBS)
	$(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)

testnum: testnum.o $(LIBS)
	$(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)

teststr: teststr.o $(LIBS)
	$(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)

testlib: testlib.o $(LIBS)
	$(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)

clean:
	-rm -f *.o *~ all
	-rm teststr testnum testlib packer unpacker

install: all
	install -m 755 mkdict packer $(ROOT)$(sbindir)
