# Don't make this directly.  Make using Makefile, which ensures that
# Makefile.dep has been made.  If you absolutely use must it directly, do
# "make depends" first!

CONFIG = ../.configure
include $(CONFIG)

# Where to search for .mod files
M = -I. -I.. -I $(HOME)/progs/LR/lib/$(PLAT)/

# Where to search for libraries
L = $(HOME)/progs/LR/lib/$(PLAT)

# Where to build it
W = ./

# Extension for object files
O = o

# Where operational programs are installed
INSTALLDIR = $(HOME)/1401/progs/ALDgen/bin/

all: $(W)ALDgen

include ../Makefile.dep

$(W)ALDgen: $(OBJ) symbol_table.$O tree.$O $L/liblr.a
	$(FC) -o $(W)ALDgen $(LDOPTS) $(OBJ) $L/machine.o -L$L -llr

../Lexer_Table.f9h: ../ALDgen.lex
	$(INSTALLDIR)/lex ../ALDgen.lex ../Lexer_Table.f9h ../ALDgen_lex.lls

../Parser.f9h: ../ALDgen.grm
	$(INSTALLDIR)/lr ../ALDgen.grm ../Parser.f9h ../ALDgen.lls

../symbol_types.f9h: ../symbol_types.in
	$(INSTALLDIR)/GenSym ../symbol_types.in ../symbol_types.f9h

depends:
	( cd ..; \
        grep -i -e "^ *use " -e "^ *include " -e "^ *module" *.[Ff]90 | \
           sort | uniq | \
           MakeDep -b '$$(FC) -c $$(FOPTS) $$M' -e -p../ > \
           Makefile.dep )

install:
	cp ALDgen $(INSTALLDIR)

clean:
	rm -f ALDgen *.$O *.mod

# "$RCSfile: Make2,v $"
# "$Id: Make2,v 1.1 2022/01/24 22:11:37 vsnyder Exp $"

# $Log: Make2,v $
# Revision 1.1  2022/01/24 22:11:37  vsnyder
# Initial commit
#
