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