note other reasons for pclose to return -1; wait(2) -> wait4(2)
[unix-history] / usr / src / games / battlestar / Makefile
index 471fdc2..61c9054 100644 (file)
@@ -1,61 +1,54 @@
-# @(#)Makefile 1.1 %G%
+#
+# Copyright (c) 1987 Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms are permitted
+# provided that the above copyright notice and this paragraph are
+# duplicated in all such forms and that any documentation,
+# advertising materials, and other materials related to such
+# distribution and use acknowledge that the software was developed
+# by the University of California, Berkeley.  The name of the
+# University may not be used to endorse or promote products derived
+# from this software without specific prior written permission.
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#      @(#)Makefile    5.3 (Berkeley) %G%
+#
+CFLAGS=        -O
+LIBC=  /lib/libc.a
+LIBS=  -lcurses -ltermlib
+OBJS=  battlestar.o com1.o com2.o com3.o com4.o com5.o com6.o com7.o \
+       init.o cypher.o getcom.o parse.o room.o save.o fly.o misc.o \
+       globals.o dayfile.o nightfile.o dayobjs.o nightobjs.o words.o
+SRCS=  battlestar.c com1.c com2.c com3.c com4.c com5.c com6.c com7.c \
+       init.c cypher.c getcom.c parse.c room.c save.c fly.c misc.c \
+       globals.c dayfile.c nightfile.c dayobjs.c nightobjs.c words.c
+MAN=   battlestar.0
+
+all: battlestar
+
+battlestar: ${OBJS} ${LIBC}
+       ${CC} -o $@ ${CFLAGS} ${OBJS} ${LIBS}
 
 
-CFLAGS=                -O
-OBJS=          battlestar.o com1.o com2.o com3.o com4.o com5.o com6.o com7.o \
-               init.o cypher.o getcom.o parse.o room.o save.o fly.o misc.o \
-               globals.o \
-               wlist.o dayfile.o nightfile.o dayobjs.o nightobjs.o
-CFILES=                battlestar.c com1.c com2.c com3.c com4.c com5.c com6.c com7.c \
-               init.c cypher.c getcom.c parse.c room.c save.c fly.c misc.c \
-               globals.c
-LIBS=          -lcurses -ltermlib
-LINTFLAGS=     -h
-JUNKFILES=     battlestar tags mkfile mkwlist mkobjs \
-               wlist.c dayfile.c nightfile.c dayobjs.c nightobjs.c
-DATAFILES=     dayfile nightfile battlewords dayobjs nightobjs
-DIR=           $(DEST)/usr/games
-LOGFILE=       $(DIR)/lib/battlestar.log
-MAN=           $(DEST)/usr/man/man6/battlestar.6
-
-battlestar: ${OBJS}
-       cc ${OBJS} ${LIBS} -o battlestar
-
-mkfile: mkfile.c
-       $(CC) $(CFLAGS) -o mkfile mkfile.c
-
-dayfile.c: dayfile mkfile
-       mkfile dayfile
-
-nightfile.c: nightfile mkfile
-       mkfile nightfile
-
-mkwlist: mkwlist.c
-       $(CC) $(CFLAGS) -o mkwlist mkwlist.c
-
-wlist.c: battlewords mkwlist
-       mkwlist battlewords
-
-mkobjs: mkobjs.c
-       $(CC) $(CFLAGS) -o mkobjs mkobjs.c
-
-dayobjs.c: dayobjs mkobjs
-       mkobjs dayobjs
-
-nightobjs.c: nightobjs mkobjs
-       mkobjs nightobjs
+clean:
+       rm -f ${OBJS} core battlestar
 
 
-lint: ${CFILES} 
-       lint ${LINTFLAGS} ${CFILES} ${LIBS} 
+cleandir: clean
+       rm -f ${MAN} tags .depend
 
 
-install: battlestar $(MAN) $(LOGFILE)
-       install -s -c battlestar $(DIR)/battlestar
+depend: ${SRCS}
+       mkdep ${CFLAGS} ${SRCS}
 
 
-logfile $(LOGFILE):
-       cp /dev/null $(LOGFILE)
-       chmod 666 $(LOGFILE)
+install: ${MAN}
+       install -s -o games -g bin -m 4700 battlestar ${DESTDIR}/usr/games/hide/battlestar
+       install -c -o games -g bin -m 600 /dev/null ${DESTDIR}/usr/games/lib/battlestar.log
+       (cd ${DESTDIR}/usr/games; rm -f battlestar; ln -s dm battlestar; chown games.bin battlestar)
+       install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat6
 
 
-man $(MAN):
-       install -c battlestar.6 $(MAN)
+lint: ${SRCS}
+       lint ${CFLAGS} ${SRCS}
 
 
-clean:
-       rm -f ${OBJS} ${JUNKFILES}
+tags: ${SRCS}
+       ctags ${SRCS}