CARGO ?= cargo
TARGET_DIR ?= target
-USVG ?= usvg
USVG_OPTIONS = "--sans-serif-family=DejaVu Sans"
WASM_BINDGEN = $(TARGET_DIR)/debug/wasm-bindgen
#---------- local programs ----------
define lp
-$(if $(wildcard $(BUILD_SUBDIR)/$2),
-$(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_DIRS += $2
-BUNDLED_SOURCES_LINKS += $2/
-)
+stamp/cargo.$2: $(call rsrcs, ! -name \*.rs)
+ $$(CARGO) build $(call cr,$3) -p $2
+ $$(stamp)
+$1 := $(abspath $(TARGET_DIR)/$3/$4)
endef
$(eval $(call lp,BUNDLE_SOURCES,bundle-sources,debug,bundle-rust-sources))
-$(eval $(call lp,USVG,resvg,release,usvg))
+$(eval $(call lp,USVG,usvg,release,usvg))
#---------- variables defining bits of source etc. ----------
TARGET_BUNDLED=$(TARGET_DIR)/bundled-sources
$(addprefix bundled-sources/, $(BUNDLED_SOURCES_DIRS)): \
-bundled-sources/%: $(wildcard $(BUNDLE_SOURCES))
+bundled-sources/%: stamp/cargo.bundle-sources
set -e; d=$(abspath $(TARGET_BUNDLED)); \
$(NAILING_CARGO_JUST_RUN) mkdir -p $$d; \
$(if $(filter-out otter,$*), cd ../$*;) \
#---------- svg processing ----------
LIBRARIES ?= $(basename $(wildcard library/*.toml))
+USVG_DEP = stamp/cargo.usvg
include $(addsuffix /files.make, $(LIBRARIES))
USVG_PROCESSOR = usvg-processor
LIBRARY_PROCESS_SVG = ./$(USVG_PROCESSOR) $@ $(wordlist 1,2,$^) '$(USVG_CMD) $(USVG_OPTIONS)'
-$(LIBRARY_FILES): $(USVG_PROCESSOR) $(USVG_BINARY) $(MAKEFILE_DEP)
+$(LIBRARY_FILES): $(USVG_PROCESSOR) $(USVG_DEP) $(MAKEFILE_DEP)
# actual command for each of $(LIBRARY_FILES) is in one of the files.make
rustup default nightly-2021-04-13
-4. Install the ``usvg`` SVG launderer, which we need for shape libraries::
-
- cargo install usvg
-
- This will put it in ``~/.cargo/bin``, which you presumably have on
- your ``PATH`` (or the above ``rustup`` and ``cargo`` runes wouldn't work).
-
-
**If you just want to edit and preview the shape libraries (ie the piece shapes) you can stop here.**
-5. Install some more build tools::
-
- cargo install bundle-sources
-
-6. Install the webdriver binary from Mozilla. Visit
+4. Install the webdriver binary from Mozilla. Visit
https://github.com/mozilla/geckodriver/releases/tag/v0.28.0
* Rustup (the Rust downloader/installer) - this is pretty safe
* Rust itself - again, pretty safe
* Otter itself - well, I wrote this; up to you.
- * 450 transitive dependencies of otter (from crates.io)
- * 50 transitive dependencies of bundle-sources
- * the transitive dependencies of resvg
+ * 475 transitive dependencies of otter (from crates.io)
* a geckodriver binary directly from mozilla
You will have trusted the integrity of the following:
and WASM and resvg and so on, there is not that much to be gained
by trying to prune the dependencies of the otter package itself.
-bundle-rust-sources
-```````````````````
-
-This is mine, but it needs to be properly released.
-
geckodriver (for the automated in-browser tests)
````````````````````````````````````````````````