X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=Makefile;h=a34c7a616fdfc65e0ba668bf93ed96652b5dc2cf;hb=f5302b3b465d4920a8c735c67910160ff18cdd6c;hp=1b88b81d8e8398c7b693eaff3dca3688ff3e9763;hpb=24d7aeaf8a1dc13034884044139728045604fc37;p=open-adventure.git diff --git a/Makefile b/Makefile index 1b88b81..a34c7a6 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,61 @@ -# NOTE: This version of Adventure was developed by the author on private -# equipment, and has been ported to Sun for entertainment purposes only. -# The author (Don Woods) retains full rights to the work. +# Makefile for the open-source release of adventure 2.5 -OBJS=main.o init.o actions1.o actions2.o score.o misc.o datime.o +CCFLAGS=-std=c99 +LIBS=-lrt +UNAME_S := $(shell uname -s) +GCCVERSIONGTEQ4 := $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 4) +ifeq ($(UNAME_S),Darwin) + LIBS= +else ifeq "$(GCCVERSIONGTEQ4)" "1" + CC=c99 +endif + +OBJS=main.o init.o actions1.o actions2.o score.o misc.o +SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO adventure.text advent.text control misc.h main.h share.h funcs.h .c.o: - gcc -O $(DBX) -c $< + $(CC) $(CCFLAGS) -O $(DBX) -c $< -adventure: $(OBJS) - gcc -O $(DBX) -o adventure $(OBJS) +advent: $(OBJS) database.o + $(CC) $(CCFLAGS) -O $(DBX) -o advent $(OBJS) database.o $(LIBS) -main.o: misc.h funcs.h +main.o: main.h misc.h funcs.h database.h -init.o: misc.h main.h share.h funcs.h +init.o: misc.h main.h share.h funcs.h database.h -actions1.o: misc.h main.h share.h funcs.h +actions1.o: misc.h main.h share.h funcs.h database.h actions2.o: misc.h main.h share.h funcs.h -score.o: misc.h main.h share.h +score.o: misc.h main.h share.h database.h + +misc.o: misc.h main.h database.h + +database.c database.h: compile + ./compile + $(CC) $(CCFLAGS) -O $(DBX) -c database.c + +clean: + rm -f *.o advent advent.html advent.6 database.[ch] compile + cd tests; $(MAKE) --quiet clean + +check: advent + cd tests; $(MAKE) --quiet + +# Requires asciidoc and xsltproc/docbook stylesheets. +.asc.6: + a2x --doctype manpage --format manpage $< +.asc.html: + a2x --doctype manpage --format xhtml -D . $< + rm -f docbook-xsl.css + +advent-$(VERS).tar.gz: $(SOURCES) advent.6 + tar --transform='s:^:advent-$(VERS)/:' --show-transformed-names -cvzf advent-$(VERS).tar.gz $(SOURCES) advent.6 + +dist: advent-$(VERS).tar.gz + +release: advent-$(VERS).tar.gz advent.html + shipper version=$(VERS) | sh -e -x -misc.o: misc.h main.h +refresh: advent.html + shipper -N -w version=$(VERS) | sh -e -x