#
# Makefile for configuration files
# things to make:
#	all		same as gueser and restart
#	advise		the guesser output processor
#	diffpw		the password diff'er
#	gendict		the dictionary generator
#	trans		the word transformer
#	update		the password repository updater
#	Makefile	to regenerate the Makefile
#	clean		to delete intermediate files
#	clobber		to delete all files except the original sources
#			and the Makefile
#	clobberall	to delete all files except the original sources
#
#################################################################
# Copyright notice.						#
# This software is copyrighted (c) 1991 by Matt Bishop and the	#
# Trustees of Dartmouth College.  All rights reserved.		#
# 								#
# Author:	Matt Bishop					#
# Address:	Department of Mathematics and Computer Science	#
#	 	Dartmouth College				#
# 		Hanover, NH  03755-1831				#
# 		USA						#
# telephone:	+1 603 646 3267					#
# fax:		+1 603 646 1312					#
# internet:	Matt.Bishop@dartmouth.edu			#
# usenet:	...!decvax!dartvax!Matt.Bishop			#
#################################################################
#
VERSION="Version GAMMA 6/31/91 Matt.Bishop@dartmouth.edu"	# version

# the M4 configuration file



































# directory tree -- destination
DESTTOP	= /usr/windsor/bishop/src/testg
DESTLIB	= /usr/windsor/bishop/src/testg/lib
DESTINC	= /usr/windsor/bishop/src/testg/include
DESTBIN	= /usr/windsor/bishop/src/testg/bin
DESTADM = /usr/windsor/bishop/src/testg/adm
# directory tree -- source
TOP	= /usr/windsor/bishop/src/guesser
# include for library
LIBTOP	= $(TOP)/lib
LIBINC	= $(LIBTOP)/include
LIBTST	= $(LIBTOP)/testing
#
# some system files you may need
# if the system password encryption function is not in the
# usual C library, put it here
STDCRYPTLIB	= 
# if the usual library is not available, change the "U" to a "D"
STDCRYPTDEF	= -UNOSTDCRYPT
# version: which version of deszip do you want
VERSION	= des32
# system type: what is the font of your system?
SYSTYPE	= BSD4
# host type: it must match a file name in LIBINC, without the .h
HOSTTYPE	= dec5000



#
# useful programs
#
AR_MAKE	= ar rcv	# create a library archive
CC	= gcc	# C compiler
CHMOD	= chmod		# change protection mode
CP	= cp		# copy a file
CPP	= /lib/cpp	# C preprocessor
ECHO	= echo		# print arguments
LORDER	= lorder	# order for the loader
M4	= m4		# macro preprocessor
MV	= mv		# move a file
RANLIB	= ranlib	# generate a table of contents
RM	= rm		# delete a file
SED	= sed		# stream editor
#			# shell program -- give FULL PATH NAME HERE
#			# this must be on a separate line or subcommands
#			# break since make tries to exec the blank space
SHELL	= /bin/sh
TOUCH	= touch
TSORT	= tsort		# topological sort
#
# relevant options
#
C_OPTS		= -D$(SYSTYPE) -O -ansi -fstrength-reduce -fcombine-regs -finline-functions -fdelayed-branch 	# compiler flags
CPP_OPTS	= -D$(SYSTYPE) 	# preprocessor flags
CHMOD_RWEOEA	= 711	# change file mode to rwx--x--x
RM_FORCE	= -f	# delete file without any questions
SED_RE		= -e	# sed: next argument is an ed-style reg exp





#
# local defines
#
SRC	= trans.c diffpw.c
OBJ	= trans.o diffpw.o
SH	= advise.sh checknew.sh gendict.sh update.sh
EXEC	= trans diffpw advise checknew gendict update
SEDSH	= $(SED) $(SED_RE) 's,%%BINDIR%%,$(DESTBIN),g' \
		 $(SED_RE) 's,%%LIBDIR%%,$(DESTLIB),g'

# do it all
all:	$(EXEC)

# set up the shell scripts
advise:		advise.sh   ; $(SEDSH) $? > $@ ; $(CHMOD) $(CHMOD_RWEOEA) $@
checknew:	checknew.sh ; $(SEDSH) $? > $@ ; $(CHMOD) $(CHMOD_RWEOEA) $@
gendict:	gendict.sh  ; $(SEDSH) $? > $@ ; $(CHMOD) $(CHMOD_RWEOEA) $@
update:		update.sh   ; $(SEDSH) $? > $@ ; $(CHMOD) $(CHMOD_RWEOEA) $@

# remake the makefile
Makefile:
	m4 Makefile.m4 > Makefile

# clean up
clean:
	$(RM) $(RM_FORCE) $(OBJ)

# really clean up
clobber:
	-$(RM) $(RM_FORCE) $(OBJ) $(EXEC)

#restore to original state
clobberall:
	-$(RM) $(RM_FORCE) $(OBJ) $(EXEC) Makefile
