ESFLAGS = --target=esnext --format=esm deploy-dir: deploy deploy/bundle.js deploy/style.css deploy/index.html deploy/fastbangs deploy/fastbangs.yaml .PHONY: watch-script watch-style clean deploy-dir watch-script: frontend/fuzzysort.js esbuild frontend/main.ts --bundle --outfile=deploy/bundle.js $(ESFLAGS) --watch watch-style: while true; do make deploy/style.css; inotifywait -e modify -e move frontend/style.sass; done clean: stack clean --full rm -f deploy/{bundle.js,index.html,fastbangs,style.css} rm -f deploy.zip rm -f frontend/fuzzysort.js # This leaves the deploy directory, which is intentional, as it may contain # user data deploy.zip: deploy-dir zip deploy.zip -r deploy deploy: mkdir -p deploy deploy/index.html: frontend/index.html cp $< $@ deploy/fastbangs.yaml: fastbangs.yaml cp --no-clobber $< $@; true deploy/fastbangs: $(shell find src -name '*.hs') stack install --local-bin-path deploy deploy/bundle.js: $(shell find frontend -name '*.ts') frontend/fuzzysort.js esbuild frontend/main.ts --bundle --outfile=deploy/bundle.js $(ESFLAGS) deploy/style.css: frontend/style.sass sassc $< $@ frontend/fuzzysort.js: curl -s 'https://cdn.jsdelivr.net/npm/fuzzysort@2.0.4/fuzzysort.min.js' -o $@