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