From 6a8db4f731d236cc53860bfc41b34f9953a8ddf3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 10 Oct 2020 23:10:16 +0100 Subject: [PATCH] Fix bundle sources Signed-off-by: Ian Jackson --- Makefile | 19 ++++++++++++++----- src/bin/daemon-otter.rs | 4 ++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 94188124..aaddbfc3 100644 --- a/Makefile +++ b/Makefile @@ -43,8 +43,9 @@ CARGO = $(NAILING_CARGO) BUILD_SUBDIR ?= ../Build TARGET_DIR = $(BUILD_SUBDIR)/$(notdir $(PWD))/target +NAILING_CARGO_JUST_RUN ?= $(NAILING_CARGO) --just-run -q --- BUNDLE_SOURCES_CMD ?= $(NAILING_CARGO) --- $(BUNDLE_SOURCES) -USVG_CMD ?= $(NAILING_CARGO) --just-run -q --- $(USVG) +USVG_CMD ?= $(NAILING_CARGO_JUST_RUN) $(USVG) WASM_PACK_CMD ?= $(NAILING_CARGO) --linkfarm=git --- $(WASM_PACK) endif # Cargo.nail @@ -64,6 +65,7 @@ $(shell echo >&2 'Makefile: lp: Using program $4 from $(BUILD_SUBDIR)/$2') $1 := $(abspath $(BUILD_SUBDIR)/$2/target/$3/$4) $(abspath $(BUILD_SUBDIR)/$2/target/$3/$4):; cd ../$2 && $$(CARGO) build $(call cr,$3) ) +bundled-sources:: bundled-sources/$2 endef $(eval $(call lp,BUNDLE_SOURCES,bundle-sources,debug,bundle-rust-sources)) @@ -144,11 +146,18 @@ stamp/wasm-pack: stamp/cargo.wasm-release #---------- bundle-sources ---------- -bundled-sources: $(TARGET_DIR)/bundled-sources -$(TARGET_DIR)/bundled-sources: $(BUNDLE_SOURCES) - $(BUNDLE_SOURCES_CMD) --output $(abspath $@) +bundled-sources:: bundled-sources/otter + +bundled-sources/%: $(BUNDLE_SOURCES) + set -e; d=$(abspath $(TARGET_DIR)/bundled-sources); \ + $(NAILING_CARGO_JUST_RUN) mkdir -p $$d; \ + $(if $(filter-out otter,$*), cd ../$*;) \ + $(BUNDLE_SOURCES_CMD) --output $$d/$* + +.PHONY: bundled-sources/% + +bundled-sources:: @echo Bundled sources. -.PHONY: bundle-sources $(TARGET_DIR)/bundled-sources #---------- svg processing ---------- diff --git a/src/bin/daemon-otter.rs b/src/bin/daemon-otter.rs index 6d3c91ab..3df9167e 100644 --- a/src/bin/daemon-otter.rs +++ b/src/bin/daemon-otter.rs @@ -112,9 +112,9 @@ fn main() { flexi_logger::Logger::with(c.log.clone()).start()?; let bundled_sources = &c.bundled_sources; - fs::metadata(format!("{}/index.html", bundled_sources)) + fs::metadata(format!("{}/", bundled_sources)) .with_context(||bundled_sources.clone()) - .context("check bundled-sources directory's index.html")?; + .context("check bundled-sources directory")?; shapelib::load()?; -- 2.30.2