-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.games
72 lines (64 loc) · 1.84 KB
/
Makefile.games
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#### Simon Tatham's Portable Puzzle Collection
include defs.mk
GAME_CFLAGS := -ansi -Ivendor/puzzles/ -Ivendor/puzzles/icons -DCOMBINED \
$(BUILD_FLAGS)
# Basic defs from 'Recipe'
GAME_COMMON = midend.patched drawing misc malloc random version printing
# EXTRA sources gathered from '*.R' files:
# ag 'EXTRA\s*= ' *.R | ag -o ' = .*' | cut -c 4- | tr '[[:upper:]]' '[[:lower:]]' | xargs printf '%s\n' | sort | uniq | paste -s -d ' ' -
GAME_EXTRA = combi divvy dsf findloop grid latin laydomino loopgen matching penrose sort tdq tree234
# All the actual games (from 'vendor/puzzles/Makefile.am'). Uncomment when a
# game is ready to be included
GAMES =
GAMES += blackbox
GAMES += bridges
GAMES += cube
# GAMES += dominosa
# GAMES += fifteen
# GAMES += filling
# GAMES += flip
# GAMES += flood
GAMES += galaxies
# GAMES += guess
GAMES += inertia
# GAMES += keen
GAMES += lightup
# GAMES += loopy
# GAMES += magnets
# GAMES += map
GAMES += mines
GAMES += net.patched
# GAMES += netslide
# GAMES += palisade
# GAMES += pattern
GAMES += pearl
GAMES += pegs
# GAMES += range
# GAMES += rect
GAMES += samegame
# GAMES += signpost
# GAMES += singles
# GAMES += sixteen
GAMES += slant
# GAMES += solo
GAMES += tents
# GAMES += towers
GAMES += tracks
# GAMES += twiddle
# GAMES += undead
# GAMES += unequal
GAMES += unruly
GAMES += untangle.patched
GAME_FILES = $(GAMES) $(GAME_COMMON) $(GAME_EXTRA)
GAME_SRCS = $(GAME_FILES:%=%.c)
GAME_OBJS = $(addprefix $(BUILD_DIR)/vendor/puzzles/, $(GAME_SRCS:.c=.o))
# Games with patches
$(filter %.patched.o,$(GAME_OBJS)): $(BUILD_DIR)/%.patched.o : %.c patches/%.patch
mkdir -p $(dir $@)
patch -o $(BUILD_DIR)/$*.patched.c $^
$(CC) $(GAME_CFLAGS) -c -o $@ $(BUILD_DIR)/$*.patched.c
# Games without patches
$(filter-out %.patched.o,$(GAME_OBJS)): $(BUILD_DIR)/%.o : %.c
mkdir -p $(dir $@)
$(CC) $(GAME_CFLAGS) -c -o $@ $^
games: $(GAME_OBJS)