-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
63 lines (48 loc) · 1.23 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
PHP_SRC := better-search-replace.php $(wildcard includes/*.php)
POT_OBJ := languages/better-search-replace.pot
CSS_DIR := assets/css
CSS_ALL := $(wildcard $(CSS_DIR)/*.css)
CSS_SRC := $(filter-out %.min.css,$(CSS_ALL))
CSS_OBJ := $(CSS_SRC:.css=.min.css)
JS_DIR := assets/js
JS_ALL := $(wildcard $(JS_DIR)/*.js)
JS_SRC := $(filter-out %.min.js,$(JS_ALL))
JS_OBJ := $(JS_SRC:.js=.min.js)
JS_MAP := $(JS_SRC:.js=.min.js.map)
.PHONY: all
all: build-translations build-css uglify
.PHONY: build-translations
build-translations: $(POT_OBJ)
$(POT_OBJ): $(PHP_SRC) | node_modules
grunt makepot
.PHONY: build-css
build-css: $(CSS_OBJ)
$(CSS_OBJ): %.min.css: %.css | node_modules
grunt cssmin
.PHONY: uglify
uglify: $(JS_OBJ)
$(JS_OBJ): %.min.js: %.js | node_modules
grunt uglify
.PHONY: zip
zip: all
./build-cfg/build-plugin.sh
.PHONY: package
package: zip
.PHONY: install
install: node_modules
node_modules: package.json
yarn install
.PHONY: update-deps
update-deps:
yarn upgrade
.PHONY: product-info
product-info:
php build-cfg/utils/create-json.php README.txt better-search-replace.php > builds/info.json
.PHONY: clean
clean:
rm -rf builds
rm -f $(CSS_OBJ)
rm -f $(JS_OBJ) $(JS_MAP)
.PHONY: clean-all
clean-all: clean
rm -rf node_modules