2019-03-20 17:46:33 +03:30
|
|
|
# -*- Makefile -*-
|
2021-04-24 01:25:17 +04:30
|
|
|
|
2021-04-20 18:39:41 +04:30
|
|
|
#-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 04:16:37 +01:00
|
|
|
GAMESDIR?=$(PREFIX)/usr/games
|
|
|
|
SCORESDIR?=$(PREFIX)/var/games
|
|
|
|
MANDIR?=$(PREFIX)/usr/share/man/man6
|
2022-03-31 04:45:14 +01:00
|
|
|
CFLAGS+= -Wno-unused-result -DSCORES_DIR=\"$(PREFIX)$(SCORESDIR)\"
|
2022-03-31 04:48:05 +01:00
|
|
|
LIBS_PKG_CONFIG!=pkg-config --libs --cflags ncurses
|
|
|
|
LIBS=$(LIBS_PKG_CONFIG) -lm
|
2021-04-30 03:35:16 +04:30
|
|
|
|
|
|
|
|
2022-02-02 01:55:05 +03:30
|
|
|
ALL= nbsdgames jewels sudoku mines reversi checkers battleship rabbithole sos pipes fifteen memoblocks fisher muncher miketron redsquare darrt snakeduel tugow
|
2022-01-25 07:01:23 +03:30
|
|
|
SCORE_FILES= pipes_scores jewels_scores miketron_scores muncher_scores fisher_scores darrt_scores tugow_scores
|
2021-04-30 03:35:16 +04:30
|
|
|
|
2022-03-31 04:00:41 +01:00
|
|
|
all: $(ALL)
|
2021-04-30 03:35:16 +04:30
|
|
|
|
2020-06-20 20:56:54 +04:30
|
|
|
scorefiles:
|
2022-03-31 04:16:37 +01: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-30 03:35:16 +04:30
|
|
|
|
2021-05-04 02:33:52 +04:30
|
|
|
manpages:
|
2022-03-31 04:16:37 +01:00
|
|
|
cp man/* $(DESTDIR)$(MANDIR)
|
2022-03-31 04:45:14 +01:00
|
|
|
|
|
|
|
# Games which only need config.h
|
|
|
|
sudoku mines reversi checkers battleship rabbithole sos fifteen redsquare snakeduel: config.h
|
|
|
|
$(CC) $(CFLAGS) $@.c $< $(LDFLAGS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
# Games which need config.h and common.h
|
|
|
|
jewels pipes fisher muncher miketron darrt: config.h common.h
|
|
|
|
$(CC) $(CFLAGS) $@.c $< $(LDFLAGS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
# Games which only need common.h
|
|
|
|
tugow: common.h
|
|
|
|
$(CC) $(CFLAGS) $@.c $< $(LDFLAGS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
# Games which only need themselves
|
|
|
|
memoblocks nbsdgames:
|
|
|
|
$(CC) $(CFLAGS) $@.c $< $(LDFLAGS) $(LIBS) -o $@
|
|
|
|
|
2022-02-02 01:55:05 +03:30
|
|
|
menu:
|
2022-03-31 04:13:38 +01:00
|
|
|
cp nbsdgames.desktop $(DESTIDR)$(PREFIX)/usr/share/applications
|
|
|
|
cp nbsdgames.svg $(DESTDIR)$(PREFIX)/usr/share/pixmaps
|
2019-03-20 17:46:33 +03:30
|
|
|
clean:
|
2021-08-06 10:57:54 +04:30
|
|
|
for game in $(ALL); do rm $$game; done;
|
2019-03-20 17:46:33 +03:30
|
|
|
uninstall:
|
2022-03-31 04:16:37 +01:00
|
|
|
for game in $(ALL); do rm $(GAMESDIR)/$$game; rm $(MANDIR)/$$game.6.gz ;done;
|
2021-04-30 03:35:16 +04:30
|
|
|
install: $(ALL)
|
2022-03-31 04:16:37 +01:00
|
|
|
cp $(ALL) $(DESTDIR)/$(GAMESDIR)
|
2021-08-20 17:10:45 +04:30
|
|
|
test:
|
|
|
|
for game in $(ALL); do ./$$game ;done;
|
2021-08-06 10:57:54 +04:30
|
|
|
|
|
|
|
#######for namespacing #######
|
2022-02-02 01:55:05 +03:30
|
|
|
nb:
|
2022-03-31 04:14:34 +01:00
|
|
|
CFLAGS="$$CFLAGS -D NB=\\\"nb\\\"" $(MAKE)
|
2022-02-02 01:55:05 +03:30
|
|
|
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 10:57:54 +04:30
|
|
|
nbinstall: nb
|
2022-03-31 04:16:37 +01:00
|
|
|
cp nb* $(DESTDIR)/$(GAMESDIR)
|
2021-08-06 10:57:54 +04:30
|
|
|
nbmanpages: nb
|
2022-03-31 04:16:37 +01:00
|
|
|
cp man/nb* $(DESTDIR)/$(MANDIR)
|
2021-08-06 10:57:54 +04:30
|
|
|
nbclean:
|
2022-02-02 01:55:05 +03:30
|
|
|
for game in $(ALL); do rm nb$$game; done;
|