]> git.cameronkatri.com Git - bsdgames-darwin.git/blob - Makefile
Fix merge conflicts
[bsdgames-darwin.git] / Makefile
1 # $NetBSD: Makefile,v 1.31 2021/01/02 03:21:39 nat Exp $
2 # @(#)Makefile 8.3 (Berkeley) 7/24/94
3
4 SUBDIR= adventure arithmetic atc \
5 backgammon banner battlestar bcd boggle \
6 caesar canfield cgram ching colorbars countmail cribbage \
7 dm factor fish gomoku \
8 hack hals_end hangman hunt larn mille monop morse number \
9 phantasia pig pom ppt primes quiz \
10 rain random robots rogue sail snake testpat tetris trek \
11 wargames warp worm worms wtf wump
12 TOPTARGETS= all clean install
13
14 PREFIX ?= /usr
15 LOCALSTATEDIR ?= /var
16 SYSCONFDIR ?= /etc
17 ROOT := $(shell pwd)
18
19 export ROOT PREFIX LOCALSTATEDIR SYSCONFDIR
20
21 $(TOPTARGETS): $(SUBDIR)
22
23 $(SUBDIR): config.h
24 +$(MAKE) -C $@ $(MAKECMDGOALS)
25
26 config.h:
27 @echo "#define PREFIX \"$(PREFIX)\"" > config.h
28 @echo "#define LOCALSTATEDIR \"$(LOCALSTATEDIR)\"" >> config.h
29 @echo "#define SYSCONFDIR \"$(SYSCONFDIR)\"" >> config.h
30
31 update:
32 TEMP=$$(mktemp -d); \
33 cd ~/Documents/NetBSD; \
34 git format-patch -o $$TEMP $(shell cat upstream-commit) games; \
35 git rev-list HEAD -1 games/ > $(ROOT)/upstream-commit; \
36 cd $(ROOT); \
37 for patch in $$TEMP/*.patch; do \
38 if [ "$$(filterdiff -x '*/Makefile' --strip=1 $$patch --clean)" = "" ]; then \
39 echo "Skipping $$(basename $$patch) because it's empty"; \
40 else \
41 filterdiff -x '*/Makefile' --strip=1 $$patch | git am; \
42 fi; \
43 done
44
45 clean:
46 rm -f config.h
47
48 .PHONY: $(TOPTARGETS) $(SUBDIR) update