X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=Makefile;h=67e321b4f4545e6cc1666b6767ae33d124e0ae8b;hb=9b66a6511b2e48a7db9c41e19565f75d179febe0;hp=95b561e59744192e8a9c31642cc1523a42ad9c79;hpb=e3e01af7fa1cd543f631f074c73f691d1f6315be;p=open-adventure.git diff --git a/Makefile b/Makefile index 95b561e..67e321b 100644 --- a/Makefile +++ b/Makefile @@ -1,43 +1,75 @@ # Makefile for the open-source release of adventure 2.5 -OBJS=main.o init.o actions1.o actions2.o score.o misc.o -SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO advent.text control +VERS=1.0 + +CC?=gcc +CCFLAGS+=-std=c99 +LIBS= +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) + LIBS=-lrt +endif + +OBJS=main.o init.o actions1.o actions2.o score.o misc.o database.o +SOURCES=$(OBJS:.o=.c) compile.c advent.h funcs.h adventure.text Makefile control .c.o: - gcc -O $(DBX) -c $< + $(CC) $(CCFLAGS) $(DBX) -c $< + +advent: $(OBJS) database.o + $(CC) $(CCFLAGS) $(DBX) -o advent $(OBJS) $(LDFLAGS) $(LIBS) + +main.o: advent.h funcs.h database.h + +init.o: advent.h funcs.h database.h + +actions1.o: advent.h funcs.h database.h -advent: $(OBJS) - gcc -O $(DBX) -o advent $(OBJS) +actions2.o: advent.h funcs.h -main.o: misc.h funcs.h +score.o: advent.h database.h -init.o: misc.h main.h share.h funcs.h +misc.o: advent.h database.h -actions1.o: misc.h main.h share.h funcs.h +database.o: database.h -actions2.o: misc.h main.h share.h funcs.h +funcs.h: database.h -score.o: misc.h main.h share.h +compile: compile.c + $(CC) $(CCFLAGS) -o $@ $< -misc.o: misc.h main.h +database.c database.h: compile adventure.text + ./compile + $(CC) $(CCFLAGS) $(DBX) -c database.c + +html: index.html advent.html history.html hints.html clean: - rm -f *.o advent advent.html advent.6 adventure.data + rm -f *.o advent *.html database.[ch] compile *.gcno *.gcda + rm -f README advent.6 + cd tests; $(MAKE) --quiet clean + +check: advent + cd tests; $(MAKE) --quiet + +.SUFFIXES: .adoc .html .6 # Requires asciidoc and xsltproc/docbook stylesheets. -.asc.6: +.adoc.6: a2x --doctype manpage --format manpage $< -.asc.html: - a2x --doctype manpage --format xhtml -D . $< - rm -f docbook-xsl.css +.adoc.html: + asciidoc $< +.adoc: + asciidoc $< -advent-$(VERS).tar.gz: $(SOURCES) advent.6 - tar --transform='s:^:advent-$(VERS)/:' --show-transformed-names -cvzf advent-$(VERS).tar.gz $(SOURCES) advent.6 +# README.adoc exists because that filename is magic on GitLab. +DOCS=COPYING NEWS README.adoc TODO \ + advent.adoc history.adoc index.adoc hints.adoc advent.6 -dist: advent-$(VERS).tar.gz +advent-$(VERS).tar.gz: $(SOURCES) $(DOCS) + tar --transform='s:^:advent-$(VERS)/:' --show-transformed-names -cvzf advent-$(VERS).tar.gz $(SOURCES) $(DOCS) -release: advent-$(VERS).tar.gz advent.html - shipper version=$(VERS) | sh -e -x +dist: advent-$(VERS).tar.gz -refresh: advent.html - shipper -N -w version=$(VERS) | sh -e -x +debug: CCFLAGS += -O0 --coverage +debug: advent