X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/6e65822ba7aed8ade399abc0aeef3a41843ef361..08eca96e71d96ad1f8e9b888875ab5570f208d19:/phantasia/Makefile diff --git a/phantasia/Makefile b/phantasia/Makefile index 6f4bb07e..3792164c 100644 --- a/phantasia/Makefile +++ b/phantasia/Makefile @@ -1,38 +1,48 @@ -# $NetBSD: Makefile,v 1.6 1997/04/19 07:29:31 thorpej Exp $ +# $NetBSD: Makefile,v 1.37 2014/06/14 20:49:37 mrg Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 PROG= phantasia -SRCS= main.c fight.c io.c interplayer.c gamesupport.c misc.c phantglobs.c -DPADD= ${LIBM} ${LIBCURSES} ${LIBTERM} ${LIBCOMPAT} -LDADD= -lm -lcurses -ltermlib -lcompat -HIDEGAME=hidegame +SRCS= fight.c gamesupport.c interplayer.c io.c main.c misc.c phantglobs.c MAN= phantasia.6 -CLEANFILES+=map setup setup.o host_phantglobs.o -all: setup phantasia +FILESDIR=/var/games/phantasia +FILESMODE=0660 +ALLFILES=gold lastdead mess monsters void motd characs scoreboard +FILES=gold lastdead mess monsters void motd -setup: host_phantglobs.o setup.o monsters.asc ${LIBM} - ${HOST_CC} host_phantglobs.o setup.o -o ${.TARGET} -lm +CLEANFILES+=map mkdata $(ALLFILES) files.stamp -host_phantglobs.o: ${.CURDIR}/phantglobs.c - ${HOST_COMPILE.c} -o host_phantglobs.o ${.CURDIR}/phantglobs.c +all: $(PROG) $(FILES) -setup.o: ${.CURDIR}/setup.c - ${HOST_COMPILE.c} ${.CURDIR}/setup.c +$(FILES): files.stamp +files.stamp: mkdata monsters.asc + rm -f files.stamp + ./mkdata -m monsters.asc + touch files.stamp -beforeinstall: - ./setup -m ${.CURDIR}/monsters.asc - chown games:bin ${DESTDIR}/var/games/phantasia/* +mkdata: phantglobs.c setup.c + clang -o mkdata phantglobs.c setup.c # Make Phantasia map. Change the map commands reflect your installation. # PLOTDEVICE is used for plotting the map. Change as appropriate. map: map.c - ${CC} -O ${.CURDIR}/map.c -lplot -o ${.TARGET} + clang -o map map.c -lplot ./map | plot > /dev/tty -# XXX this rule shouldn't be here. -phantasia.cat6: phantasia.6 - tbl ${.CURDIR}/phantasia.6 | nroff -man > ${.TARGET} +$(PROG): $(SRCS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(STRIP) $(PROG) -.include +$(ALLFILES): $(FILES) + +install: $(PROG) $(MAN) $(ALLFILES) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)$(FILESDIR) + $(GINSTALL) -Dm$(FILESMODE) $(ALLFILES) $(DESTDIR)$(FILESDIR) + +clean: + rm -f $(CLEANFILES) $(PROG) + +.PHONY: all clean install