Move the if for GCC 4 to an elseif so it does not interfere with MacOS
[open-adventure.git] / Makefile
1 # Makefile for the open-source release of adventure 2.5
2
3 LIBS=-lrt
4 UNAME_S := $(shell uname -s)
5 GCCVERSIONGTEQ4 := $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 4)
6 ifeq ($(UNAME_S),Darwin)
7         LIBS=
8 else ifeq "$(GCCVERSIONGTEQ4)" "1"
9         CC=c99 --std=gnu99
10 endif
11
12 OBJS=main.o init.o actions1.o actions2.o score.o misc.o database.o
13 SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO advent.text control
14
15 .c.o:
16         $(CC) -O $(DBX) -c $<
17
18 advent: $(OBJS)
19         $(CC) -Wall -std=c99 -O $(DBX) -o advent $(OBJS) $(LIBS)
20
21 main.o:         main.h misc.h funcs.h database.h
22
23 init.o:         misc.h main.h share.h funcs.h database.h
24
25 actions1.o:     misc.h main.h share.h funcs.h database.h
26
27 actions2.o:     misc.h main.h share.h funcs.h
28
29 score.o:        misc.h main.h share.h database.h
30
31 misc.o:         misc.h main.h database.h
32
33 database.c database.h: compile
34         ./compile
35         $(CC) $(OPTIONS) -O $(DBX) -c database.c
36
37 clean:
38         rm -f *.o advent advent.html advent.6 database.[ch] compile
39         cd tests; $(MAKE) --quiet clean
40
41 check: advent
42         cd tests; $(MAKE) --quiet
43
44 # Requires asciidoc and xsltproc/docbook stylesheets.
45 .asc.6:
46         a2x --doctype manpage --format manpage $<
47 .asc.html:
48         a2x --doctype manpage --format xhtml -D . $<
49         rm -f docbook-xsl.css
50
51 advent-$(VERS).tar.gz: $(SOURCES) advent.6
52         tar --transform='s:^:advent-$(VERS)/:' --show-transformed-names -cvzf advent-$(VERS).tar.gz $(SOURCES) advent.6
53
54 dist: advent-$(VERS).tar.gz
55
56 release: advent-$(VERS).tar.gz advent.html
57         shipper version=$(VERS) | sh -e -x
58
59 refresh: advent.html
60         shipper -N -w version=$(VERS) | sh -e -x