summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: b3c9d43e93ccded2387fe1a9bd90c556f65a7695 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#	$NetBSD: Makefile,v 1.31 2021/01/02 03:21:39 nat Exp $
#	@(#)Makefile	8.3 (Berkeley) 7/24/94

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

PREFIX        ?= /usr
LOCALSTATEDIR ?= /var
SYSCONFDIR    ?= /etc
ROOT          := $(shell pwd)

export ROOT PREFIX LOCALSTATEDIR SYSCONFDIR

$(TOPTARGETS): $(SUBDIR)

$(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

clean:
	rm -f config.h

.PHONY: $(TOPTARGETS) $(SUBDIR)