1
0
mirror of https://github.com/abakh/nbsdgames.git synced 2024-12-04 14:46:22 -05:00
nbsdgames/Makefile

86 lines
3.2 KiB
Makefile
Raw Normal View History

2019-03-20 10:16:33 -04:00
# -*- Makefile -*-
2021-04-23 16:55:17 -04:00
2021-04-20 10:09:41 -04:00
#-O3 --std=c99 -lcurses -DNO_MOUSE for NetBSD curses
#adding --std=c99 makes warnings in GNU, and the blame is upon glibc feature test macros. my code is correct.
2021-04-23 16:18:40 -04:00
GAMES_DIR?=/usr/games
2021-04-24 04:46:11 -04:00
SCORES_DIR?=/var/games
2021-05-03 18:03:52 -04:00
MAN_DIR?=/usr/share/man/man6
2021-05-03 19:13:54 -04:00
CFLAGS+= -Wno-unused-result -D SCORES_DIR=\"$(SCORES_DIR)\"
PKG-CONFIG?=pkg-config
LIBS=$(shell pkg-config --libs --cflags ncurses) -lm
2021-04-29 19:05:16 -04:00
2022-02-01 17:25:05 -05:00
ALL= nbsdgames jewels sudoku mines reversi checkers battleship rabbithole sos pipes fifteen memoblocks fisher muncher miketron redsquare darrt snakeduel tugow
2022-01-24 22:31:23 -05:00
SCORE_FILES= pipes_scores jewels_scores miketron_scores muncher_scores fisher_scores darrt_scores tugow_scores
2021-04-29 19:05:16 -04:00
all: $(ALL)
2021-04-29 19:05:16 -04:00
2020-06-20 12:26:54 -04:00
scorefiles:
2021-05-03 19:13:54 -04:00
for sf in $(SCORE_FILES); do touch $(SCORES_DIR)/$$sf ; chmod 664 $(SCORES_DIR)/$$sf; chown :games $(SCORES_DIR)/$$sf ; done;
2022-01-24 22:31:23 -05:00
for game in $(ALL); do chown :games $(GAMES_DIR)/$$game; chmod g $(GAMES_DIR)/$$game ; done;
2021-04-29 19:05:16 -04:00
2021-05-03 18:03:52 -04:00
manpages:
cp man/* $(MAN_DIR)
2021-04-24 04:46:11 -04:00
jewels: jewels.c config.h common.h
$(CC) $(CFLAGS) jewels.c $(LDFLAGS) $(LIBS) -o ./jewels
sudoku: sudoku.c config.h
$(CC) $(CFLAGS) sudoku.c $(LDFLAGS) $(LIBS) -o ./sudoku
2021-03-05 08:00:08 -05:00
mines: mines.c config.h
$(CC) $(CFLAGS) mines.c $(LDFLAGS) $(LIBS) -o ./mines
2021-03-05 08:00:08 -05:00
reversi: reversi.c config.h
$(CC) $(CFLAGS) reversi.c $(LDFLAGS) $(LIBS) -o ./reversi
2021-03-05 08:00:08 -05:00
checkers: checkers.c config.h
$(CC) $(CFLAGS) checkers.c $(LDFLAGS) $(LIBS) -o ./checkers
2021-03-05 08:00:08 -05:00
battleship: battleship.c config.h
$(CC) $(CFLAGS) battleship.c $(LDFLAGS) $(LIBS) -o ./battleship
2021-03-05 08:00:08 -05:00
rabbithole: rabbithole.c config.h
$(CC) $(CFLAGS) rabbithole.c $(LDFLAGS) $(LIBS) -o ./rabbithole
2021-03-05 08:00:08 -05:00
sos: sos.c config.h
$(CC) $(CFLAGS) sos.c $(LDFLAGS) $(LIBS) -o ./sos
2021-04-29 19:05:16 -04:00
pipes: pipes.c config.h common.h
$(CC) $(CFLAGS) pipes.c $(LDFLAGS) $(LIBS) -o ./pipes
2021-03-05 08:00:08 -05:00
fifteen: fifteen.c config.h
$(CC) $(CFLAGS) fifteen.c $(LDFLAGS) $(LIBS) -o ./fifteen
2019-05-13 09:58:19 -04:00
memoblocks: memoblocks.c
$(CC) $(CFLAGS) memoblocks.c $(LDFLAGS) $(LIBS) -o ./memoblocks
2021-04-24 04:46:11 -04:00
fisher: fisher.c config.h common.h
$(CC) $(CFLAGS) fisher.c $(LDFLAGS) $(LIBS) -o ./fisher
2021-04-24 04:46:11 -04:00
muncher: muncher.c config.h common.h
$(CC) $(CFLAGS) muncher.c $(LDFLAGS) $(LIBS) -o ./muncher
2021-04-24 04:46:11 -04:00
miketron: miketron.c config.h common.h
$(CC) $(CFLAGS) miketron.c $(LDFLAGS) $(LIBS) -o ./miketron
2021-03-05 08:00:08 -05:00
redsquare: redsquare.c config.h
$(CC) $(CFLAGS) redsquare.c $(LDFLAGS) $(LIBS) -o ./redsquare
2021-04-24 04:46:11 -04:00
darrt: darrt.c config.h common.h
$(CC) $(CFLAGS) darrt.c $(LDFLAGS) $(LIBS) -o ./darrt
2022-02-01 17:25:05 -05:00
nbsdgames: nbsdgames.c
$(CC) $(CFLAGS) nbsdgames.c $(LDFLAGS) $(LIBS) -o ./nbsdgames
2021-04-16 17:16:54 -04:00
snakeduel: snakeduel.c config.h
$(CC) $(CFLAGS) snakeduel.c $(LDFLAGS) $(LIBS) -o ./snakeduel
2022-01-24 22:31:23 -05:00
tugow: tugow.c common.h
$(CC) $(CFLAGS) tugow.c $(LDFLAGS) $(LIBS) -o ./tugow
2022-02-01 17:25:05 -05:00
menu:
cp nbsdgames.desktop /usr/share/applications
cp nbsdgames.svg /usr/share/pixmaps
2019-03-20 10:16:33 -04:00
clean:
for game in $(ALL); do rm $$game; done;
2019-03-20 10:16:33 -04:00
uninstall:
2021-08-20 08:40:45 -04:00
for game in $(ALL); do rm $(GAMES_DIR)/$$game; rm $(MAN_DIR)/$$game.6.gz ;done;
2021-04-29 19:05:16 -04:00
install: $(ALL)
2022-02-01 17:25:05 -05:00
cp $(ALL) $(GAMES_DIR)
2021-08-20 08:40:45 -04:00
test:
for game in $(ALL); do ./$$game ;done;
#######for namespacing #######
2022-02-01 17:25:05 -05:00
nb:
CFLAGS="$$CFLAGS -D NB=\\\"nb\\\"" make
for game in $(ALL); do cp $$game nb$$game ;done;
for manpage in $(ls man); do cp man/$$manpage man/nb$$manpage ;done;
nbinstall: nb
cp nb* $(GAMES_DIR)
nbmanpages: nb
cp man/nb* $(MAN_DIR)
nbclean:
2022-02-01 17:25:05 -05:00
for game in $(ALL); do rm nb$$game; done;