-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (47 loc) · 1.12 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
52
53
54
55
56
BABEL ?= node_modules/.bin/babel
UGLIFY ?= node_modules/.bin/uglifyjs
HTML_MINIFIER ?= node_modules/.bin/html-minifier
.PHONY: build
build: www/
build: www/index.php
build: www/ovingsspeilet.js
build: www/ovingsspeilet.html
www/:
test -d $@ || mkdir $@
www/index.php: ovingsspeilet.php
cp $< $@
www/ovingsspeilet.js: ovingsspeilet.js
$(BABEL) \
$< \
--presets es2015 \
| $(UGLIFY) \
--screw-ie8 \
--mangle \
--compress \
> $@
www/ovingsspeilet.html: ovingsspeilet.html
$(HTML_MINIFIER) \
--collapse-boolean-attributes \
--collapse-inline-tag-whitespace \
--collapse-whitespace \
--conservative-collapse \
--html5 \
--minify-css true \
--remove-attribute-quotes \
--remove-comments \
--remove-empty-attributes \
--remove-optional-tags \
--remove-script-type-attributes \
--remove-style-link-type-attributes \
--remove-tag-whitespace \
--use-short-doctype \
$< \
> $@
.PHONY: server
server: build
php -S 0.0.0.0:1337 -t www
.PHONY: publish
publish: build
scp \
{www/index.php,www/ovingsspeilet.html,www/ovingsspeilet.js} \
cirkus.samfundet.no:/var/www/samfundet.no/laafte/ovingsspeilet/ \