-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (65 loc) · 1.6 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Build
build:
rm -rf ./out/
mkdir -p ./out/
make assets
make scripts-debug
make templates
make stylesheets
build-release:
rm -rf ./out/
mkdir -p ./out/
make assets
make scripts
make templates
make stylesheets
release:
rm -rf ./docs
make setup
make build-release
mv ./out ./docs
# Stylesheets
STYLESHEETS_VENDOR += ./node_modules/reset-css/reset.css
STYLESHEETS += ./src/rhea.styl
STYLESHEETS_OUTPUT = ./out/bundle.css
STYLUS = ./node_modules/stylus/bin/stylus
STYLUS_PARAMS += --compress
STYLUS_PARAMS += --print >> $(STYLESHEETS_OUTPUT)
stylesheets:
cat $(STYLESHEETS_VENDOR) > $(STYLESHEETS_OUTPUT)
$(STYLUS) $(STYLESHEETS) $(STYLUS_PARAMS)
TEMPLATES += ./src/index.pug
TEMPLATES_OUTPUT = ./out
PUG_CLI = ./node_modules/pug-cli/index.js
PUG_CLI_PARAMS += --obj ./package.json
PUG_CLI_PARAMS += --out ./out
templates:
$(PUG_CLI) $(TEMPLATES) $(PUG_CLI_PARAMS)
# Javascript
SCRIPTS += ./src/rhea.js
SCRIPTS += $(shell find ./src/features -iname "*.js" -not -iname "*.test.js")
SCRIPTS_OUTPUT = ./out/bundle.js
TERSER = ./node_modules/terser/bin/terser
TERSER_PARAMS += --compress
TERSER_PARAMS += --mangle
TERSER_PARAMS += --
scripts:
$(TERSER) $(TERSER_PARAMS) $(SCRIPTS) > $(SCRIPTS_OUTPUT)
scripts-debug:
cat $(SCRIPTS) > $(SCRIPTS_OUTPUT)
# Assets
ASSETS += ./src/assets
assets: $(ASSETS)
cp -R $(ASSETS) ./out/assets
# Utilities
serve:
node ./index.js
setup:
make clean
npm install
cd ./DATA/ && make systems
#cd ./DATA/ && make items
clean:
rm -rf ./out/
rm -rf ./node_modules/
cd ./DATA/ && make clean