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