aboutsummaryrefslogtreecommitdiff
path: root/games/nbsdgames/files/patch-Makefile
blob: 00cd15fc084be52f8877244f5559fd1669bf039e (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
35
--- Makefile.orig	2021-05-05 17:39:38 UTC
+++ Makefile
@@ -6,7 +6,7 @@
 GAMES_DIR?=/usr/games
 SCORES_DIR?=/var/games
 MAN_DIR?=/usr/share/man/man6
-CFLAGS+=  -Wno-unused-result -D SCORES_DIR=\"$(SCORES_DIR)\"
+CFLAGS+= ${CPPFLAGS} -Wno-unused-result -D SCORES_DIR=\"$(SCORES_DIR)\"
 LDFLAGS+= -lncurses -lm
 
 
@@ -16,11 +16,11 @@ SCORE_FILES= pipes_scores jewels_scores miketron_score
 all: $(ALL)
 
 scorefiles:
-	for sf in $(SCORE_FILES); do touch $(SCORES_DIR)/$$sf ; chmod 664 $(SCORES_DIR)/$$sf; chown :games $(SCORES_DIR)/$$sf ; done;
-	for game in $(ALL); do chown :games $(GAMES_DIR)/$$game; chmod g+s $(GAMES_DIR)/$$game ; done;
+	mkdir -p ${DESTDIR}${SCORES_DIR}
+	for sf in $(SCORE_FILES); do touch ${DESTDIR}$(SCORES_DIR)/$$sf.sample; done;
 
 manpages:
-	cp man/* $(MAN_DIR)
+	cp man/* ${DESTDIR}$(MAN_DIR)
 jewels: jewels.c config.h common.h
 	$(CC) jewels.c $(LDFLAGS) $(CFLAGS) -o ./jewels
 sudoku: sudoku.c config.h 
@@ -60,6 +60,6 @@ clean:
 	rm $(ALL)
 uninstall:
 	for game in $(ALL); do rm $(GAMES_DIR)/$$game; rm $(MAN_DIR)/$$game.6.gz done;
-install: $(ALL)
-	cp $(ALL) $(GAMES_DIR)
+install: $(ALL) manpages scorefiles
+	cp $(ALL) ${DESTDIR}$(GAMES_DIR)