1
0
mirror of https://github.com/abakh/nbsdgames.git synced 2024-12-04 14:46:22 -05:00
nbsdgames/Makefile
2021-04-24 13:29:40 +04:30

68 lines
3.1 KiB
Makefile

# -*- Makefile -*-
CFLAGS+= -O3 -Wno-unused-result
LDFLAGS+= -lncurses -lm
#-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.
GAMES_DIR?=/usr/games
SCORES_DIR?=/var/games
all: jewels sudoku mines reversi checkers battleship rabbithole sos pipes fifteen memoblocks fisher muncher miketron redsquare darrt snakeduel
scorefiles:
touch $(SCORES_DIR)/pipes_scores
touch $(SCORES_DIR)/jewels_scores
touch $(SCORES_DIR)/miketron_scores
touch $(SCORES_DIR)/muncher_scores
touch $(SCORES_DIR)/fisher_scores
touch $(SCORES_DIR)/darrt_scores
chmod 666 $(SCORES_DIR)/pipes_scores
chmod 666 $(SCORES_DIR)/jewels_scores
chmod 666 $(SCORES_DIR)/miketron_scores
chmod 666 $(SCORES_DIR)/muncher_scores
chmod 666 $(SCORES_DIR)/fisher_scores
chmod 666 $(SCORES_DIR)/darrt_scores
jewels: jewels.c config.h common.h
$(CC) jewels.c $(LDFLAGS) $(CFLAGS) -o ./jewels
sudoku: sudoku.c config.h
$(CC) sudoku.c $(LDFLAGS) $(CFLAGS) -lm -o ./sudoku
mines: mines.c config.h
$(CC) mines.c $(LDFLAGS) $(CFLAGS) -o ./mines
reversi: reversi.c config.h
$(CC) reversi.c $(LDFLAGS) $(CFLAGS) -o ./reversi
checkers: checkers.c config.h
$(CC) checkers.c $(LDFLAGS) $(CFLAGS) -o ./checkers
battleship: battleship.c config.h
$(CC) battleship.c $(LDFLAGS) $(CFLAGS) -o ./battleship
rabbithole: rabbithole.c config.h
$(CC) rabbithole.c $(LDFLAGS) $(CFLAGS) -o ./rabbithole
sos: sos.c config.h
$(CC) sos.c $(LDFLAGS) $(CFLAGS) -o ./sos
pipes: pipes.c config.h
$(CC) pipes.c $(LDFLAGS) $(CFLAGS) -o ./pipes
fifteen: fifteen.c config.h
$(CC) fifteen.c $(LDFLAGS) $(CFLAGS) -o ./fifteen
memoblocks: memoblocks.c
$(CC) memoblocks.c $(LDFLAGS) $(CFLAGS) -o ./memoblocks
fisher: fisher.c config.h common.h
$(CC) fisher.c $(LDFLAGS) $(CFLAGS) -o ./fisher
muncher: muncher.c config.h common.h
$(CC) muncher.c $(LDFLAGS) $(CFLAGS) -o ./muncher
miketron: miketron.c config.h common.h
$(CC) miketron.c $(LDFLAGS) $(CFLAGS) -o ./miketron
redsquare: redsquare.c config.h
$(CC) redsquare.c $(LDFLAGS) $(CFLAGS) -o ./redsquare
darrt: darrt.c config.h common.h
$(CC) darrt.c $(LDFLAGS) $(CFLAGS) -lm -o ./darrt
snakeduel: snakeduel.c config.h
$(CC) snakeduel.c $(LDFLAGS) $(CFLAGS) -o ./snakeduel
clean:
rm ./jewels ./sudoku ./checkers ./mines ./reversi ./battleship ./rabbithole ./sos ./pipes ./fifteen ./memoblocks ./fisher ./muncher ./miketron ./redsquare ./darrt ./snakeduel
uninstall:
rm $(GAMES_DIR)/jewels $(GAMES_DIR)/sudoku $(GAMES_DIR)/checkers $(GAMES_DIR)/mines $(GAMES_DIR)/reversi $(GAMES_DIR)/battleship $(GAMES_DIR)/rabbithole $(GAMES_DIR)/sos $(GAMES_DIR)/pipes $(GAMES_DIR)/fifteen $(GAMES_DIR)/memoblocks $(GAMES_DIR)/fisher $(GAMES_DIR)/muncher $(GAMES_DIR)/miketron $(GAMES_DIR)/redsquare $(GAMES_DIR)/darrt $(GAMES_DIR)/snakeduel
install: scorefiles jewels sudoku mines reversi checkers battleship rabbithole sos pipes fifteen memoblocks fisher muncher miketron redsquare darrt snakeduel
cp jewels sudoku mines reversi checkers battleship rabbithole sos pipes fifteen memoblocks fisher muncher miketron redsquare darrt snakeduel $(GAMES_DIR)