]> git.cameronkatri.com Git - bsdgames-darwin.git/blob - Makefile
avoid leaving off the trailing nul in a literal string.
[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 clean:
32 rm -f config.h
33
34 .PHONY: $(TOPTARGETS) $(SUBDIR)