-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (35 loc) · 1.51 KB
/
Makefile
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
40
41
42
43
44
45
46
47
48
SHELL := bash -euo pipefail
build := build
.DELETE_ON_ERROR:
all: $(build)/pathogen-workflows.html $(build)/index.html $(build)/favicon-success.svg $(build)/favicon-failure.svg $(build)/favicon-question.svg
$(build)/pathogen-workflows.html: $(build)/pathogen-workflows.json $(build)/pathogen-workflows.css $(build)/pathogen-workflows.js $(build)/luxon.min.js pathogen-workflows.html.js | $(build) node_modules
./pathogen-workflows.html.js < $< > $@
$(build)/pathogen-workflows.json: $(build)/%.json: %.sql | $(build)
./steampipe-psql --quiet --no-psqlrc --no-align --tuples-only --set=ON_ERROR_STOP= < $< > $@
favicon-%.svg: favicon.svg favicon-[layer].svg.py
@# Strip Inkscape-specific elements/attributes.
@# Remove layers other than the base layer and requested layer.
< $< \
inkscape --pipe --export-plain-svg --export-area-page --export-filename - \
| ./favicon-'[layer]'.svg.py $* \
> $@
copied := \
$(build)/pathogen-workflows.css \
$(build)/pathogen-workflows.js \
$(build)/index.html \
$(build)/favicon-success.svg \
$(build)/favicon-failure.svg \
$(build)/favicon-question.svg
$(copied): $(build)/%: % | $(build)
cp $< $@
$(build)/luxon.min.js: node_modules/luxon/build/global/luxon.min.js | $(build)
cp $< $@
node_modules/%: | node_modules
@# Try to repair partial node_modules/.
[[ -e $@ ]] || npm ci
node_modules:
npm ci
$(build):
mkdir -p $(build)
download: | $(build)
curl -fsSL --proto '=https' https://nextstrain.github.io/status/pathogen-workflows.json > $(build)/pathogen-workflows.json