Minor update to Solo's documentation due to Extreme mode.
[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
27
28ALL = list NET NETSLIDE cube fifteen sixteen rect pattern solo twiddle
29 + MINES samegame FLIP guess PEGS dominosa UNTANGLE blackbox SLANT
30 + lightup MAP
31
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
54
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
59slantsolver : [U] slant[STANDALONE_SOLVER] dsf malloc
60
61solosolver : [C] solo[STANDALONE_SOLVER] malloc
62patternsolver : [C] pattern[STANDALONE_SOLVER] malloc
63mineobfusc : [C] mines[STANDALONE_OBFUSCATOR] malloc random tree234 misc
64slantsolver : [C] slant[STANDALONE_SOLVER] dsf malloc
65
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
69netslide : [G] WINDOWS COMMON NETSLIDE
70cube : [G] WINDOWS COMMON cube
71fifteen : [G] WINDOWS COMMON fifteen
72sixteen : [G] WINDOWS COMMON sixteen
73rect : [G] WINDOWS COMMON rect
74pattern : [G] WINDOWS COMMON pattern
75solo : [G] WINDOWS COMMON solo
76twiddle : [G] WINDOWS COMMON twiddle
77mines : [G] WINDOWS COMMON MINES
78samegame : [G] WINDOWS COMMON samegame
79flip : [G] WINDOWS COMMON FLIP
80guess : [G] WINDOWS COMMON guess
81pegs : [G] WINDOWS COMMON PEGS
82dominosa : [G] WINDOWS COMMON dominosa
83untangle : [G] WINDOWS COMMON UNTANGLE
84blackbox : [G] WINDOWS COMMON blackbox
85slant : [G] WINDOWS COMMON SLANT
86lightup : [G] WINDOWS COMMON lightup
87map : [G] WINDOWS COMMON MAP
88
89# Mac OS X unified application containing all the puzzles.
90Puzzles : [MX] osx osx.icns osx-info.plist COMMON ALL
91# For OS X, we must create the online help and include it in the
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
94# all the puzzles. Then I've also got some code in here to build a
95# distributable .dmg disk image.
96!begin osx
97CFLAGS += -DCOMBINED
98Puzzles_extra = Puzzles.app/Contents/Resources/Help/index.html
99Puzzles.app/Contents/Resources/Help/index.html: \
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
103Puzzles.app/Contents/Resources/Help: Puzzles.app/Contents/Resources
104 mkdir -p Puzzles.app/Contents/Resources/Help
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
119!end
120
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.
129nullgame : [X] GTK COMMON nullgame
130nullgame : [G] WINDOWS COMMON nullgame
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
139version.o: FORCE;
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:
149 if test -z "$(VER)" && test -f manifest && md5sum -c manifest; then \
150 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version.def` -c version.c; \
151 elif test -z "$(VER)" && test -d .svn && svnversion . >&/dev/null; then \
152 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) "-DREVISION=`svnversion .`" -c version.c; \
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; \
166 elif test -z "$(VER)" && test -d .svn && svnversion . >&/dev/null; then \
167 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) "-DREVISION=`svnversion .`" -c version.c; \
168 else \
169 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c; \
170 fi
171!end
172!specialobj osx version
173
174# make install for Unix.
175!begin gtk
176install:
177 for i in cube net netslide fifteen sixteen twiddle \
178 pattern rect solo mines samegame flip guess \
179 pegs dominosa untangle blackbox slant lightup \
180 map; do \
181 $(INSTALL_PROGRAM) -m 755 $$i $(DESTDIR)$(gamesdir)/$$i; \
182 done
183!end