This repository has been archived by the owner on Dec 24, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
58 lines (46 loc) · 1.53 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
57
58
HTMLFILES=$(wildcard src/*.html)
IMGFILES=$(wildcard src/images/*)
SLICKFILES=$(wildcard src/slick/slick/*)
FAVICONFILES=$(wildcard src/favicon_resources/*)
BUILTHTMLFILES=$(patsubst src/%.html,public/%.html,$(HTMLFILES))
BUILTIMGFILES=$(patsubst src/images/%,public/images/%,$(IMGFILES))
BUILTSLICKFILES=$(patsubst src/slick/slick/%,public/slick/%,$(SLICKFILES))
BUILTFAVICONFILES=$(patsubst src/favicon_resources/%,public/%,$(FAVICONFILES))
all: $(BUILTHTMLFILES) $(BUILTIMGFILES) $(BUILTSLICKFILES) $(BUILTFAVICONFILES) public/styles.css public/script.js
public:
mkdir -p public
public/images: | public
mkdir -p public/images
public/slick: | public
mkdir -p public/slick
public/%.html: src/%.html | public
html-minifier \
--collapse-boolean-attributes \
--collapse-whitespace \
--decode-entities \
--minify-css \
--minify-js \
--remove-attribute-quotes \
--remove-comments \
--remove-empty-attributes \
--remove-optional-tags \
--remove-redundant-attributes \
--remove-script-type-attributes \
--remove-style-link-type-attributes \
--remove-tag-whitespace \
--sort-attributes \
--sort-class-name \
-o $@ $<
public/styles.css: src/styles.scss | public
sass src/styles.scss public/styles.css
public/script.js: src/script.js | public
uglifyjs $< > $@
public/slick/%: src/slick/slick/% | public/slick
cp -r $< $@
public/images/%: src/images/% | public/images
cp -r $< $@
public/%: src/favicon_resources/% | public
cp $< $@
clean:
rm -rf public
.PHONY: all clean