Forcing chains in Map give rise to a new `Hard' difficulty level.
[sgt/puzzles] / Recipe
... / ...
CommitLineData
1# -*- makefile -*-
2#
3# This file describes which puzzle binaries are made up from which
4# object and resource files. It is processed into the various
5# Makefiles by means of a Perl script. Makefile changes should
6# really be made by editing this file and/or the Perl script, not
7# by editing the actual Makefiles.
8
9!name puzzles
10
11!makefile gtk Makefile
12!makefile vc Makefile.vc
13!makefile cygwin Makefile.cyg
14!makefile osx Makefile.osx
15
16WINDOWS = windows printing
17 + user32.lib gdi32.lib comctl32.lib comdlg32.lib winspool.lib
18COMMON = midend drawing misc malloc random version
19NET = net tree234 dsf
20NETSLIDE = netslide tree234
21MINES = mines tree234
22FLIP = flip tree234
23PEGS = pegs tree234
24UNTANGLE = untangle tree234
25SLANT = slant dsf
26MAP = map dsf
27LOOPY = loopy tree234 dsf
28
29ALL = list NET NETSLIDE cube fifteen sixteen rect pattern solo twiddle
30 + MINES samegame FLIP guess PEGS dominosa UNTANGLE blackbox SLANT
31 + lightup MAP LOOPY inertia
32
33GTK = gtk printing ps
34
35net : [X] GTK COMMON NET
36netslide : [X] GTK COMMON NETSLIDE
37cube : [X] GTK COMMON cube
38fifteen : [X] GTK COMMON fifteen
39sixteen : [X] GTK COMMON sixteen
40rect : [X] GTK COMMON rect
41pattern : [X] GTK COMMON pattern
42solo : [X] GTK COMMON solo
43twiddle : [X] GTK COMMON twiddle
44mines : [X] GTK COMMON MINES
45samegame : [X] GTK COMMON samegame
46flip : [X] GTK COMMON FLIP
47guess : [X] GTK COMMON guess
48pegs : [X] GTK COMMON PEGS
49dominosa : [X] GTK COMMON dominosa
50untangle : [X] GTK COMMON UNTANGLE
51blackbox : [X] GTK COMMON blackbox
52slant : [X] GTK COMMON SLANT
53lightup : [X] GTK COMMON lightup
54map : [X] GTK COMMON MAP
55loopy : [X] GTK COMMON LOOPY
56inertia : [X] GTK COMMON inertia
57
58# Auxiliary command-line programs.
59solosolver : [U] solo[STANDALONE_SOLVER] malloc
60patternsolver : [U] pattern[STANDALONE_SOLVER] malloc
61mineobfusc : [U] mines[STANDALONE_OBFUSCATOR] malloc random tree234 misc
62slantsolver : [U] slant[STANDALONE_SOLVER] dsf malloc
63
64solosolver : [C] solo[STANDALONE_SOLVER] malloc
65patternsolver : [C] pattern[STANDALONE_SOLVER] malloc
66mineobfusc : [C] mines[STANDALONE_OBFUSCATOR] malloc random tree234 misc
67slantsolver : [C] slant[STANDALONE_SOLVER] dsf malloc
68
69# The Windows Net shouldn't be called `net.exe' since Windows
70# already has a reasonably important utility program by that name!
71netgame : [G] WINDOWS COMMON NET
72netslide : [G] WINDOWS COMMON NETSLIDE
73cube : [G] WINDOWS COMMON cube
74fifteen : [G] WINDOWS COMMON fifteen
75sixteen : [G] WINDOWS COMMON sixteen
76rect : [G] WINDOWS COMMON rect
77pattern : [G] WINDOWS COMMON pattern
78solo : [G] WINDOWS COMMON solo
79twiddle : [G] WINDOWS COMMON twiddle
80mines : [G] WINDOWS COMMON MINES
81samegame : [G] WINDOWS COMMON samegame
82flip : [G] WINDOWS COMMON FLIP
83guess : [G] WINDOWS COMMON guess
84pegs : [G] WINDOWS COMMON PEGS
85dominosa : [G] WINDOWS COMMON dominosa
86untangle : [G] WINDOWS COMMON UNTANGLE
87blackbox : [G] WINDOWS COMMON blackbox
88slant : [G] WINDOWS COMMON SLANT
89lightup : [G] WINDOWS COMMON lightup
90map : [G] WINDOWS COMMON MAP
91loopy : [G] WINDOWS COMMON LOOPY
92inertia : [G] WINDOWS COMMON inertia
93
94# Mac OS X unified application containing all the puzzles.
95Puzzles : [MX] osx osx.icns osx-info.plist COMMON ALL
96# For OS X, we must create the online help and include it in the
97# application bundle.) Also we add -DCOMBINED to the compiler flags
98# so as to inform the code that we're building a single binary for
99# all the puzzles. Then I've also got some code in here to build a
100# distributable .dmg disk image.
101!begin osx
102CFLAGS += -DCOMBINED
103Puzzles_extra = Puzzles.app/Contents/Resources/Help/index.html
104Puzzles.app/Contents/Resources/Help/index.html: \
105 Puzzles.app/Contents/Resources/Help osx-help.but puzzles.but
106 cd Puzzles.app/Contents/Resources/Help; \
107 halibut --html ../../../../osx-help.but ../../../../puzzles.but
108Puzzles.app/Contents/Resources/Help: Puzzles.app/Contents/Resources
109 mkdir -p Puzzles.app/Contents/Resources/Help
110
111release: Puzzles.dmg
112Puzzles.dmg: Puzzles
113 rm -f raw.dmg
114 hdiutil create -megabytes 5 -layout NONE raw.dmg
115 hdid -nomount raw.dmg > devicename
116 newfs_hfs -v "Simon Tatham's Puzzle Collection" `cat devicename`
117 hdiutil eject `cat devicename`
118 hdid raw.dmg | cut -f1 -d' ' > devicename
119 cp -R Puzzles.app /Volumes/"Simon Tatham's Puzzle Collection"
120 hdiutil eject `cat devicename`
121 rm -f Puzzles.dmg
122 hdiutil convert -format UDCO raw.dmg -o Puzzles.dmg
123 rm -f raw.dmg devicename
124!end
125
126# The `nullgame' source file is a largely blank one, which contains
127# all the correct function definitions to compile and link, but
128# which defines the null game in which nothing is ever drawn and
129# there are no valid moves. Its main purpose is to act as a
130# template for writing new game definition source files. I include
131# it in the Makefile because it will be worse than useless if it
132# ever fails to compile, so it's important that it should actually
133# be built on a regular basis.
134nullgame : [X] GTK COMMON nullgame
135nullgame : [G] WINDOWS COMMON nullgame
136
137# Version management.
138!begin vc
139version.obj: *.c *.h
140 cl $(VER) $(CFLAGS) /c version.c
141!end
142!specialobj vc version
143!begin cygwin
144version.o: FORCE;
145FORCE:
146 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c
147!end
148!specialobj cygwin version
149# For Unix, we also need the gross MD5 hack that causes automatic
150# version number selection in release source archives.
151!begin gtk
152version.o: FORCE;
153FORCE:
154 if test -z "$(VER)" && test -f manifest && md5sum -c manifest; then \
155 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version.def` -c version.c; \
156 elif test -z "$(VER)" && test -d .svn && svnversion . >&/dev/null; then \
157 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) "-DREVISION=`svnversion .`" -c version.c; \
158 else \
159 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c; \
160 fi
161!end
162!specialobj gtk version
163# For OS X, this is made more fiddly by the fact that we don't have
164# md5sum readily available. We do, however, have `md5 -r' which
165# generates _nearly_ the same output, but it has no check function.
166!begin osx
167version.o: FORCE;
168FORCE:
169 if test -z "$(VER)" && test -f manifest && (md5 -r `awk '{print $$2}' manifest` | diff -w manifest -); then \
170 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version.def` -c version.c; \
171 elif test -z "$(VER)" && test -d .svn && svnversion . >&/dev/null; then \
172 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) "-DREVISION=`svnversion .`" -c version.c; \
173 else \
174 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c; \
175 fi
176!end
177!specialobj osx version
178
179# make install for Unix.
180!begin gtk
181install:
182 for i in cube net netslide fifteen sixteen twiddle \
183 pattern rect solo mines samegame flip guess \
184 pegs dominosa untangle blackbox slant lightup \
185 map loopy inertia; do \
186 $(INSTALL_PROGRAM) -m 755 $$i $(DESTDIR)$(gamesdir)/$$i; \
187 done
188!end