X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/2cdbb694c5a0c2ce19ea837343a558e17c413f58..08eca96e71d96ad1f8e9b888875ab5570f208d19:/phantasia/Makefile diff --git a/phantasia/Makefile b/phantasia/Makefile index d37f5cdb..3792164c 100644 --- a/phantasia/Makefile +++ b/phantasia/Makefile @@ -1,35 +1,48 @@ -# $NetBSD: Makefile,v 1.10 1997/06/30 19:33:34 phil 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 -USETBL= +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 -afterinstall: - ./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 -.include +$(PROG): $(SRCS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(STRIP) $(PROG) + +$(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