-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
55 lines (39 loc) · 1.17 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
#
# Source
# ------
BUILD := manifest.json images/* build/mixcloud-tracklist.js
SOURCE := manifest.json images/* templates/*.dust tracklist.js
# Executable path
# ---------------
PATH_BIN = ./node_modules/.bin
# Make all
# --------
all: js xpi zip userscript
.PHONY: clean
clean:
@rm -rf build templates/*.js
# Build aliases
# -------------
.PHONY: js
js: build/mixcloud-tracklist.js
.PHONY: xpi
xpi: build/mixcloud-tracklist.xpi
.PHONY: zip
zip: build/mixcloud-tracklist.zip
.PHONY: userscript
userscript: build/mixcloud-tracklist.user.js
# Build targets
# -------------
build:
@mkdir -p build
build/mixcloud-tracklist.js: build $(SOURCE)
@$(PATH_BIN)/dustc templates/**/*.dust -s --cjs
@$(PATH_BIN)/browserify tracklist.js -t babelify -o build/mixcloud-tracklist.js
build/mixcloud-tracklist.xpi: build js $(SOURCE)
@zip build/mixcloud-tracklist.xpi $(BUILD)
build/mixcloud-tracklist.zip: build js $(SOURCE)
@zip build/mixcloud-tracklist.zip $(BUILD)
build/mixcloud-tracklist.user.js: build js $(SOURCE)
@cat userscript.txt > build/mixcloud-tracklist.user.js
@echo '' >> build/mixcloud-tracklist.user.js
@cat build/mixcloud-tracklist.js >> build/mixcloud-tracklist.user.js