# Makefile for Adventure (DECUS Release 4 modified for GNU g77)


# To compile on GNU g77 on an i386 System (e.g. Linux/386) just say 'make'.

# To compile on other Unices, if you just don't have an i386 system,
# but use GNU g77, modify FFLAGS to suit your taste.
# If you're using another FORTRAN 77 compiler, making the change marked
# below (FLIBS) will probably do the job, but note that this is untested.


objects = advent.o ainit.o amain.o asubr.o

F77 = g77 # modifiy these 2 lines for non-GNU setup
FFLAGS = -O3 -ffast-math -fomit-frame-pointer
FLIBS = # for GNU g77
#FLIBS = -lf77 -lI77 -lm # for other FORTRAN 77
INSTALL = install
BINDIR = /usr/local/bin
LIBDIR = /usr/local/lib/advent

.PHONY: all clean

all: advent

*.f: aparam.for

advent: $(objects)
	$(F77) $(LDFAGS) $^ -o $@ $(LOADLIBES) $(FLIBS)

install: advent
	$(INSTALL) -s advent $(BINDIR)
	$(INSTALL) -d $(LIBDIR)
	$(INSTALL) atext.txt $(LIBDIR)

clean:
	-$(RM) advent *.o
