From 7949fcdc683d07689bad5da5d20bfa3eeb5a6a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 5 Sep 2023 01:25:00 +0200 Subject: Move frontend code to subdirectories, to simplify command line flags. --- static/Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'static/Makefile') 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 -- cgit v1.2.3