X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/bfdba68dccf7d15097336930dd36bbcf1d5ecd03..1c75ca2e2dc72d118edbb854455e602d70d80a52:/Makefile diff --git a/Makefile b/Makefile index 9f761dbe..fbb0be58 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,48 @@ -# $NetBSD: Makefile,v 1.19 2002/06/16 10:21:40 martin Exp $ +# $NetBSD: Makefile,v 1.31 2021/01/02 03:21:39 nat Exp $ # @(#)Makefile 8.3 (Berkeley) 7/24/94 -# Missing: ching dungeon warp -# Moved: chess -# Don't belong: xneko xroach +SUBDIR= adventure arithmetic atc \ + backgammon banner battlestar bcd boggle \ + caesar canfield cgram ching colorbars countmail cribbage \ + dm factor fish gomoku \ + hack hals_end hangman hunt larn mille monop morse number \ + phantasia pig pom ppt primes quiz \ + rain random robots rogue sail snake testpat tetris trek \ + wargames warp worm worms wtf wump +TOPTARGETS= all clean install -# For MKCRYPTO -.include +PREFIX ?= /usr +LOCALSTATEDIR ?= /var +SYSCONFDIR ?= /etc +ROOT := $(shell pwd) -SUBDIR= adventure arithmetic atc backgammon banner battlestar bcd boggle \ - caesar canfield countmail cribbage dm fish fortune gomoku hack \ - hangman hunt larn mille monop morse number phantasia pig pom ppt \ - primes quiz rain random robots rogue sail snake tetris trek wargames \ - worm worms wtf wump +export ROOT PREFIX LOCALSTATEDIR SYSCONFDIR -.if (${MKCRYPTO} != "no") -SUBDIR+= factor -.endif +$(TOPTARGETS): $(SUBDIR) -.include +$(SUBDIR): config.h + +$(MAKE) -C $@ $(MAKECMDGOALS) + +config.h: + @echo "#define PREFIX \"$(PREFIX)\"" > config.h + @echo "#define LOCALSTATEDIR \"$(LOCALSTATEDIR)\"" >> config.h + @echo "#define SYSCONFDIR \"$(SYSCONFDIR)\"" >> config.h + +update: + TEMP=$$(mktemp -d); \ + cd ~/Documents/BSD/NetBSD; \ + git format-patch -o $$TEMP $(shell cat upstream-commit) games; \ + git rev-list HEAD -1 games/ > $(ROOT)/upstream-commit; \ + cd $(ROOT); \ + for patch in $$TEMP/*.patch; do \ + if [ "$$(filterdiff -x '*/Makefile' --strip=1 $$patch --clean)" = "" ]; then \ + echo "Skipping $$(basename $$patch) because it's empty"; \ + else \ + filterdiff -x '*/Makefile' --strip=1 $$patch | git am; \ + fi; \ + done + +clean: + rm -f config.h + +.PHONY: $(TOPTARGETS) $(SUBDIR) update