summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/Recipe
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-04-29 18:21:56 -0400
committerFranklin Wei <git@fwei.tk>2017-04-29 18:24:42 -0400
commit881746789a489fad85aae8317555f73dbe261556 (patch)
treecec2946362c4698c8db3c10f3242ef546c2c22dd /apps/plugins/puzzles/src/Recipe
parent03dd4b92be7dcd5c8ab06da3810887060e06abd5 (diff)
downloadrockbox-881746789a489fad85aae8317555f73dbe261556.tar.gz
rockbox-881746789a489fad85aae8317555f73dbe261556.zip
puzzles: refactor and resync with upstream
This brings puzzles up-to-date with upstream revision 2d333750272c3967cfd5cd3677572cddeaad5932, though certain changes made by me, including cursor-only Untangle and some compilation fixes remain. Upstream code has been moved to its separate subdirectory and future syncs can be done by simply copying over the new sources. Change-Id: Ia6506ca5f78c3627165ea6791d38db414ace0804
Diffstat (limited to 'apps/plugins/puzzles/src/Recipe')
-rw-r--r--apps/plugins/puzzles/src/Recipe157
1 files changed, 157 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/Recipe b/apps/plugins/puzzles/src/Recipe
new file mode 100644
index 0000000000..ba8317f51a
--- /dev/null
+++ b/apps/plugins/puzzles/src/Recipe
@@ -0,0 +1,157 @@
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.gtk
12!makefile am Makefile.am
13!makefile vc Makefile.vc
14!makefile wce Makefile.wce
15!makefile cygwin Makefile.cyg
16!makefile osx Makefile.osx
17!makefile gnustep Makefile.gnustep
18!makefile nestedvm Makefile.nestedvm
19!makefile emcc Makefile.emcc
20
21!srcdir icons/
22
23WINDOWS_COMMON = printing
24 + user32.lib gdi32.lib comctl32.lib comdlg32.lib winspool.lib
25WINDOWS = windows WINDOWS_COMMON
26COMMON = midend drawing misc malloc random version
27GTK = gtk printing ps
28# Objects needed for auxiliary command-line programs.
29STANDALONE = nullfe random misc malloc
30
31ALL = list
32
33# First half of list.c.
34!begin >list.c
35/*
36 * list.c: List of pointers to puzzle structures, for monolithic
37 * platforms.
38 *
39 * This file is automatically generated by mkfiles.pl. Do not edit
40 * it directly, or the changes will be lost next time mkfiles.pl runs.
41 * Instead, edit Recipe and/or its *.R subfiles.
42 */
43#include "puzzles.h"
44#define GAMELIST(A) \
45!end
46
47# Now each .R file adds part of the macro definition of GAMELIST to list.c.
48!include *.R
49
50# Then we finish up list.c as follows:
51!begin >list.c
52
53#define DECL(x) extern const game x;
54#define REF(x) &x,
55GAMELIST(DECL)
56const game *gamelist[] = { GAMELIST(REF) };
57const int gamecount = lenof(gamelist);
58!end
59
60# Unix standalone application for special-purpose obfuscation.
61obfusc : [U] obfusc STANDALONE
62
63puzzles : [G] windows[COMBINED] WINDOWS_COMMON COMMON ALL noicon.res
64
65# Mac OS X unified application containing all the puzzles.
66Puzzles : [MX] osx osx.icns osx-info.plist COMMON ALL
67# For OS X, we must create the online help and include it in the
68# application bundle.) Also we add -DCOMBINED to the compiler flags
69# so as to inform the code that we're building a single binary for
70# all the puzzles. Then I've also got some code in here to build a
71# distributable .dmg disk image.
72!begin osx
73Puzzles_extra = Puzzles.app/Contents/Resources/Help/index.html
74Puzzles.app/Contents/Resources/Help/index.html: \
75 Puzzles.app/Contents/Resources/Help osx-help.but puzzles.but
76 cd Puzzles.app/Contents/Resources/Help; \
77 halibut --html ../../../../osx-help.but ../../../../puzzles.but
78Puzzles.app/Contents/Resources/Help: Puzzles.app/Contents/Resources
79 mkdir -p Puzzles.app/Contents/Resources/Help
80
81release: Puzzles.dmg
82Puzzles.dmg: Puzzles
83 rm -f raw.dmg
84 hdiutil create -megabytes 5 -layout NONE raw.dmg
85 hdid -nomount raw.dmg > devicename
86 newfs_hfs -v "Simon Tatham's Puzzle Collection" `cat devicename`
87 hdiutil eject `cat devicename`
88 hdid raw.dmg | cut -f1 -d' ' > devicename
89 cp -R Puzzles.app /Volumes/"Simon Tatham's Puzzle Collection"
90 hdiutil eject `cat devicename`
91 rm -f Puzzles.dmg
92 hdiutil convert -format UDCO raw.dmg -o Puzzles.dmg
93 rm -f raw.dmg devicename
94!end
95
96!begin am
97bin_PROGRAMS = $(GAMES)
98!end
99!begin am_begin
100GAMES =
101!end
102
103# make install for Unix.
104!begin gtk
105install:
106 for i in $(GAMES); do \
107 $(INSTALL_PROGRAM) -m 755 $(BINPREFIX)$$i $(DESTDIR)$(gamesdir)/$(BINPREFIX)$$i \
108 || exit 1; \
109 done
110!end
111!begin nestedvm
112.PRECIOUS: %.class
113%.class: %.mips
114 java -cp $(NESTEDVM)/build:$(NESTEDVM)/upstream/build/classgen/build \
115 org.ibex.nestedvm.Compiler -outformat class -d . \
116 PuzzleEngine $<
117 mv PuzzleEngine.class $@
118
119org:
120 mkdir -p org/ibex/nestedvm/util
121 cp $(NESTEDVM)/build/org/ibex/nestedvm/Registers.class org/ibex/nestedvm
122 cp $(NESTEDVM)/build/org/ibex/nestedvm/UsermodeConstants.class org/ibex/nestedvm
123 cp $(NESTEDVM)/build/org/ibex/nestedvm/Runtime*.class org/ibex/nestedvm
124 cp $(NESTEDVM)/build/org/ibex/nestedvm/util/Platform*.class org/ibex/nestedvm/util
125 cp $(NESTEDVM)/build/org/ibex/nestedvm/util/Seekable*.class org/ibex/nestedvm/util
126 echo "Main-Class: PuzzleApplet" >applet.manifest
127
128PuzzleApplet.class: PuzzleApplet.java org
129 javac -source 1.3 -target 1.3 PuzzleApplet.java
130
131%.jar: %.class PuzzleApplet.class org
132 mv $< PuzzleEngine.class
133 jar cfm $@ applet.manifest PuzzleEngine.class PuzzleApplet*.class org
134 echo '<applet archive="'$@'" code="PuzzleApplet" width="700" height="500"></applet>' >$*.html
135 mv PuzzleEngine.class $<
136!end
137
138# A benchmarking and testing target for the GTK puzzles.
139!begin gtk
140test: benchmark.html benchmark.txt
141
142benchmark.html: benchmark.txt benchmark.pl
143 ./benchmark.pl benchmark.txt > $@
144
145benchmark.txt: benchmark.sh $(GAMES)
146 ./benchmark.sh > $@
147
148!end
149!begin am
150test: benchmark.html benchmark.txt
151
152benchmark.html: benchmark.txt benchmark.pl
153 ./benchmark.pl benchmark.txt > $@
154
155benchmark.txt: benchmark.sh $(GAMES)
156 ./benchmark.sh > $@
157!end