#
#
#      Dictionary and Morphological Analyser Prototype
# 
#       Copyright Graeme Ritchie, Alan Black,
#                 Steve Pulman and Graham Russell  1987
# 
#          ---------------------------------------------
#          |    Not to be used for military purposes   |
#          ---------------------------------------------
# 
#      make        builds a version for 42.15 Franz with 
#                         unrestricted unification
#      make 42u    the same
#      make 42t    for Franz 42.15 with term unification
#      make 38     builds a version for 38.79 Franz with
#                         unrestricted unification
#      make 38u    the same
#      make 38t    for Franz 38.75 with term unification
#      make clean  removes object code files from the directory
#      
#      Note that if you are unsure about which version to compile for
#      make 38 is probably safer.  In either case only the UNIX level
#      commands are effected by the changes in the different versions
#      of franz
#
#      Note a common lisp version can also be made, see the above directory
#
#      See Section 9 in the user manual for details of intallation
#      
#      $Revision: 3.0 $
#      $Date: 87/08/04 14:20:17 $
#
#
COMPFILES = makesp.o mkwgram.o makelex.o maload.o mafuncs.o
RUNFILES = morphan.o analyse.o autorun.o mconcat.o spdebug.o debug.o
UNIXSTUFF = dci mklex mkgram mksp
PARSE = parserouts readatom
COMMON = macros subrout
LFLAGS =
VERSION = 42
# Unification type can be "u" or "t"
UTYPE = u

code	:  keywords $(COMPFILES) $(RUNFILES) $(UNIXSTUFF)
	chmod +w code
	touch code
38	: 
	make VERSION=38 UTYPE=u
38t	:
	make VERSION=38 UTYPE=t
38u	:
	make VERSION=38 UTYPE=u
42t	:
	make VERSION=42 UTYPE=t
42u	:
	make VERSION=42 UTYPE=u
#
keywords : keywords.$(VERSION)
	cp keywords.$(VERSION) keywords
#
#  Files dependant on the unification type
#  either *.u = unrestricted unification
#   or    *.t = term unification
#
catrouts : catrouts.$(UTYPE)
	cp catrouts.$(UTYPE) catrouts
unify :    unify.$(UTYPE)
	cp unify.$(UTYPE) unify
parser :   parser.$(UTYPE)
	cp parser.$(UTYPE) parser
specrouts : specrouts.$(UTYPE)
	cp specrouts.$(UTYPE) specrouts
#
#  Standard lisp files
#
makesp.o	: makesp.l $(COMMON) kkruletype $(PARSE) parsesp \
		  keywords catrouts
	liszt $(LFLAGS) makesp.l
mkwgram.o	: mkwgram.l dclsconv $(PARSE) $(COMMON) keywords \
		  unify catrouts specrouts
	liszt $(LFLAGS) mkwgram.l
makelex.o	: makelex.l dclsconv entryconv lruleconv $(PARSE) $(COMMON)\
		  keywords unify catrouts specrouts
	liszt $(LFLAGS) makelex.l
mafuncs.o	: mafuncs.l $(COMMON) keywords catrouts
	liszt $(LFLAGS) mafuncs.l
maload.o	: maload.l keywords
	liszt $(LFLAGS) maload.l
analyse.o	: analyse.l parser unify $(COMMON) keywords catrouts
	liszt $(LFLAGS) analyse.l
autorun.o	: autorun.l spmoveau $(COMMON) keywords catrouts
	liszt $(LFLAGS) autorun.l
mconcat.o	: mconcat.l spmoveau $(COMMON) keywords
	liszt $(LFLAGS) mconcat.l
morphan.o	: morphan.l readatom $(COMMON) keywords parserouts \
		  catrouts specrouts
	liszt $(LFLAGS) morphan.l
spdebug.o	: spdebug.l readatom $(COMMON) keywords
	liszt $(LFLAGS) spdebug.l
debug.o		: debug.l readatom $(COMMON) keywords
	liszt $(LFLAGS) debug.l
#
#     UNIX level commands that access the dictionary 
#
dci		: dci.l morphan.l readatom $(COMMON) keywords \
			parserouts catrouts
	liszt -r -o dci dci.l
mklex		: mklex.l maload.l $(COMMON) keywords
	liszt -r -o mklex mklex.l
mkgram		: mkgram.l maload.l $(COMMON) keywords
	liszt -r -o mkgram mkgram.l
mksp		: mksp.l maload.l $(COMMON) keywords
	liszt -r -o mksp mksp.l
#
#    clean - remove rubbish files
#
clean:
		rm -f ${UNIXSTUFF} ; rm -f keywords *.o 
		rm -f unify catrouts specrouts parser

