| 1 | # @(#)Makefile 1.3 %G% |
| 2 | |
| 3 | CFLAGS= -O |
| 4 | OBJS= battlestar.o com1.o com2.o com3.o com4.o com5.o com6.o com7.o \ |
| 5 | init.o cypher.o getcom.o parse.o room.o save.o fly.o misc.o \ |
| 6 | globals.o \ |
| 7 | wlist.o dayfile.o nightfile.o dayobjs.o nightobjs.o |
| 8 | CFILES= battlestar.c com1.c com2.c com3.c com4.c com5.c com6.c com7.c \ |
| 9 | init.c cypher.c getcom.c parse.c room.c save.c fly.c misc.c \ |
| 10 | globals.c |
| 11 | LIBS= -lcurses -ltermlib |
| 12 | LINTFLAGS= -h |
| 13 | JUNKFILES= battlestar tags mkfile mkwlist mkobjs \ |
| 14 | wlist.c dayfile.c nightfile.c dayobjs.c nightobjs.c |
| 15 | DATAFILES= dayfile nightfile battlewords dayobjs nightobjs |
| 16 | DIR= $(DESTDIR)/usr/games |
| 17 | LOGFILE= $(DIR)/lib/battlestar.log |
| 18 | MAN= $(DESTDIR)/usr/man/man6/battlestar.6 |
| 19 | |
| 20 | battlestar: ${OBJS} |
| 21 | cc ${OBJS} ${LIBS} -o battlestar |
| 22 | |
| 23 | mkfile: mkfile.c |
| 24 | $(CC) $(CFLAGS) -o mkfile mkfile.c |
| 25 | |
| 26 | dayfile.o: dayfile mkfile |
| 27 | mkfile dayfile |
| 28 | $(CC) $(CFLAGS) -c dayfile.c |
| 29 | rm dayfile.c |
| 30 | |
| 31 | nightfile.o: nightfile mkfile |
| 32 | mkfile nightfile |
| 33 | $(CC) $(CFLAGS) -c nightfile.c |
| 34 | rm nightfile.c |
| 35 | |
| 36 | mkwlist: mkwlist.c |
| 37 | $(CC) $(CFLAGS) -o mkwlist mkwlist.c |
| 38 | |
| 39 | wlist.c: battlewords mkwlist |
| 40 | mkwlist battlewords |
| 41 | |
| 42 | mkobjs: mkobjs.c |
| 43 | $(CC) $(CFLAGS) -o mkobjs mkobjs.c |
| 44 | |
| 45 | dayobjs.c: dayobjs mkobjs |
| 46 | mkobjs dayobjs |
| 47 | |
| 48 | nightobjs.c: nightobjs mkobjs |
| 49 | mkobjs nightobjs |
| 50 | |
| 51 | lint: ${CFILES} |
| 52 | lint ${LINTFLAGS} ${CFILES} ${LIBS} |
| 53 | |
| 54 | install: battlestar $(MAN) $(LOGFILE) |
| 55 | install -s -c battlestar $(DIR)/battlestar |
| 56 | |
| 57 | logfile $(LOGFILE): |
| 58 | cp /dev/null $(LOGFILE) |
| 59 | chmod 666 $(LOGFILE) |
| 60 | |
| 61 | man $(MAN): |
| 62 | install -c battlestar.6 $(MAN) |
| 63 | |
| 64 | clean: |
| 65 | rm -f ${OBJS} ${JUNKFILES} |