2019-03-20 14:16:33 +00:00
|
|
|
# -*- Makefile -*-
|
2021-04-23 20:55:17 +00:00
|
|
|
|
2021-04-20 14:09:41 +00: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.
|
|
|
|
|
2022-03-31 03:16:37 +00:00
|
|
|
GAMESDIR?=$(PREFIX)/usr/games
|
|
|
|
SCORESDIR?=$(PREFIX)/var/games
|
|
|
|
MANDIR?=$(PREFIX)/usr/share/man/man6
|
|
|
|
CFLAGS=-Wno-unused-result -DSCORES_DIR=\"$(PREFIX)$(SCORESDIR)\"
|
2022-03-31 03:00:41 +00:00
|
|
|
LIBS=$(shell pkg-config --libs --cflags ncurses) -lm
|
2021-04-29 23:05:16 +00:00
|
|
|
|
|
|
|
|
2022-02-01 22:25:05 +00:00
|
|
|
ALL= nbsdgames jewels sudoku mines reversi checkers battleship rabbithole sos pipes fifteen memoblocks fisher muncher miketron redsquare darrt snakeduel tugow
|
2022-01-25 03:31:23 +00:00
|
|
|
SCORE_FILES= pipes_scores jewels_scores miketron_scores muncher_scores fisher_scores darrt_scores tugow_scores
|
2021-04-29 23:05:16 +00:00
|
|
|
|
2022-03-31 03:00:41 +00:00
|
|
|
all: $(ALL)
|
2021-04-29 23:05:16 +00:00
|
|
|
|
2020-06-20 16:26:54 +00:00
|
|
|
scorefiles:
|
2022-03-31 03:16:37 +00:00
|
|
|
for sf in $(SCORE_FILES); do touch $(DESTDIR)$(SCORESDIR)/$$sf ; chmod 664 $(DESTDIR)$(SCORESDIR)/$$sf; chown :games $(DESTDIR)$(SCORESDIR)/$$sf ; done;
|
|
|
|
for game in $(ALL); do chown :games $(DESTDIR)$(GAMESDIR)/$$game; chmod g $(DESTDIR)$(GAMESDIR)/$$game ; done;
|
2021-04-29 23:05:16 +00:00
|
|
|
|
2021-05-03 22:03:52 +00:00
|
|
|
manpages:
|
2022-03-31 03:16:37 +00:00
|
|
|
cp man/* $(DESTDIR)$(MANDIR)
|
2021-04-24 08:46:11 +00:00
|
|
|
jewels: jewels.c config.h common.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2022-03-31 03:00:41 +00:00
|
|
|
sudoku: sudoku.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-03-05 13:00:08 +00:00
|
|
|
mines: mines.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-03-05 13:00:08 +00:00
|
|
|
reversi: reversi.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-03-05 13:00:08 +00:00
|
|
|
checkers: checkers.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-03-05 13:00:08 +00:00
|
|
|
battleship: battleship.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-03-05 13:00:08 +00:00
|
|
|
rabbithole: rabbithole.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-03-05 13:00:08 +00:00
|
|
|
sos: sos.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-04-29 23:05:16 +00:00
|
|
|
pipes: pipes.c config.h common.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-03-05 13:00:08 +00:00
|
|
|
fifteen: fifteen.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2019-05-13 13:58:19 +00:00
|
|
|
memoblocks: memoblocks.c
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-04-24 08:46:11 +00:00
|
|
|
fisher: fisher.c config.h common.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-04-24 08:46:11 +00:00
|
|
|
muncher: muncher.c config.h common.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-04-24 08:46:11 +00:00
|
|
|
miketron: miketron.c config.h common.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-03-05 13:00:08 +00:00
|
|
|
redsquare: redsquare.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-04-24 08:46:11 +00:00
|
|
|
darrt: darrt.c config.h common.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2022-02-01 22:25:05 +00:00
|
|
|
nbsdgames: nbsdgames.c
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2021-04-16 21:16:54 +00:00
|
|
|
snakeduel: snakeduel.c config.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2022-01-25 03:31:23 +00:00
|
|
|
tugow: tugow.c common.h
|
2022-03-31 03:09:46 +00:00
|
|
|
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
|
2022-02-01 22:25:05 +00:00
|
|
|
menu:
|
2022-03-31 03:13:38 +00:00
|
|
|
cp nbsdgames.desktop $(DESTIDR)$(PREFIX)/usr/share/applications
|
|
|
|
cp nbsdgames.svg $(DESTDIR)$(PREFIX)/usr/share/pixmaps
|
2019-03-20 14:16:33 +00:00
|
|
|
clean:
|
2021-08-06 06:27:54 +00:00
|
|
|
for game in $(ALL); do rm $$game; done;
|
2019-03-20 14:16:33 +00:00
|
|
|
uninstall:
|
2022-03-31 03:16:37 +00:00
|
|
|
for game in $(ALL); do rm $(GAMESDIR)/$$game; rm $(MANDIR)/$$game.6.gz ;done;
|
2021-04-29 23:05:16 +00:00
|
|
|
install: $(ALL)
|
2022-03-31 03:16:37 +00:00
|
|
|
cp $(ALL) $(DESTDIR)/$(GAMESDIR)
|
2021-08-20 12:40:45 +00:00
|
|
|
test:
|
|
|
|
for game in $(ALL); do ./$$game ;done;
|
2021-08-06 06:27:54 +00:00
|
|
|
|
|
|
|
#######for namespacing #######
|
2022-02-01 22:25:05 +00:00
|
|
|
nb:
|
2022-03-31 03:14:34 +00:00
|
|
|
CFLAGS="$$CFLAGS -D NB=\\\"nb\\\"" $(MAKE)
|
2022-02-01 22:25:05 +00:00
|
|
|
for game in $(ALL); do cp $$game nb$$game ;done;
|
|
|
|
for manpage in $(ls man); do cp man/$$manpage man/nb$$manpage ;done;
|
2021-08-06 06:27:54 +00:00
|
|
|
nbinstall: nb
|
2022-03-31 03:16:37 +00:00
|
|
|
cp nb* $(DESTDIR)/$(GAMESDIR)
|
2021-08-06 06:27:54 +00:00
|
|
|
nbmanpages: nb
|
2022-03-31 03:16:37 +00:00
|
|
|
cp man/nb* $(DESTDIR)/$(MANDIR)
|
2021-08-06 06:27:54 +00:00
|
|
|
nbclean:
|
2022-02-01 22:25:05 +00:00
|
|
|
for game in $(ALL); do rm nb$$game; done;
|