PROGRAMS=daemon-otter otter
+WASM_ASSETS := $(addprefix otter_wasm,.js _bg.wasm)
+WASM_OUTPUTS := $(addprefix otter_wasm,.d.ts)
+
+TS_SRCS= script
+TS_SRC_FILES= \
+ $(addprefix templates/,$(addsuffix .ts,$(TS_SRCS))) \
+ webassembly-types/webassembly.d.ts \
+ templates/otter_wasm.ns.d.ts
+
+LITFILES= LICENCE AGPLv3
+TXTFILES= CC-BY-SA-3.0 CC-BY-SA-4.0
+
FILEASSETS = $(addprefix templates/,$(LITFILES) $(TXTFILES))
WASM := wasm32-unknown-unknown
doc: cargo-doc
-debug release:: %: stamp/cargo.% assets extra-%
+debug release:: %: stamp/cargo.% assets libraries extra-%
cargo: cargo-debug cargo-wasm-release
wasm-pack: stamp/wasm-pack
-assets: js libraries stamp/wasm-pack $(FILEASSETS)
+assets: js stamp/wasm-pack $(FILEASSETS)
+ : $(FILEASSETS) , $^
js: templates/script.js
#---------- wasm ----------
-WASM_ASSETS := $(addprefix otter_wasm,.js _bg.wasm)
-WASM_OUTPUTS := $(addprefix otter_wasm,.d.ts)
-
$(addprefix $(WASM_PACKED)/,$(WASM_ASSETS) $(WASM_OUTPUTS)): stamp/wasm-pack
stamp/wasm-pack: stamp/cargo.wasm-release
$(WASM_PACK_CMD) $(WASM_PACK_OPTIONS) build \
#---------- typescript ----------
-TS_SRCS= script
-TS_SRC_FILES= \
- $(addprefix templates/,$(addsuffix .ts,$(TS_SRCS))) \
- webassembly-types/webassembly.d.ts \
- templates/otter_wasm.ns.d.ts
-
-LITFILES= LICENCE AGPLv3
-TXTFILES= CC-BY-SA-3.0 CC-BY-SA-4.0
-
templates/%.js: tsc-wrap tsconfig.json
./tsc-wrap $@ tsconfig.json $(filter %.ts,$^)
#---------- other templates ----------
-$(addprefix templates/,$(LITFILES)): templates/%: %;
+$(addprefix templates/,$(LITFILES)): templates/%: %
cp $< $@.new && mv -f $@.new $@
$(addprefix templates/,$(TXTFILES)): templates/%: %.txt
DEPLOY_BASE=ian@login.chiark.greenend.org.uk:/volatile/Otter
-deploy: stamp/cargo.deploy-build bundled-sources
+deploy: stamp/cargo.deploy-build bundled-sources assets libraries
rsync -zv --progress $(addprefix $(DEPLOY_TARGET_DIR)/,$(PROGRAMS)) $(DEPLOY_BASE)/bin/
rsync -rv --progress $(TARGET_DIR)/bundled-sources/. $(DEPLOY_BASE)/bundled-sources
+ rsync -rv --progress README.md $(DEPLOY_BASE)/.
+ rsync -rv --progress --delete --exclude=\*~ library/. $(DEPLOY_BASE)/library/.
+ rsync -rv --progress $(FILEASSETS) $(addprefix $(WASM_PACKED)/, $(WASM_ASSETS)) \
+ $(DEPLOY_BASE)/assets/
+
+#$(DEPLOY_BASE)/bundled-sources
#---------- clean ----------
Right now Otter is in an alpha state.
+BUILDING
+========
+
+Otter is not so easy to build. You will want to start with the git
+branch
+ https://salsa.debian.org/iwj/otter
+
+You cannot build it just with `cargo`, you must use `make`.
+
+You will also need various other utilities and dependencies - in some
+cases, un-released dependencies or locally patched versions. See
+`Cargo.nail` and `Makefile`. On my own laptop deployment is done with
+`make deploy` which copies all the relevant sources into the
+`bundled-sources` directory, which is accessible via the Otter web UI.
const RESOURCES : &[(&'static str, ResourceLocation, ContentType)] = &[
("script.js", RL::Main, ContentType::JavaScript),
- ("style.css", RL::Main, ContentType::JavaScript),
("LICENCE", RL::Main, ContentType::Plain),
("libre", RL::Main, ContentType::HTML),
("AGPLv3", RL::Main, ContentType::Plain),