diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-08 23:33:59 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-08 23:33:59 +0200 |
| commit | c768cd1240c272dad34f07b09340cfe1d11d67b6 (patch) | |
| tree | 7a422e56ee6874a44aa5edba018cf0e902058db3 | |
| parent | b8af9f80385fa4d38bc2ac2109250fa9ea2a8080 (diff) | |
| download | hurrycurry-c768cd1240c272dad34f07b09340cfe1d11d67b6.tar hurrycurry-c768cd1240c272dad34f07b09340cfe1d11d67b6.tar.bz2 hurrycurry-c768cd1240c272dad34f07b09340cfe1d11d67b6.tar.zst | |
merge all makefiles into one
| -rw-r--r-- | Cargo.lock | 18 | ||||
| -rw-r--r-- | client/makefile | 33 | ||||
| -rw-r--r-- | client/system/settings.gd | 2 | ||||
| -rw-r--r-- | data/makefile | 37 | ||||
| -rw-r--r-- | makefile | 82 | ||||
| -rw-r--r-- | server/book-export/src/main.rs | 3 | ||||
| -rw-r--r-- | server/data/src/index.rs | 33 | ||||
| -rw-r--r-- | server/locale-export/Cargo.toml | 2 | ||||
| -rw-r--r-- | server/makefile | 42 | ||||
| -rw-r--r-- | server/src/main.rs | 22 | ||||
| -rw-r--r-- | server/src/server.rs | 5 | ||||
| -rw-r--r-- | server/tools/src/graph.rs | 3 | ||||
| -rw-r--r-- | server/tools/src/graph_summary.rs | 3 | ||||
| -rw-r--r-- | server/tools/src/main.rs | 15 | ||||
| -rw-r--r-- | server/tools/src/map_linter.rs | 3 | ||||
| -rw-r--r-- | test-client/makefile | 34 |
16 files changed, 112 insertions, 225 deletions
@@ -1071,6 +1071,15 @@ dependencies = [ ] [[package]] +name = "hurrycurry-locale-export" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "serde_json", +] + +[[package]] name = "hurrycurry-protocol" version = "11.0.0" dependencies = [ @@ -1566,15 +1575,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] -name = "localetool" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap", - "serde_json", -] - -[[package]] name = "lock_api" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/client/makefile b/client/makefile deleted file mode 100644 index 281ea431..00000000 --- a/client/makefile +++ /dev/null @@ -1,33 +0,0 @@ -# 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/>. -# -GODOT = godot - -.PHONY: assets clean all -all: .godot/import-finished icons/adaptive-background.png icons/adaptive-foreground.png - -clean: - rm -f menu/book/book_*.webp - rm -f icons/adaptive-foreground.png icons/adaptive-background.png - rm .godot/import-finished - -.godot/import-finished: - if test ! -e $@; then $(GODOT) --headless --import project.godot; fi - touch $@ - -icons/adaptive-background.png: - ffmpeg -f lavfi -i "color=color=#E28142,scale=432x432" -frames:v 1 -y $@ -icons/adaptive-foreground.png: icons/main.png - ffmpeg -f image2 -i $< -vf "scale=280x280,pad=432:432:(ow-iw)/2:(oh-ih)/2:0x00000000" -frames:v 1 -y $@ diff --git a/client/system/settings.gd b/client/system/settings.gd index 70c6b505..12b14857 100644 --- a/client/system/settings.gd +++ b/client/system/settings.gd @@ -137,7 +137,7 @@ static func hook_changed(key: String, slot, callable: Callable): slot.tree_exiting.connect(_unhook_changed.bind(key, slot_id), CONNECT_ONE_SHOT) elif slot is String: slot_id = slot.hash() - else: + else: push_error("hook_changed called with invalid slot") return if not change_hooks.has(key): change_hooks[key] = {} diff --git a/data/makefile b/data/makefile deleted file mode 100644 index 104fc876..00000000 --- a/data/makefile +++ /dev/null @@ -1,37 +0,0 @@ -# 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/>. -# -SETS = default none anticurry -ALL = $(patsubst %,recipes/%.yaml,$(SETS)) -all: $(ALL) -graphs: recipes/default.svg - -JSR = deno run - -recipes/none.yaml: - echo > $@ -recipes/anticurry.yaml: recipes/default.yaml - recipes/anticurry.sed < $< > $@~ && cp $@~ $@ -recipes/default.yaml: recipes/default.js - DENO_NO_UPDATE_CHECK=1 $(JSR) $< > $@~ && cp $@~ $@ - -recipes/%.gv.txt: recipes/%.yaml - { pushd .. >/dev/null; cargo $(CARGOFLAGS) run --release --bin hurrycurry-tools -- graph; popd >/dev/null; } > $@~ && cp $@~ $@ - -recipes/%.svg: recipes/%.gv.txt - dot -Tsvg -Kdot < $< > $@~ && cp $@~ $@ - -clean: - $(RM) $(ALL) @@ -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,$(^)) diff --git a/server/book-export/src/main.rs b/server/book-export/src/main.rs index b57aa04f..9d3cb5dc 100644 --- a/server/book-export/src/main.rs +++ b/server/book-export/src/main.rs @@ -42,8 +42,7 @@ fn main() -> Result<()> { env_logger::init_from_env("LOG"); let args = Args::parse(); - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, serverdata) = index.generate(&args.map)?; let book = book(&data, &serverdata)?; diff --git a/server/data/src/index.rs b/server/data/src/index.rs index a5ec8d97..9a44d202 100644 --- a/server/data/src/index.rs +++ b/server/data/src/index.rs @@ -23,35 +23,34 @@ use std::{ collections::{HashMap, HashSet}, fs::{File, read_to_string}, path::PathBuf, - str::FromStr, - sync::Mutex, }; use crate::{MapDecl, Serverdata, book::book, build_data}; -#[derive(Debug, Deserialize, Default)] +#[derive(Debug, Deserialize)] pub struct DataIndex { + #[serde(skip)] + pub path: PathBuf, pub maps: HashMap<String, MapMetadata>, pub recipes: HashSet<String>, } -pub static DATA_DIR: Mutex<Option<PathBuf>> = Mutex::new(None); -fn data_dir() -> PathBuf { - DATA_DIR - .lock() - .unwrap() - .to_owned() - .unwrap_or_else(|| PathBuf::from_str("data").unwrap()) -} - impl DataIndex { - pub fn load() -> Result<Self> { - let mut s = Self::default(); + pub fn new(path: PathBuf) -> Result<Self> { + let mut s = Self { + path, + maps: HashMap::new(), + recipes: HashSet::new(), + }; s.reload()?; Ok(s) } pub fn reload(&mut self) -> Result<()> { - *self = serde_yml::from_reader(File::open(data_dir().join("index.yaml"))?)?; + let path = self.path.clone(); + *self = serde_yml::from_reader( + File::open(self.path.join("index.yaml")).context("Failed opening data index")?, + )?; + self.path = path; Ok(()) } @@ -60,14 +59,14 @@ impl DataIndex { if name.contains("..") || name.starts_with("/") || name.contains("//") { bail!("illegal map path"); } - let path = data_dir().join(format!("maps/{name}.yaml")); + let path = self.path.join(format!("maps/{name}.yaml")); Ok(read_to_string(path)?) } pub fn read_recipes(&self, name: &str) -> Result<String> { if !self.recipes.contains(name) { bail!("unknown recipes: {name:?}"); } - let path = data_dir().join(format!("recipes/{name}.yaml")); + let path = self.path.join(format!("recipes/{name}.yaml")); Ok(read_to_string(path)?) } pub fn generate(&self, map: &str) -> Result<(Gamedata, Serverdata)> { diff --git a/server/locale-export/Cargo.toml b/server/locale-export/Cargo.toml index 89543937..56067c7a 100644 --- a/server/locale-export/Cargo.toml +++ b/server/locale-export/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "localetool" +name = "hurrycurry-locale-export" version = "0.1.0" edition = "2021" diff --git a/server/makefile b/server/makefile deleted file mode 100644 index bff817db..00000000 --- a/server/makefile +++ /dev/null @@ -1,42 +0,0 @@ -# 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/>. -# - -SERVER = ../target/release/hurrycurry-server -REPLAYTOOL = ../target/release/hurrycurry-replaytool -DISCOVER = ../target/release/hurrycurry-discover -BOT = ../target/release/hurrycurry-bot -EDITOR = ../target/release/hurrycurry-editor - -.PHONY: all clean server replaytool discover bot editor -all: server replaytool discover bot editor -server: $(SERVER) -replaytool: $(REPLAYTOOL) -discover: $(DISCOVER) -bot: $(BOT) -editor: $(EDITOR) -clean: - -$(SERVER): $(shell find protocol src -type f) - cargo $(CARGOFLAGS) build --release -$(REPLAYTOOL): $(shell find protocol replaytool -type f) - { cd replaytool; cargo $(CARGOFLAGS) build --release; } -$(BOT): $(shell find protocol bot client-lib -type f) - { cd bot; cargo $(CARGOFLAGS) build --release; } -$(DISCOVER): $(shell find protocol discover -type f) - { cd discover; cargo $(CARGOFLAGS) build --release; } -$(EDITOR): $(shell find protocol client-lib editor -type f) - { cd editor; cargo $(CARGOFLAGS) build --release; } - diff --git a/server/src/main.rs b/server/src/main.rs index b1265420..7ab19f30 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -18,7 +18,6 @@ use anyhow::{bail, Result}; use clap::Parser; use futures_util::{SinkExt, StreamExt}; -use hurrycurry_data::index::DATA_DIR; use hurrycurry_locale::trm; use hurrycurry_protocol::{PacketC, PacketS}; use hurrycurry_server::{server::Server, ConnectionID}; @@ -92,7 +91,7 @@ fn main() -> Result<()> { info!("Starting Hurry Curry! Server {version} ({distribution})"); - let data_dir = if let Some(d) = args.data_dir.clone() { + let data_path = if let Some(d) = args.data_dir.clone() { d } else { let mut test_order = Vec::new(); @@ -134,22 +133,21 @@ fn main() -> Result<()> { info!("Selected data dir {d:?}"); PathBuf::from_str(d)? }; - *DATA_DIR.lock().unwrap() = Some(data_dir); tokio::runtime::Builder::new_multi_thread() .enable_all() .build()? - .block_on(run(args))?; + .block_on(run(data_path, args))?; Ok(()) } -async fn run(args: Args) -> anyhow::Result<()> { +async fn run(data_path: PathBuf, args: Args) -> anyhow::Result<()> { let ws_listener = TcpListener::bind(args.listen).await?; info!("Listening for websockets on {}", ws_listener.local_addr()?); let (tx, rx) = broadcast::channel::<PacketC>(128 * 1024); - let mut state = Server::new(tx)?; + let mut state = Server::new(data_path, tx)?; state.load(state.index.generate_with_book("lobby")?, None); let state = Arc::new(RwLock::new(state)); @@ -315,14 +313,12 @@ async fn run(args: Args) -> anyhow::Result<()> { #[cfg(test)] mod test { - use hurrycurry_data::index::DATA_DIR; use hurrycurry_protocol::{Character, PacketS, PlayerClass, PlayerID}; use hurrycurry_server::{server::Server, ConnectionID}; use std::future::Future; use tokio::sync::broadcast; fn harness(body: impl Future) { - *DATA_DIR.lock().unwrap() = Some("../data".into()); tokio::runtime::Builder::new_current_thread() .enable_all() .build() @@ -332,26 +328,26 @@ mod test { #[test] fn run() { - harness(async { Server::new(broadcast::channel(1024).0).unwrap() }); + harness(async { Server::new("../data".into(), broadcast::channel(1024).0).unwrap() }); } #[test] fn map_load() { harness(async { - let mut s = Server::new(broadcast::channel(1024).0).unwrap(); + let mut s = Server::new("../data".into(), broadcast::channel(1024).0).unwrap(); s.load(s.index.generate("5star").unwrap(), None); }); } #[test] fn map_load_book() { harness(async { - let mut s = Server::new(broadcast::channel(1024).0).unwrap(); + let mut s = Server::new("../data".into(), broadcast::channel(1024).0).unwrap(); s.load(s.index.generate_with_book("lobby").unwrap(), None); }); } #[test] fn tick() { harness(async { - let mut s = Server::new(broadcast::channel(1024).0).unwrap(); + let mut s = Server::new("../data".into(), broadcast::channel(1024).0).unwrap(); for _ in 0..100 { s.tick(0.1); } @@ -360,7 +356,7 @@ mod test { #[test] fn packet_sender_verif() { harness(async { - let mut s = Server::new(broadcast::channel(1024).0).unwrap(); + let mut s = Server::new("../data".into(), broadcast::channel(1024).0).unwrap(); for (conn, p) in [ PacketS::Effect { diff --git a/server/src/server.rs b/server/src/server.rs index 034fe67a..3f54fe38 100644 --- a/server/src/server.rs +++ b/server/src/server.rs @@ -35,6 +35,7 @@ use log::{info, warn}; use rand::random; use std::{ collections::{HashMap, HashSet, VecDeque}, + path::PathBuf, sync::Arc, time::{Duration, Instant}, }; @@ -333,10 +334,10 @@ impl GameServerExt for Game { } impl Server { - pub fn new(tx: Sender<PacketC>) -> Result<Self> { + pub fn new(data_path: PathBuf, tx: Sender<PacketC>) -> Result<Self> { Ok(Self { game: Game::default(), - index: DataIndex::load().context("Failed to load data index")?, + index: DataIndex::new(data_path).context("Failed to load data index")?, tx, announce_state: AnnounceState::Done, packet_out: VecDeque::new(), diff --git a/server/tools/src/graph.rs b/server/tools/src/graph.rs index a65ffc97..343047da 100644 --- a/server/tools/src/graph.rs +++ b/server/tools/src/graph.rs @@ -20,8 +20,7 @@ use hurrycurry_data::index::DataIndex; use hurrycurry_protocol::{Demand, ItemIndex, Recipe, RecipeIndex}; pub(crate) fn graph() -> Result<()> { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; println!("digraph {{"); diff --git a/server/tools/src/graph_summary.rs b/server/tools/src/graph_summary.rs index bfdcc955..c6db2678 100644 --- a/server/tools/src/graph_summary.rs +++ b/server/tools/src/graph_summary.rs @@ -22,8 +22,7 @@ use hurrycurry_protocol::{ItemIndex, Recipe, TileIndex}; use std::collections::HashSet; pub(crate) fn graph_summary() -> Result<()> { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; println!("digraph {{"); diff --git a/server/tools/src/main.rs b/server/tools/src/main.rs index 07c5d45b..4af6b87f 100644 --- a/server/tools/src/main.rs +++ b/server/tools/src/main.rs @@ -65,8 +65,7 @@ fn main() -> Result<()> { Action::Graph => graph()?, Action::GraphSummary => graph_summary()?, Action::GraphSingle { out, dot_out } => { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, serverdata) = index.generate("5star")?; let out = data.get_item_by_name(&out).unwrap(); let mut diagram = recipe_diagram(&data, &serverdata, &[out])?; @@ -79,24 +78,21 @@ fn main() -> Result<()> { println!("{out}"); } Action::MapDemands { map } => { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, _) = index.generate(&map)?; for demand in &data.demands { println!("{}", data.item_name(demand.input)) } } Action::MapItems { map } => { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, _) = index.generate(&map)?; for name in &data.item_names { println!("{name}") } } Action::MapTiles { map } => { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, _) = index.generate(&map)?; for name in &data.tile_names { println!("{name}") @@ -104,8 +100,7 @@ fn main() -> Result<()> { } Action::CheckMap { map } => { if map == "all" { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; for map in index.maps.keys() { check_map(map)?; } diff --git a/server/tools/src/map_linter.rs b/server/tools/src/map_linter.rs index 678f2930..94b57726 100644 --- a/server/tools/src/map_linter.rs +++ b/server/tools/src/map_linter.rs @@ -146,8 +146,7 @@ static TILE_MODE: LazyLock<HashMap<String, TileMode>> = LazyLock::new(|| { pub fn check_map(map: &str) -> Result<()> { let style = &COLORED; let locale = &*FALLBACK_LOCALE; - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, serverdata) = index.generate(map)?; let mut warnings = Vec::new(); diff --git a/test-client/makefile b/test-client/makefile deleted file mode 100644 index a594a0fc..00000000 --- a/test-client/makefile +++ /dev/null @@ -1,34 +0,0 @@ -# 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/>. -# -.PHONY: all clean -all: main.js locales -locales: $(patsubst ../locale/%.ini,locale/%.json,$(wildcard ../locale/*.ini)) -clean: - $(RM) main.js - $(RM) -r locale - -main.js: main.ts $(wildcard *.ts) - esbuild $< --bundle --outfile=$@ --target=esnext --format=esm - -LT = ../target/release/localetool - -$(LT): $(shell find ../server/locale-export -type f) - { cd ..; cargo $(CARGOFLAGS) build --release --bin localetool; } - -# include ../book/locale/%.ini when it works again -locale/%.json: $(LT) ../locale/%.ini ../locale/en.ini ../book/locale/en.ini - @mkdir -p locale - $(LT) export-json $@ $(wordlist 2,99,$(^)) |