aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-10-08 23:33:59 +0200
committermetamuffin <metamuffin@disroot.org>2025-10-08 23:33:59 +0200
commitc768cd1240c272dad34f07b09340cfe1d11d67b6 (patch)
tree7a422e56ee6874a44aa5edba018cf0e902058db3 /makefile
parentb8af9f80385fa4d38bc2ac2109250fa9ea2a8080 (diff)
downloadhurrycurry-c768cd1240c272dad34f07b09340cfe1d11d67b6.tar
hurrycurry-c768cd1240c272dad34f07b09340cfe1d11d67b6.tar.bz2
hurrycurry-c768cd1240c272dad34f07b09340cfe1d11d67b6.tar.zst
merge all makefiles into one
Diffstat (limited to 'makefile')
-rw-r--r--makefile82
1 files changed, 64 insertions, 18 deletions
diff --git a/makefile b/makefile
index 77488af9..8a46d9bb 100644
--- a/makefile
+++ b/makefile
@@ -13,24 +13,70 @@
# 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/>.
#
-.PHONY: all client pixel-client test-client server clean data book
-all: data server client test-client book
-data:
- make -C data all
-server: data
- make -C server all
-client:
- make -C client all
-pixel-client:
- make -C pixel-client all
-test-client:
- make -C test-client all
+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
+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 = $(ALL_BOOK) $(ALL_SERVER) $(ALL_CLIENT)
+.PHONY: all clean all_client all_server all_book all_testclient
+all: $(ALL)
+all_client: $(ALL_CLIENT)
+all_server: $(ALL_SERVER)
+all_book: $(ALL_BOOK)
+all_testclient: $(ALL_TESTCLIENT)
clean:
- make -C data clean
- make -C server clean
- make -C client clean
- make -C pixel-client clean
- make -C test-client clean
- cargo $(CARGOFLAGS) 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)
+ @mkdir -p $(dir $@); $(TOOLS) map-tiles 5star > $@~ && cp $@~ $@
+target/book/items/list: $(TOOLS)
+ @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 256
+ touch $@
+target/book/items/done: target/book/items/list client/.godot/import-finished
+ $(CLIENT) --render-items ../$< --render-output ../$(dir $@) --render-resolution 256
+ touch $@
+target/book/book.html: target/book/tiles/done target/book/items/done $(BOOK_EXPORT)
+ $(BOOK_EXPORT) -f html -m 5star > $@~ && cp $@~ $@
+
+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,$(^))