-# $NetBSD: Makefile,v 1.2 2020/11/10 08:49:08 kamil Exp $
-
-.include <bsd.own.mk>
+# $NetBSD: Makefile,v 1.5 2020/11/11 20:04:02 christos Exp $
PROG= warp
-
SRCS= bang.c init.c intrp.c move.c object.c play.c score.c sig.c term.c \
them.c us.c util.c version.c warp.c weapon.c
-DPADD= ${LIBTERMLIB} ${LIBM} ${LIBCOMPAT}
-LDADD= -ltermlib -lm -lcompat
-
CPPFLAGS+=-DHAVETERMLIB
-CLEANFILES+=sm sm.lo smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7
+CLEANFILES+=sm smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7
CLEANFILES+=warp.6
-HIDEGAME=hidegame
-SETGIDGAME=yes
MAN= warp.6
-warp.6:
- ${_MKTARGET_CREATE}
- cat ${.CURDIR}/warp.man > ${.TARGET}
+FILES=smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7
+FILESDIR=$(PREFIX)/share/games/warp
+
+all: $(PROG) $(MAN) $(FILES)
-DPSRCS+=smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7
+$(PROG): $(SRCS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT)
+ $(STRIP) $(PROG)
+
+install: $(PROG) $(MAN) $(FILES)
+ $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG)
+ $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN)
+ $(GINSTALL) -d $(DESTDIR)$(FILESDIR)
+ $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)$(FILESDIR)
+
+clean:
+ rm -f $(CLEANFILES) $(PROG)
+
+warp.6:
+ cat warp.man > $@
smap.0: smp.0 sm
- ${_MKTARGET_CREATE}
- ./sm < ${.CURDIR}/smp.0 > ${.TARGET}
+ ./sm < smp.0 > $@
smap.1: smp.1 sm
- ${_MKTARGET_CREATE}
- ./sm < ${.CURDIR}/smp.1 > ${.TARGET}
+ ./sm < smp.1 > $@
smap.2: smp.2 sm
- ${_MKTARGET_CREATE}
- ./sm < ${.CURDIR}/smp.2 > ${.TARGET}
+ ./sm < smp.2 > $@
smap.3: smp.3 sm
- ${_MKTARGET_CREATE}
- ./sm < ${.CURDIR}/smp.3 > ${.TARGET}
+ ./sm < smp.3 > $@
smap.4: smp.4 sm
- ${_MKTARGET_CREATE}
- ./sm < ${.CURDIR}/smp.4 > ${.TARGET}
+ ./sm < smp.4 > $@
smap.5: smp.5 sm
- ${_MKTARGET_CREATE}
- ./sm < ${.CURDIR}/smp.5 > ${.TARGET}
+ ./sm < smp.5 > $@
smap.6: smp.6 sm
- ${_MKTARGET_CREATE}
- ./sm < ${.CURDIR}/smp.6 > ${.TARGET}
+ ./sm < smp.6 > $@
smap.7: smp.7 sm
- ${_MKTARGET_CREATE}
- ./sm < ${.CURDIR}/smp.7 > ${.TARGET}
+ ./sm < smp.7 > $@
-sm: sm.lo
- ${_MKTARGET_LINK}
- ${HOST_LINK.c} -o ${.TARGET} ${.ALLSRC}
+sm: sm.c
+ clang -o $@ sm.c -I$(ROOT)
-.if ${MKSHARE} != "no"
-FILES=smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7
-FILES+=warp.doc warp.news README
-FILESDIR=/usr/share/games/warp
-.endif
-
-CFLAGS+= -Wno-error=old-style-definition -Wno-error=strict-prototypes
-CFLAGS+= -Wno-error=comment -Wno-error=maybe-uninitialized
-CFLAGS+= -Wno-error=discarded-qualifiers -Wno-error=dangling-else
-CFLAGS+= -Wno-error=char-subscripts -Wno-error=parentheses
-CFLAGS+= -Wno-error=unused-value -Wno-error=format-extra-args
-CFLAGS+= -Wno-error=format-overflow= -Wno-error=builtin-declaration-mismatch
-CFLAGS+= -Wno-error=format= -Wno-error=sign-compare -Wno-error=return-type
-CFLAGS+= -Wno-error=unused-label -Wno-error=unused-variable
-CFLAGS+= -Wno-error=format-nonliteral -Wno-error=implicit-fallthrough=
-
-.include <bsd.prog.mk>
+.PHONY: all clean install