summaryrefslogtreecommitdiff
path: root/fig-frontend-client/Makefile
blob: 1f01f50478e0345c7164ab56d21c6bb6dff17edf (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
36
37
38
39
.PHONY: all deploy extension clean

all: dist/test/index.html dist/test/assets dist/test/main.js dist/test/main.css

deploy: dist/deploy/index.html dist/deploy/assets dist/deploy/main.js dist/deploy/main.css
	rsync -av dist/deploy/ "pub.colonq.computer:~/public_html/"

dist:
	mkdir -p dist/test
	mkdir -p dist/deploy

main.js: $(shell find src)
	purs-nix bundle

dist/%/assets: $(shell find assets) dist
	rm -rf $@
	mkdir -p $@
	cp -r assets/* $@

dist/%/main.js: main.js dist
	cp $< $@

dist/%/main.css: main.css dist
	cp $< $@

dist/%/index.html: config-%.m4 dist index-template.html
	sh -c "m4 $< >$@"

extension: dist/extension/assets dist/extension/manifest.json dist/extension/background.js dist/extension/main.js dist/extension/main.css

dist/extension/manifest.json: extension/manifest.dhall
	dhall-to-json <$< >$@

dist/extension/%: extension/%
	cp $< $@

clean:
	rm main.js
	rm -r dist/