-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (35 loc) · 1.64 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
49
50
51
#COMPILE_TEMPLATE_OPTS = -d
FRONT_TEMPLATES = $(wildcard frontend/templates/*.html frontend/templates/ng-templates/*.html)
STATIC_TEMPLATES = $(subst frontend,static,$(FRONT_TEMPLATES))
JAVASCRIPT_FILES = $(wildcard frontend/src/js/app.module.js frontend/src/js/*.js)
JAVASCRIPT_VENDOR = frontend/node_modules/angular-clipboard/angular-clipboard.js
.PHONY: all templates clean static dist javascript css eslint eslint-fix
all: static
static: templates javascript css
rsync -rupE frontend/assets/ static/
dist: static
tar cjf static.tar.bz2 static/
clean:
rm -rf static
eslint:
frontend/node_modules/.bin/eslint frontend/src/js
eslint-fix:
frontend/node_modules/.bin/eslint --fix frontend/src/js
templates: $(STATIC_TEMPLATES)
javascript: static/js/app.js static/js/vendor.js
css: static/css/main.css
static/css/main.css: frontend/src/css/main.scss
mkdir -p $$( dirname $@ )
frontend/node_modules/.bin/sass $< > $@
static/js/vendor.js: $(JAVASCRIPT_VENDOR)
mkdir -p $$( dirname $@ )
cat $^ >$@
static/js/app.js: $(JAVASCRIPT_FILES)
mkdir -p $$( dirname $@ )
sed "s/SED_MAKEFILE_CACHE_VERSION/$$(date +%Y%m%d%H%M%S.%N)/g" $^ >$@
static/templates/ng-templates/browser%.html: frontend/templates/ng-templates/browser%.html $(wildcard frontend/templates/ng-templates/*.jj2)
mkdir -p $$( dirname $@ ) 2>/dev/null || true
python3 scripts/compile_template.py ${COMPILE_TEMPLATE_OPTS} -b frontend/templates -s $< >$@
static/templates/%.html: frontend/templates/%.html frontend/templates/ng-templates/dataset-base.jj2
mkdir -p $$( dirname $@ ) 2>/dev/null || true
python3 scripts/compile_template.py ${COMPILE_TEMPLATE_OPTS} -b frontend/templates -s $< >$@