[9] | 1 | # Makefile for advent
|
---|
| 2 |
|
---|
| 3 | # Where to put the adventure text files, and the binary executable.
|
---|
| 4 | # Need the trailing "/"s.
|
---|
| 5 | TEXTDIR = /usr/lib/advent/
|
---|
| 6 | BINDIR = /usr/bin
|
---|
| 7 |
|
---|
| 8 | # Flags you may want to add to CFLAGS:
|
---|
| 9 | # -DHAS_STDC=0 or 1 We have Standard C. Default=1 iff __STDC__ is nonzero.
|
---|
| 10 |
|
---|
| 11 | CC = exec cc
|
---|
| 12 | CFLAGS = -D_POSIX_SOURCE
|
---|
| 13 | LDFLAGS = -i
|
---|
| 14 |
|
---|
| 15 | OBJS = advent.o database.o english.o initial.o itverb.o score.o\
|
---|
| 16 | travel.o turn.o utility.o verb.o vocab.o
|
---|
| 17 |
|
---|
| 18 | DAT = advent1.dat advent2.dat advent3.dat advent4.dat
|
---|
| 19 | INSTDAT = $(TEXTDIR)advent1.dat $(TEXTDIR)advent2.dat \
|
---|
| 20 | $(TEXTDIR)advent3.dat $(TEXTDIR)advent4.dat
|
---|
| 21 |
|
---|
| 22 | all: $(DAT) advent
|
---|
| 23 |
|
---|
| 24 | install: $(TEXTDIR) $(INSTDAT) $(BINDIR)/advent
|
---|
| 25 |
|
---|
| 26 | $(TEXTDIR):
|
---|
| 27 | install -d -o bin $(TEXTDIR)
|
---|
| 28 |
|
---|
| 29 | $(TEXTDIR)advent1.dat: advent1.dat
|
---|
| 30 | install -c -o bin $? $@
|
---|
| 31 |
|
---|
| 32 | $(TEXTDIR)advent2.dat: advent2.dat
|
---|
| 33 | install -c -o bin $? $@
|
---|
| 34 |
|
---|
| 35 | $(TEXTDIR)advent3.dat: advent3.dat
|
---|
| 36 | install -c -o bin $? $@
|
---|
| 37 |
|
---|
| 38 | $(TEXTDIR)advent4.dat: advent4.dat
|
---|
| 39 | install -c -o bin $? $@
|
---|
| 40 |
|
---|
| 41 | $(BINDIR)/advent: advent
|
---|
| 42 | install -cs -o bin $? $@
|
---|
| 43 |
|
---|
| 44 | advent: $(OBJS)
|
---|
| 45 | $(CC) $(LDFLAGS) -o advent $(OBJS)
|
---|
| 46 |
|
---|
| 47 | setup: setup.c advent.h
|
---|
| 48 | $(CC) $(CFLAGS) $(LDFLAGS) -o setup setup.c
|
---|
| 49 |
|
---|
| 50 | advtext.h advent1.dat advent2.dat advent3.dat advent4.dat: \
|
---|
| 51 | setup advent1.txt advent2.txt advent3.txt advent4.txt
|
---|
| 52 | ./setup
|
---|
| 53 |
|
---|
| 54 | advent.o: advent.h advdec.h advent.c
|
---|
| 55 | $(CC) -c $(CFLAGS) -DTEXTDIR='"$(TEXTDIR)"' advent.c
|
---|
| 56 |
|
---|
| 57 | database.o: advent.h advdec.h advtext.h
|
---|
| 58 | travel.o: advent.h advdec.h advcave.h
|
---|
| 59 | initial.o english.o itverb.o score.o turn.o utility.o\
|
---|
| 60 | verb.o vocab.o: advent.h advdec.h
|
---|
| 61 |
|
---|
| 62 | clean:
|
---|
| 63 | @rm -f *.o *.BAK *.dat advtext.h core advent setup
|
---|