aboutsummaryrefslogtreecommitdiff
path: root/static/Makefile
blob: 0c6023b0067b284726ea67a89b1d336284ac824e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.PHONY: all install clean watch

TARGETS := style.css smallcal.css script.out.js directory-listing.css
WATCH=

TS_FILES = $(shell find . -type f -name \*.ts -not -path */node_modules/*)
JS_FILES = $(TS_FILES:%.ts=%.js)

export PATH := $(shell npm bin):$(PATH)

all: $(TARGETS)

%.map.json: %.out.js
	tail -n1 $< | tail -c+65 | base64 --decode | jq '.' > $@

# r!browserify --list script.ts -p tsify | xargs -L1 basename | tac
# script explicitly named, since that is our entry point
script.out.js: script.ts $(TS_FILES)
	browserify $< -p tsify --noImplicitAny --debug -o $@

deps.svg: $(TS_FILES)
	madge --image $@ $^

watch:
	./make-watch

install: all
	install -d $(DESTDIR)/usr/share/calp/www
	install -m644 -t $(DESTDIR)/usr/share/calp/www/ $(TARGETS)

clean:
	-rm $(TARGETS)

%.css: %.scss
	scss $(WATCH) -I. $< $@