Just noticed that the return value of midend_process_key() wasn't
[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
cb0c7d4a 13!makefile wce Makefile.wce
eb2ad6f1 14!makefile cygwin Makefile.cyg
9494d866 15!makefile osx Makefile.osx
720a8fb7 16
fa2cb13d 17!srcdir icons/
18
821ab2c6 19WINDOWS = windows printing
20 + user32.lib gdi32.lib comctl32.lib comdlg32.lib winspool.lib
dafd6cf6 21COMMON = midend drawing misc malloc random version
dafd6cf6 22GTK = gtk printing ps
3f98cd5a 23# Objects needed for auxiliary command-line programs.
24STANDALONE = nullfe random misc malloc
dafd6cf6 25
3f98cd5a 26ALL = list
720a8fb7 27
3f98cd5a 28# First half of list.c.
29!begin >list.c
30/*
31 * list.c: List of pointers to puzzle structures, for monolithic
32 * platforms.
33 *
34 * This file is automatically generated by mkfiles.pl. Do not edit
35 * it directly, or the changes will be lost next time mkfiles.pl runs.
36 * Instead, edit Recipe and/or its *.R subfiles.
37 */
38#include "puzzles.h"
39#define GAMELIST(A) \
40!end
8317499a 41
3f98cd5a 42# Now each .R file adds part of the macro definition of GAMELIST to list.c.
43!include *.R
9b265feb 44
3f98cd5a 45# Then we finish up list.c as follows:
46!begin >list.c
8317499a 47
3f98cd5a 48#define DECL(x) extern const game x;
49#define REF(x) &x,
50GAMELIST(DECL)
51const game *gamelist[] = { GAMELIST(REF) };
52const int gamecount = lenof(gamelist);
53!end
699b896a 54
9494d866 55# Mac OS X unified application containing all the puzzles.
a96edf8a 56Puzzles : [MX] osx osx.icns osx-info.plist COMMON ALL
fccfd04d 57# For OS X, we must create the online help and include it in the
08f7c1b2 58# application bundle.) Also we add -DCOMBINED to the compiler flags
59# so as to inform the code that we're building a single binary for
c4a7369d 60# all the puzzles. Then I've also got some code in here to build a
61# distributable .dmg disk image.
fccfd04d 62!begin osx
08f7c1b2 63CFLAGS += -DCOMBINED
fccfd04d 64Puzzles_extra = Puzzles.app/Contents/Resources/Help/index.html
65Puzzles.app/Contents/Resources/Help/index.html: \
8709d5d9 66 Puzzles.app/Contents/Resources/Help osx-help.but puzzles.but
67 cd Puzzles.app/Contents/Resources/Help; \
68 halibut --html ../../../../osx-help.but ../../../../puzzles.but
fccfd04d 69Puzzles.app/Contents/Resources/Help: Puzzles.app/Contents/Resources
70 mkdir -p Puzzles.app/Contents/Resources/Help
c4a7369d 71
72release: Puzzles.dmg
73Puzzles.dmg: Puzzles
74 rm -f raw.dmg
75 hdiutil create -megabytes 5 -layout NONE raw.dmg
76 hdid -nomount raw.dmg > devicename
77 newfs_hfs -v "Simon Tatham's Puzzle Collection" `cat devicename`
78 hdiutil eject `cat devicename`
79 hdid raw.dmg | cut -f1 -d' ' > devicename
80 cp -R Puzzles.app /Volumes/"Simon Tatham's Puzzle Collection"
81 hdiutil eject `cat devicename`
82 rm -f Puzzles.dmg
83 hdiutil convert -format UDCO raw.dmg -o Puzzles.dmg
84 rm -f raw.dmg devicename
fccfd04d 85!end
9494d866 86
97098757 87# Version management.
88!begin vc
89version.obj: *.c *.h
90 cl $(VER) $(CFLAGS) /c version.c
91!end
92!specialobj vc version
cb0c7d4a 93!begin wce
94version.obj: *.c *.h
95 $(CC) $(VER) $(CFLAGS) /c version.c
96!end
97!specialobj wce version
97098757 98!begin cygwin
36d01ffa 99version.o: FORCE;
97098757 100FORCE:
101 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c
102!end
103!specialobj cygwin version
104# For Unix, we also need the gross MD5 hack that causes automatic
105# version number selection in release source archives.
106!begin gtk
107version.o: FORCE;
108FORCE:
118fcd8b 109 if test -z "$(VER)" && test -f manifest && md5sum -c manifest; then \
97098757 110 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version.def` -c version.c; \
c1f500c0 111 elif test -z "$(VER)" && test -d .svn && svnversion . >/dev/null 2>&1; then \
118fcd8b 112 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) "-DREVISION=`svnversion .`" -c version.c; \
97098757 113 else \
114 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c; \
115 fi
116!end
117!specialobj gtk version
118# For OS X, this is made more fiddly by the fact that we don't have
119# md5sum readily available. We do, however, have `md5 -r' which
120# generates _nearly_ the same output, but it has no check function.
121!begin osx
d68d8560 122version.ppc.o: FORCE;
97098757 123FORCE:
124 if test -z "$(VER)" && test -f manifest && (md5 -r `awk '{print $$2}' manifest` | diff -w manifest -); then \
d68d8560 125 $(CC) -arch ppc $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version.def` -c version.c -o version.ppc.o; \
c1f500c0 126 elif test -z "$(VER)" && test -d .svn && svnversion . >/dev/null 2>&1; then \
d68d8560 127 $(CC) -arch ppc $(COMPAT) $(XFLAGS) $(CFLAGS) "-DREVISION=`svnversion .`" -c version.c -o version.ppc.o; \
97098757 128 else \
d68d8560 129 $(CC) -arch ppc $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c -o version.ppc.o; \
130 fi
131version.i386.o: FORCE2;
132FORCE2:
133 if test -z "$(VER)" && test -f manifest && (md5 -r `awk '{print $$2}' manifest` | diff -w manifest -); then \
134 $(CC) -arch i386 $(COMPAT) $(XFLAGS) $(CFLAGS) `cat version.def` -c version.c -o version.i386.o; \
135 elif test -z "$(VER)" && test -d .svn && svnversion . >/dev/null 2>&1; then \
136 $(CC) -arch i386 $(COMPAT) $(XFLAGS) $(CFLAGS) "-DREVISION=`svnversion .`" -c version.c -o version.i386.o; \
137 else \
138 $(CC) -arch i386 $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c version.c -o version.i386.o; \
97098757 139 fi
140!end
141!specialobj osx version
fd38f463 142
143# make install for Unix.
144!begin gtk
145install:
3f98cd5a 146 for i in $(GAMES); do \
0d336b11 147 $(INSTALL_PROGRAM) -m 755 $$i $(DESTDIR)$(gamesdir)/$$i \
148 || exit 1; \
fd38f463 149 done
150!end