# Yale buildtemplate
# redone by Bill Nowicki August 1982
# and Bill Nowicki September 1984


YALELIBS = -lVgts -lleaf -lpup -lsun100graphics -lsfonts
YALELDOPTS = -V -v$(Xx) -o Yale -r -M
YALEOBJS = datamung.b datamung1.b  error.b evalexp.b expandcell.b \
gc.b  yalefe.b parse.b parseexp.b reparse.b siltprint.b \
dynamicmenu.b symbol.b xroutines.b yaleio.b yalebox.b \
yaleinsert.b yaleinssym.b yaleselect.b yaledelete.b \
yaleshowsel.b yalemove.b yalereref.b status.b \
yalearray.b globals.b yaleshow.b copycelldef.b 

DALEOBJS = dale.o datamung.o datamung1.o  error.o evalexp.o expandcell.o \
gc.o lex.o yalefe.o parse.o parseexp.o reparse.o siltprint.o \
dynamicmenu.o symbol.o xroutines.o yaleio.o yalebox.o \
yaleinsert.o yaleinssym.o yaleselect.o yaledelete.o \
yaleshowsel.o yalemove.o yalereref.o status.o \
yalearray.o globals.o yaleshow.o copycelldef.o 

YALESRC = aledefs.h alerecs.h mouse.h \
dale.c datamung.c datamung1.c  error.c evalexp.c expandcell.c \
gc.c lex.c yalefe.c parse.c parseexp.c reparse.c siltprint.c \
dynamicmenu.c symbol.c xroutines.c yaleio.c yalebox.c \
yaleinsert.c yaleinssym.c yaleselect.c yaledelete.c \
yaleshowsel.c yalemove.c yalereref.c status.c \
yalearray.c globals.c yaleshow.c copycelldef.c 

#VGTSOBJS = vgts.b leaf.b

#VGTSSRC = vgts.c leaf.c

# we use /usr/{,x}V/include/m68k because there is no mi directory there.
#ifdef X
CFLAGS = -O -DVAX -I/usr/xV/include/m68k
#else X
CFLAGS = -O -DVAX -I/usr/V/include/m68k
#endif X

STUBS = -lVgts
VSTUBS = 

# note - the old Yale does not work any more
#ifdef M68K
#test.$(MACHINE): $(YALEOBJS) $(VGTSOBJS) lexunix.b
#	cc68 $(YALELDOPTS) $(YALEOBJS)  lexunix.b $(VGTSOBJS) $(YALELIBS) 
#endif M68K


#ifdef M68K
dale.m68k: $(YALEOBJS) dale.b lex.b
	cc68 -V -vx -o dale.m68k $(YALEOBJS) dale.b lex.b $(VSTUBS)
	nm68 -nh dale.m68k > dale.sym
lexunix.b: lex.c
	cc68 -O -c -DUNIX lex.c -o lexunix.b
install: 
	$(NETINSTALL) -p -x dale.m68k $(VSYS)/bin
#endif M68K

# build dale for Unix
#ifdef UNIX
# The .c.o rule for yale/unix is diffent from what is defined in the 
# /xV/cmds/unix/buildtemplate. That is CFLAGS.
.c.o:
	cc $(CFLAGS) -c $*.c
dale: $(DALEOBJS)
	cc -o dale $(DALEOBJS) lex.o $(STUBS)
lex.o: lex.c
	cc -c $(CFLAGS) -DUNIX lex.c
install: 
	$(NETINSTALL) -x -m 775 dale /usr/local/bin

#endif UNIX


$(YALEOBJS): aledefs.h

clean:
	rm -f *.BAK *.CKP
	rm -f *.o *.b *.sym *.m68k dale *.s

yale-listings:
	yapp $(YALESRC)

listings: yale-listings


relink:
	rm -f *.$(MACHINE)
