]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - phantasia/Makefile
KNF and WARNS=3 fixes
[bsdgames-darwin.git] / phantasia / Makefile
index 35afaa32b3ea65859a2bf7266318fed0b47e9634..1eb58c876edcec24f06de6b291afea8cc5903bf2 100644 (file)
@@ -1,7 +1,7 @@
-#      $NetBSD: Makefile,v 1.21 2000/06/20 16:07:04 matt Exp $
+#      $NetBSD: Makefile,v 1.33 2004/02/08 22:14:27 lukem Exp $
 #      @(#)Makefile    8.1 (Berkeley) 5/31/93
 
-.include <bsd.own.mk>          # for UNPRIVILEGED
+.include <bsd.own.mk>
 
 PROG=  phantasia
 SRCS=  fight.c gamesupport.c interplayer.c io.c main.c misc.c phantglobs.c
@@ -12,24 +12,37 @@ HIDEGAME=hidegame
 SETGIDGAME=yes
 USETBL=
 MAN=   phantasia.6
-CLEANFILES+=map setup setup.lo host_phantglobs.lo
 
-realall: setup phantasia
+FILESDIR=/var/games/phantasia
+FILESOWN=games
+FILESGRP=games
+FILESMODE=0660
+ALLFILES=gold lastdead mess monsters void motd characs scoreboard
+FILES=gold lastdead mess monsters void motd
+# don't overwrite existing characters or scorefile
+.for file in characs scoreboard
+.if !exists(${DESTDIR}${FILESDIR}/${file})
+FILES+=${file}
+.endif
+.endfor
 
-setup: host_phantglobs.lo setup.lo monsters.asc ${LIBM} 
-       ${HOST_LINK.c} host_phantglobs.lo setup.lo -o ${.TARGET} -lm
+CLEANFILES+=map setup setup.lo host_phantglobs.lo ${ALLFILES} files.stamp
 
-host_phantglobs.lo: ${.CURDIR}/phantglobs.c
-       ${HOST_COMPILE.c} -o host_phantglobs.lo ${.CURDIR}/phantglobs.c
+realall: ${FILES}
 
-setup.lo: ${.CURDIR}/setup.c
-       ${HOST_COMPILE.c} -o setup.lo ${.CURDIR}/setup.c
+${FILES}: files.stamp
+files.stamp: setup monsters.asc
+       ${_MKMSG_CREATE} ${FILES}
+       rm -f ${.TARGET}
+       ./setup -m ${.CURDIR}/monsters.asc
+       touch ${.TARGET}
 
-afterinstall:
-       DESTDIR=${DESTDIR} ./setup -m ${.CURDIR}/monsters.asc
-.if !defined(UNPRIVILEGED)
-       chown games:games ${DESTDIR}/var/games/phantasia/*
-.endif
+setup: host_phantglobs.lo setup.lo ${LIBM} 
+       ${_MKTARGET_LINK}
+       ${HOST_LINK.c} -o ${.TARGET} ${.ALLSRC:M*.lo} -lm
+
+BUILDSYMLINKS+=        phantglobs.c host_phantglobs.c
+HOST_CPPFLAGS+=        -I${.CURDIR}
 
 # Make Phantasia map.  Change the map commands reflect your installation.
 # PLOTDEVICE is used for plotting the map.  Change as appropriate.