1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# Hurry Curry! - a game about cooking
# Copyright (C) 2025 Hurry Curry! contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License only.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
JSR = deno run
GODOT = godot
CLIENT = $(GODOT) --path client --
TOOLS = target/release/hurrycurry-tools
BOOK_EXPORT = target/release/hurrycurry-book-export
LOCALE_EXPORT = target/release/hurrycurry-locale-export
SERVER = target/release/hurrycurry-server
REPLAYTOOL = target/release/hurrycurry-replaytool
DISCOVER = target/release/hurrycurry-discover
EDITOR = target/release/hurrycurry-editor
ALL_TESTCLIENT = test-client/main.js $(patsubst locale/%.ini,test-client/locale/%.json,$(wildcard locale/*.ini))
ALL_BOOK = target/book/book.html $(patsubst locale/%.ini,target/book/book.%.html,$(wildcard locale/*.ini))
ALL_SERVER = $(SERVER) $(TOOLS) $(REPLAYTOOL) $(EDITOR) $(DISCOVER) $(LOCALE_EXPORT)
ALL_CLIENT = client/.godot/import-finished client/icons/adaptive-background.png client/icons/adaptive-foreground.png
ALL_DATA = data/recipes/none.yaml data/recipes/anticurry.yaml data/recipes/default.yaml
ALL = $(ALL_BOOK) $(ALL_SERVER) $(ALL_CLIENT) $(ALL_DATA)
.PHONY: all clean all_client all_server all_book all_testclient all_data
all: $(ALL)
all_client: $(ALL_CLIENT)
all_server: $(ALL_SERVER)
all_book: $(ALL_BOOK)
all_data: $(ALL_DATA)
all_testclient: $(ALL_TESTCLIENT)
clean:
rm -rf target client/.godot
target/release/%: $(shell find server -type f -name '*.rs')
cargo build --release --bin $(patsubst target/release/%,%,$@); touch $@
target/book/tiles/list: $(TOOLS) $(ALL_DATA)
@mkdir -p $(dir $@); $(TOOLS) map-tiles 5star > $@~ && cp $@~ $@
target/book/items/list: $(TOOLS) $(ALL_DATA)
@mkdir -p $(dir $@); $(TOOLS) map-items 5star > $@~ && cp $@~ $@
target/book/tiles/done: target/book/tiles/list client/.godot/import-finished
$(CLIENT) --render-tiles ../$< --render-output ../$(dir $@) --render-resolution 512; touch $@
target/book/items/done: target/book/items/list client/.godot/import-finished
$(CLIENT) --render-items ../$< --render-output ../$(dir $@) --render-resolution 512; touch $@
target/book/book.%.html: target/book/tiles/done target/book/items/done $(BOOK_EXPORT) $(ALL_DATA) locale/en.ini locale/%.ini
$(BOOK_EXPORT) -o $@ -l $(shell basename -s .html $@ | cut -d '.' -f 2) -f html -m 5star
target/book/book.html: target/book/book.en.html
cp -v $< $@
data/recipes/none.yaml:
echo > $@
data/recipes/anticurry.yaml: data/recipes/default.yaml
data/recipes/anticurry.sed < $< > $@~ && cp $@~ $@
data/recipes/default.yaml: data/recipes/default.js
DENO_NO_UPDATE_CHECK=1 $(JSR) $< > $@~ && cp $@~ $@
data/recipes/%.gv.txt: data/recipes/%.yaml
$(TOOLS) graph > $@~ && cp $@~ $@
data/recipes/%.svg: data/recipes/%.gv.txt
dot -Tsvg -Kdot < $< > $@~ && cp $@~ $@
client/.godot/import-finished: $(shell find client -name '*.gd' -or -name '*.res')
$(GODOT) --headless --import client/project.godot; touch $@
client/icons/adaptive-background.png:
ffmpeg -f lavfi -i "color=color=#E28142,scale=432x432" -frames:v 1 -y $@
client/icons/adaptive-foreground.png: client/icons/main.png
ffmpeg -f image2 -i $< -vf "scale=280x280,pad=432:432:(ow-iw)/2:(oh-ih)/2:0x00000000" -frames:v 1 -y $@
test-client/main.js: test-client/main.ts $(wildcard test-client/*.ts)
esbuild $< --bundle --outfile=$@ --target=esnext --format=esm
test-client/locale/%.json: $(LOCALE_EXPORT) locale/%.ini locale/en.ini
@mkdir -p test-client/locale
$(LOCALE_EXPORT) export-json $@ $(wordlist 2,99,$(^))
|