diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-17 00:40:51 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-17 00:40:51 +0200 |
commit | 8e03dfcd16752c87e8593b599bd317dce0019265 (patch) | |
tree | 33c93fc7b2d2c7950da8f663b3e0b408bcc88266 | |
parent | 922f04cfadbd3bab3eef09df036ad5edcc899199 (diff) | |
download | hurrycurry-8e03dfcd16752c87e8593b599bd317dce0019265.tar hurrycurry-8e03dfcd16752c87e8593b599bd317dce0019265.tar.bz2 hurrycurry-8e03dfcd16752c87e8593b599bd317dce0019265.tar.zst |
makefile everything
-rw-r--r-- | client/makefile | 15 | ||||
-rw-r--r-- | data/makefile | 3 | ||||
-rw-r--r-- | makefile | 37 | ||||
-rw-r--r-- | pixel-client/makefile | 51 | ||||
-rw-r--r-- | pixel-client/tools/Cargo.toml | 2 | ||||
-rw-r--r-- | readme.md | 47 | ||||
-rw-r--r-- | server/makefile | 28 | ||||
-rw-r--r-- | test-client/makefile | 22 |
8 files changed, 175 insertions, 30 deletions
diff --git a/client/makefile b/client/makefile index e448e5ac..bacb7f6d 100644 --- a/client/makefile +++ b/client/makefile @@ -1,3 +1,18 @@ +# Hurry Curry! - a game about cooking +# Copyright 2024 metamuffin +# +# 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/>. +# .PHONY: assets clean all all: assets assets: menu/book/book_1.webp diff --git a/data/makefile b/data/makefile index c9d0ee8a..3f94769b 100644 --- a/data/makefile +++ b/data/makefile @@ -24,3 +24,6 @@ recipes/%.gv.txt: recipes/%.yaml recipes/%.svg: recipes/%.gv.txt dot -Tsvg -Kdot >$@<$< + +clean: + rm -r recipes/*.{yaml,gv.txt,svg} @@ -1,7 +1,36 @@ -.PHONY: all client light-client -all: client light-client +# Hurry Curry! - a game about cooking +# Copyright 2024 metamuffin +# +# 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/>. +# +.PHONY: all client pixel-client test-client server clean data +all: data server client pixel-client test-client +data: + make -C data all +server: data + make -C server all client: make -C client all -light-client: - make -C light-client all +pixel-client: + make -C pixel-client all +test-client: + make -C test-client all + +clean: + make -C data clean + make -C server clean + make -C client clean + make -C pixel-client clean + make -C test-client clean + cargo clean diff --git a/pixel-client/makefile b/pixel-client/makefile index 6a56fc62..6aa891d3 100644 --- a/pixel-client/makefile +++ b/pixel-client/makefile @@ -1,4 +1,18 @@ - +# Hurry Curry! - a game about cooking +# Copyright 2024 metamuffin +# +# 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/>. +# SPRITES = $(shell find assets/sprites -name '*.ta') SPRITES_PNG = $(patsubst %.ta,%.png,$(SPRITES)) @@ -8,7 +22,16 @@ TEXTURES_IMPORT_PNG = $(patsubst %.import.png,%.ta,$(shell find assets/textures PNG = $(shell find assets/textures -name '*.png') -.PHONY: tex_pack tex_export tex_import clean +CLIENT_DEPS = assets/atlas.meta.csv assets/atlas.ta assets/connect.csv assets/palette.csv + +IMPORT = ../target/release/tex_import +EXPORT = ../target/release/tex_export +PACK = ../target/release/tex_pack +COMPOSE = ../target/release/tex_compose +CLIENT = ../target/release/pixelcurry + +.PHONY: all tex_pack tex_export tex_import clean +all: $(CLIENT) tex_pack: assets/atlas.ta tex_import: $(TEXTURES_IMPORT_PNG) tex_export: $(TEXTURES_PNG) $(SPRITES_PNG) assets/atlas.png @@ -17,21 +40,21 @@ clean: rm -fr assets/sprites rm -f assets/atlas.ta assets/atlas.meta.csv +$(CLIENT): $(shell find src -type f) $(CLIENT_DEPS) + cargo build --release --bin pixelcurry +$(IMPORT) $(EXPORT) $(PACK) $(COMPOSE): $(shell find tools/src -type f) + { cd tools; cargo build --release; } -IMPORT = ../target/release/tex_import -EXPORT = ../target/release/tex_export -PACK = ../target/release/tex_pack -COMPOSE = ../target/release/tex_compose - -%.ta: %.import.png +%.ta: %.import.png $(IMPORT) $(IMPORT) $< $@ -%.png: %.ta - ../target/release/tex_export $< $@ +%.png: %.ta $(EXPORT) + $(EXPORT) $< $@ -assets/sprites/%/all: assets/%.ini $(TEXTURES) +assets/sprites/%/all: assets/%.ini $(TEXTURES) $(COMPOSE) @mkdir -p $(basename $@) - ../target/release/tex_compose $< assets/textures $(basename $@) + $(COMPOSE) $< assets/textures $(basename $@) @touch $@ -assets/atlas.ta assets/atlas.meta.csv: assets/sprites/items/all assets/sprites/tiles/all assets/sprites/misc/all - ../target/release/tex_pack assets/atlas.ta assets/atlas.meta.csv $(SPRITES) +assets/atlas.ta assets/atlas.meta.csv: assets/sprites/items/all assets/sprites/tiles/all assets/sprites/misc/all $(PACK) + @echo $(PACK) assets/atlas.ta assets/atlas.meta.csv ... + @$(PACK) assets/atlas.ta assets/atlas.meta.csv $(SPRITES) diff --git a/pixel-client/tools/Cargo.toml b/pixel-client/tools/Cargo.toml index f3075594..3392352b 100644 --- a/pixel-client/tools/Cargo.toml +++ b/pixel-client/tools/Cargo.toml @@ -9,4 +9,4 @@ anyhow = "1.0.86" log = "0.4.22" env_logger = "0.11.3" clap = { version = "4.5.9", features = ["derive"] } -sdl2 = "0.37.0" +sdl2 = { version = "0.37.0", features = ["image", "ttf"] } @@ -5,8 +5,8 @@ A cooperative multiplayer game about cooking. The protocol is documented in [protocol.md](protocol.md). If you happen to be using pacman you can add or manually download pre-built -packages https://pkg.metamuffin.org/. These also include documentation and a -systemd service. +packages from https://pkg.metamuffin.org/. These also include documentation, +systemd services and .desktop files. ## Client @@ -14,13 +14,16 @@ systemd service. - Requirements: - Godot 4.2 -- `make client-assets` -- `cd client` -- Import all assets: `godot --import .` + - cURL + +``` +make client +godot --import client/project.godot +``` ### Usage -- `godot .` +- `godot client/project.godot` ## Server @@ -29,8 +32,10 @@ systemd service. - Requirements: - Nightly rust toolchain - Deno -- Build game data: `make -C data` -- Build the server program: `cargo +nightly build --release` + +``` +make test-client +``` ### Usage @@ -39,14 +44,34 @@ systemd service. server in the source folder should work. - Run the server: `./target/release/hurrycurry-server` +## Pixel Client + +### Building + +- Requirements: + - Nightly rust toolchain + - SDL2 development libraries + +``` +make pixel-client +``` + +### Usage + +``` +cargo run --bin pixel-client +``` + ## Test Client ### Building -- Requirements: `esbuild` +- Requirements: + - esbuild -- Compile typescript: - `esbuild test-client/main.ts --bundle --outdir=test-client --target=esnext --format=esm` +``` +make test-client +``` ### Usage diff --git a/server/makefile b/server/makefile new file mode 100644 index 00000000..b80ff3b8 --- /dev/null +++ b/server/makefile @@ -0,0 +1,28 @@ +# Hurry Curry! - a game about cooking +# Copyright 2024 metamuffin +# +# 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/>. +# + +SERVER = ../target/release/hurrycurry-server +REPLAYTOOL = ../target/release/hurrycurry-replaytool + +.PHONY: all +all: $(SERVER) $(REPLAYTOOL) +clean: + +$(SERVER): $(shell find protocol src -type f) + cargo build --release +$(REPLAYTOOL): $(shell find protocol replaytool -type f) + { cd replaytool; cargo build --release; } + diff --git a/test-client/makefile b/test-client/makefile new file mode 100644 index 00000000..2a83f5d0 --- /dev/null +++ b/test-client/makefile @@ -0,0 +1,22 @@ +# Hurry Curry! - a game about cooking +# Copyright 2024 metamuffin +# +# 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/>. +# +.PHONY: all clean +all: main.js +clean: + rm main.js + +main.js: main.ts $(wildcard *.ts) + esbuild $< --bundle --outfile=$@ --target=esnext --format=esm |