diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-05 01:25:00 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-05 01:25:00 +0200 |
commit | 7949fcdc683d07689bad5da5d20bfa3eeb5a6a46 (patch) | |
tree | c1bc39dc0e508ee498cf7119f888f513db4bab8f /static/Makefile | |
parent | Add build step for jsdoc. (diff) | |
download | calp-7949fcdc683d07689bad5da5d20bfa3eeb5a6a46.tar.gz calp-7949fcdc683d07689bad5da5d20bfa3eeb5a6a46.tar.xz |
Move frontend code to subdirectories, to simplify command line flags.
Diffstat (limited to '')
-rw-r--r-- | static/Makefile | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/static/Makefile b/static/Makefile index 07c72b2f..17432585 100644 --- a/static/Makefile +++ b/static/Makefile @@ -1,17 +1,18 @@ .PHONY: all install clean watch watch-esbuild doc -TARGETS := style.css smallcal.css script.js directory-listing.css +_TARGETS := style.css smallcal.css script.js directory-listing.css +TARGETS = $(addprefix out/,$(_TARGETS)) WATCH= -TS_FILES = $(shell find . -type f -name \*.ts -not -path */node_modules/*) -JS_FILES = $(TS_FILES:%.ts=%.js) +TS_FILES = $(shell find ts -type f -name \*.ts) +JS_FILES = $(TS_FILES:ts/%.ts=out/%.js) ESBUILD_LOGLEVEL=warning # Variable for adding extra flags ESBUILD_FLAGS = # Used flags __ESBUILD_FLAGS = --log-level=$(ESBUILD_LOGLEVEL) \ - --sourcemap --bundle --outdir=$(CURDIR) \ + --sourcemap --bundle --outdir=$(CURDIR)/out \ $(ESBUILD_FLAGS) export PATH := $(shell npm bin):$(PATH) @@ -19,11 +20,11 @@ export PATH := $(shell npm bin):$(PATH) all: $(TARGETS) # script explicitly named, since that is our entry point -script.js: script.ts $(TS_FILES) +out/script.js: ts/script.ts $(TS_FILES) esbuild $< $(__ESBUILD_FLAGS) watch-esbuild: - $(MAKE) ESBUILD_FLAGS+='--watch' ESBUILD_LOGLEVEL=info -B script.js + $(MAKE) ESBUILD_FLAGS+='--watch' ESBUILD_LOGLEVEL=info -B out/script.js deps.svg: $(TS_FILES) madge --image $@ $^ @@ -38,8 +39,8 @@ install: all clean: -rm $(TARGETS) -%.css: %.scss +out/%.css: scss/%.scss scss -E UTF-8 $(WATCH) -I. $< $@ doc: - typedoc --logLevel Verbose --excludeExternals --entryPointStrategy expand . + typedoc --logLevel Verbose --excludeExternals |