-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (23 loc) · 941 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
ZIP_NAME ?= "CustomL10n.zip"
PLUGIN_NAME = custom-l10n
COFFEE_FILES = \
custom-l10n.coffee
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
all: build zip ## build and zip
build: clean ## build plugin
mkdir -p build
mkdir -p build/$(PLUGIN_NAME)
mkdir -p build/$(PLUGIN_NAME)/webfrontend
mkdir -p build/$(PLUGIN_NAME)/l10n
mkdir -p src/tmp # build code from coffee
cp src/webfrontend/*.coffee src/tmp
cd src/tmp && coffee -b --compile ${COFFEE_FILES} # bare-parameter is obligatory!
cat src/tmp/*.js > build/$(PLUGIN_NAME)/webfrontend/custom-l10n.js
rm -rf src/tmp # clean tmp
cp l10n/custom-l10n.csv build/$(PLUGIN_NAME)/l10n/custom-l10n.csv
cp manifest.master.yml build/$(PLUGIN_NAME)/manifest.yml # copy manifest
clean: ## clean
rm -rf build
zip: build ## zip file
cd build && zip ${ZIP_NAME} -r $(PLUGIN_NAME)/