-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
40 lines (30 loc) · 1013 Bytes
/
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
VERSION = 1.4.4
OBJ = src/js/CronPixie.js
SRC = src/elm/CronPixie.elm
SLUG = wp-cron-pixie
ZIP = builds/$(SLUG)-$(VERSION).zip
PLUGIN_BUILD = "https://raw.githubusercontent.com/deliciousbrains/wp-plugin-build/94b5c3ff47cbded11386f8aeaca749a6248010be/plugin-build"
ELM ?= elm
ELMFMT ?= elm-format
$(OBJ): $(SRC)
$(ELMFMT) src/elm/ --yes
$(ELM) make $(SRC) --output=$(OBJ)
.PHONY: zip prod publish clean
zip: $(ZIP)
$(ZIP): builds/plugin-build $(OBJ)
cd ./build-cfg/$(SLUG) && ../../builds/plugin-build $(VERSION)
builds/plugin-build: | builds
curl -sSL $(PLUGIN_BUILD) -o "builds/plugin-build"
chmod +x "builds/plugin-build"
builds:
mkdir "builds"
prod:
$(ELMFMT) src/elm/ --yes
$(ELM) make $(SRC) --output=$(OBJ) --optimize
publish: builds/plugin-build prod
cd ./build-cfg/$(SLUG) && ../../builds/plugin-build $(VERSION) -p
clean:
# Deliverables and artefacts.
rm -rf ./builds ./elm-stuff $(OBJ)
# Legacy deliverables and artefacts.
rm -rf ./node_modules ./npm-debug.log* ./src/js/build.js