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