TARGET_DIR ?= target
-USVG_OPTIONS = "--sans-serif-family=DejaVu Sans"
-
WASM_BINDGEN = $(TARGET_DIR)/debug/wasm-bindgen
WASM_BINDGEN_OPTIONS = \
--remove-name-section --remove-producers-section \
LITFILES= LICENCE AGPLv3
TXTFILES= CC-BY-SA-3.0 CC-BY-SA-4.0
-FILEASSETS = $(addprefix templates/, libre shapelib.html script.js \
+NWTEMPLATEASSETS = nwtemplates/die-overlay.tera
+FILEASSETS = $(addprefix templates/, libre shapelib.html script.js \
$(LITFILES) $(TXTFILES)) \
$(wildcard templates/*.tera) \
- nwtemplates/die-overlay.tera
+ $(NWTEMPLATEASSETS)
WASM := wasm32-unknown-unknown
# ^ todo: Is this still right after
# ? But maybe it doesn't matter since we're very conservative and
# only pass JsValue and a few strings across the WASM ABI.
+RUST_NIGHTLY_VERSION ?= +nightly
CARGO = $(CARGO_CMD) $(RUST_VERSION)
#---------- toplevel aggregate targets ----------
$(stamp)
stamp/cargo.%-miri: $(call rsrcs,.)
- $(CARGO) miri test --workspace $(call cr,$*)
+ $(CARGO_CMD) $(RUST_NIGHTLY_VERSION) \
+ miri test --workspace $(call cr,$*)
$(stamp)
stamp/cargo-at.debug: $(call rsrcs,.)
$(stamp)
stamp/cargo.deploy-build: $(call rsrcs,.)
- $(CARGO) build --target $(DEPLOY_ARCH) $(call cr,$(DEPLOY_RELEASE)) -p otter -p otter-cli -p otter-daemon
+ $(CARGO) build --target $(DEPLOY_ARCH) $(call cr,$(DEPLOY_RELEASE)) -p otter -p otter-cli -p otter-daemon -p usvg
$(NAILING_CARGO_JUST_RUN) \
ln -sf otter $(abspath $(TARGET_DIR)/$(DEPLOY_ARCH))/$(DEPLOY_RELEASE)/otter-ssh-proxy
$(stamp)
#---------- svg processing ----------
LIBRARIES ?= $(basename $(wildcard library/*.toml))
-USVG_DEP = stamp/cargo.usvg
+USVG_DEP = stamp/cargo.usvg src/USVG_DEFAULT_ARGS.txt
include $(addsuffix /files.make, $(LIBRARIES))
libraries: $(LIBRARY_FILES)
-templates/shapelib.html: $(TARGET_DIR)/debug/otterlib $(LIBRARY_FILES)
+templates/shapelib.html: $(TARGET_DIR)/debug/otterlib $(LIBRARY_FILES) \
+ $(NWTEMPLATEASSETS)
$(NAILING_CARGO_JUST_RUN) $(abspath $<) \
+ --nwtemplates $(abspath nwtemplates) \
--libs '$(addprefix $(PWD)/, $(addsuffix .toml, $(LIBRARIES)))' \
preview >$@.tmp && mv -f $@.tmp $@
nwtemplates/die-overlay.tera: dice/overlay-template-extractor dice/die.svg
./$< <dice/die.svg >$@.tmp && mv -f $@.tmp $@
+library/edited/die-image-d6-_c.svg: dice/extract-image-only dice/die.svg
+ ./$< <dice/die.svg >$@.tmp && mv -f $@.tmp $@
+
#---------- examples ----------
EXAMPLE_BUNDLE_INPUT_DEPS := $(shell \
perl -p \
-e 'BEGIN { print "# -- AUTOGENERATED FROM COPY IN OTTER SOURCE --\n" }' \
-e 'if (m/^\[scraper]/..0) { unless (m/^\[(?!scraper)/..0) { s/^/\#/ } }' \
- -e 's/(?<=\s)\w\S*(?=\s)/-/ if m/^files = """/..m/^"""/;' \
+ -e 's/(?<=\s)\w\S*(?=\s)/-/ if m/^files = """/..m/^"""|^:/;' \
<$$l.toml >examples/big-bundle/$$l.toml; done
@set -e; echo 'LN for $@'; \
for e in $(LIBRARY_FILE_INPUTS); do \
rsync -r --delete-delay docs/html/. $(PUBLISH_DOC_SPHINX)/.
git branch -f $(PUBLISHED_BRANCH)
+publish-make-current:
+ ssh $(PUBLISH_USER) 'set -e; cd $(PUBLISH_DOC_SPHINX_BASE); rm -f current.tmp; ln -s $(PUBLISH_VERSION) current.tmp; mv -T current.tmp current'
+
#---------- deployment ----------
DEPLOY_USER=ian@login.chiark.greenend.org.uk
for-deploy: stamp/cargo.deploy-build
deploy: for-deploy bundled-sources assets libraries
rsync -zvl --progress $(addprefix $(DEPLOY_TARGET_DIR)/,$(PROGRAMS) otter-ssh-proxy) $(DEPLOY_BASE)/bin/
- rsync -zv --progress $(TARGET_DIR)/release/usvg $(DEPLOY_BASE)/libexec/
+ rsync -zv --progress $(DEPLOY_TARGET_DIR)/usvg $(DEPLOY_BASE)/libexec/
rsync -rv --progress $(TARGET_DIR)/bundled-sources/. $(DEPLOY_BASE)/bundled-sources
rsync -r README.md $(DEPLOY_BASE)/.
rsync -r --delete --exclude=\*~ library specs $(DEPLOY_BASE)/.