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.
11 !makefile gtk Makefile
12 !makefile vc Makefile.vc
13 !makefile wce Makefile.wce
14 !makefile cygwin Makefile.cyg
15 !makefile osx Makefile.osx
16 !makefile gnustep Makefile.gnustep
17 !makefile nestedvm Makefile.nestedvm
21 WINDOWS_COMMON = printing
22 + user32.lib gdi32.lib comctl32.lib comdlg32.lib winspool.lib
23 WINDOWS = windows WINDOWS_COMMON
24 COMMON = midend drawing misc malloc random version
26 # Objects needed for auxiliary command-line programs.
27 STANDALONE = nullfe random misc malloc
31 # First half of list.c.
34 * list.c: List of pointers to puzzle structures, for monolithic
37 * This file is automatically generated by mkfiles.pl. Do not edit
38 * it directly, or the changes will be lost next time mkfiles.pl runs.
39 * Instead, edit Recipe and/or its *.R subfiles.
45 # Now each .R file adds part of the macro definition of GAMELIST to list.c.
48 # Then we finish up list.c as follows:
51 #define DECL(x) extern const game x;
54 const game *gamelist[] = { GAMELIST(REF) };
55 const int gamecount = lenof(gamelist);
58 # Unix standalone application for special-purpose obfuscation.
59 obfusc : [U] obfusc STANDALONE
61 puzzles : [G] windows[COMBINED] WINDOWS_COMMON COMMON ALL noicon.res
63 # Mac OS X unified application containing all the puzzles.
64 Puzzles : [MX] osx osx.icns osx-info.plist COMMON ALL
65 # For OS X, we must create the online help and include it in the
66 # application bundle.) Also we add -DCOMBINED to the compiler flags
67 # so as to inform the code that we're building a single binary for
68 # all the puzzles. Then I've also got some code in here to build a
69 # distributable .dmg disk image.
71 Puzzles_extra = Puzzles.app/Contents/Resources/Help/index.html
72 Puzzles.app/Contents/Resources/Help/index.html: \
73 Puzzles.app/Contents/Resources/Help osx-help.but puzzles.but
74 cd Puzzles.app/Contents/Resources/Help; \
75 halibut --html ../../../../osx-help.but ../../../../puzzles.but
76 Puzzles.app/Contents/Resources/Help: Puzzles.app/Contents/Resources
77 mkdir -p Puzzles.app/Contents/Resources/Help
82 hdiutil create -megabytes 5 -layout NONE raw.dmg
83 hdid -nomount raw.dmg > devicename
84 newfs_hfs -v "Simon Tatham's Puzzle Collection" `cat devicename`
85 hdiutil eject `cat devicename`
86 hdid raw.dmg | cut -f1 -d' ' > devicename
87 cp -R Puzzles.app /Volumes/"Simon Tatham's Puzzle Collection"
88 hdiutil eject `cat devicename`
90 hdiutil convert -format UDCO raw.dmg -o Puzzles.dmg
91 rm -f raw.dmg devicename
97 cl $(VER) $(CFLAGS) /c version.c
99 !specialobj vc version
102 $(CC) $(VER) $(CFLAGS) /c version.c
104 !specialobj wce version
108 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c
110 !specialobj cygwin version
111 # For Unix, we also need the gross MD5 hack that causes automatic
112 # version number selection in release source archives.
114 version.o: version.c version2.def
115 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version2.def` -c version.c
117 if test -z "$(VER)" && test -f manifest && md5sum -c manifest; then \
118 cat version.def > version2.def.new; \
119 elif test -z "$(VER)" && test -d .svn && svnversion . >/dev/null 2>&1; then \
120 echo "-DREVISION=`svnversion .`" >version2.def.new; \
122 echo "$(VER)" >version2.def.new; \
124 if diff -q version2.def.new version2.def; then \
125 rm version2.def.new; \
127 mv version2.def.new version2.def; \
131 !specialobj gtk version
133 version.o: version.c version2.def
134 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version2.def` -c version.c
136 if test -z "$(VER)" && test -f manifest && md5sum -c manifest; then \
137 cat version.def > version2.def.new; \
138 elif test -z "$(VER)" && test -d .svn && svnversion . >/dev/null 2>&1; then \
139 echo "-DREVISION=`svnversion .`" >version2.def.new; \
141 echo "$(VER)" >version2.def.new; \
143 if diff -q version2.def.new version2.def; then \
144 rm version2.def.new; \
146 mv version2.def.new version2.def; \
150 !specialobj nestedvm version
151 # For OS X, this is made more fiddly by the fact that we don't have
152 # md5sum readily available. We do, however, have `md5 -r' which
153 # generates _nearly_ the same output, but it has no check function.
155 version.ppc.o: version.c version2.def
156 $(CC) -arch ppc $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version2.def` -c version.c -o $@
157 version.i386.o: version.c version2.def
158 $(CC) -arch i386 $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version2.def` -c version.c -o $@
160 if test -z "$(VER)" && test -f manifest && (md5 -r `awk '{print $$2}' manifest` | diff -w manifest -); then \
161 cat version.def > version2.def.new; \
162 elif test -z "$(VER)" && test -d .svn && svnversion . >/dev/null 2>&1; then \
163 echo "-DREVISION=`svnversion .`" >version2.def.new; \
165 echo "$(VER)" >version2.def.new; \
167 if diff -q version2.def.new version2.def; then \
168 rm version2.def.new; \
170 mv version2.def.new version2.def; \
174 !specialobj osx version
176 # make install for Unix.
179 for i in $(GAMES); do \
180 $(INSTALL_PROGRAM) -m 755 $$i $(DESTDIR)$(gamesdir)/$$i \
187 java -cp $(NESTEDVM)/build:$(NESTEDVM)/upstream/build/classgen/build \
188 org.ibex.nestedvm.Compiler -outformat class -d . \
190 mv PuzzleEngine.class $@
193 mkdir -p org/ibex/nestedvm/util
194 cp $(NESTEDVM)/build/org/ibex/nestedvm/{Registers,UsermodeConstants,Runtime*}.class org/ibex/nestedvm
195 cp $(NESTEDVM)/build/org/ibex/nestedvm/util/{Platform*,Seekable*}.class org/ibex/nestedvm/util
196 echo "Main-Class: PuzzleApplet" >applet.manifest
198 PuzzleApplet.class: PuzzleApplet.java org
199 javac -source 1.3 -target 1.3 PuzzleApplet.java
201 %.jar: %.class PuzzleApplet.class org
202 mv $< PuzzleEngine.class
203 jar cfm $@ applet.manifest PuzzleEngine.class PuzzleApplet*.class org
204 echo '<applet archive="'$@'" code="PuzzleApplet" width="700" height="500"></applet>' >$*.html
205 mv PuzzleEngine.class $<