-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
45 lines (32 loc) · 1.38 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
CSS_VAR_PREFIX="x"
PKG="business"
default: build
check-for-grunt:
@if [ ! -f /usr/local/bin/grunt ]; then echo -e "\nGrunt CLI is not installed. Install it with sudo npm install -g grunt\n"; exit 1; fi
deps: check-for-grunt
@npm install
clean: clean-vars
@rm -Rf build vars-build.*
@rm -f style.css editor.css rtl.css css/blocks.css
clean-vars:
@rm -f *-vars.scss *-vars.css css/*-vars.scss css/*-vars.css
build: clean check-for-grunt
@grunt build
dev: clean check-for-grunt
@grunt build && grunt watch
css-vars: clean
@node tools/sass-variables.js --prefix=${CSS_VAR_PREFIX} style.scss --output style-css-vars.scss
@node tools/sass-variables.js --prefix=${CSS_VAR_PREFIX} --root-selector="body" --ignore "css/blocks.scss" editor.scss --output editor-css-vars.scss
@node tools/sass-variables.js --prefix=${CSS_VAR_PREFIX} --skip-root css/blocks.scss --output css/blocks-css-vars.scss
@echo && grunt build && echo
@make clean-vars
rtl:
@npm run build:rtl
theme: clean
@echo "* Initializing build"; mkdir -p build; echo
@echo "* Building assets"; make css-vars
@echo "* Generating RTL styles"; make rtl; echo
@echo "* Copying assets"; rsync -a . build/ --exclude-from=excludes.rsync
@echo "* Integrity check"; node tools/buildtool.js --check --path build/
@echo "* Zipping"; mv build ${PKG}; mkdir build; zip -mqr build/${PKG}.zip ${PKG}; cd build/; unzip -qq ${PKG}.zip
.PHONY: build