forked from MarcelRaschke/soundcloud-javascript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
70 lines (52 loc) · 1.61 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
64
65
66
67
68
69
70
OS := $(shell uname)
BUILD_DIR := $(PWD)/build
DESTDIR := $(BUILD_DIR)/system/$(OS)
DESTBIN := $(DESTDIR)/bin
NM_BIN := $(PWD)/node_modules/.bin
DEP := vendor
NODE_VERSION := 6.11.1
NODE := nodejs-$(NODE_VERSION)
NPM_BIN := $(DESTBIN)/npm
export PATH := $(DESTBIN):$(NM_BIN):$(PATH)
.PHONY: setup build sc-vendor-libs test run publish dirs clean
node_modules: $(NPM_BIN) package.json
$(NPM_BIN) install
@touch $@
setup: $(NPM_BIN)
build: node_modules
$(NPM_BIN) run build
test: build
$(NPM_BIN) run test
run: build
$(NPM_BIN) run serve
run-with-watcher: build
$(NPM_BIN) run start
publish: test
IS_NPM=1 $(NPM_BIN) run build
$(NPM_BIN) publish
dirs:
echo $(DESTDIR)
echo $(DESTBIN)
echo $(NPM_BIN)
clean:
rm -rf $(NODE_MODULES) $(BUILD_DIR)/* $(TMP) $(DEP)/node sdk.js vendor/playback/playback.js
sc-vendor-libs: node_modules
$(NPM_BIN) install \
@sc/scaudio \
@sc/scaudio-public-api-stream-url-retriever \
@sc/maestro-core \
@sc/maestro-loaders \
@sc/scaudio-controller-html5-player \
@sc/scaudio-controller-hls-mse-player
$(NPM_BIN) run buildPlayback
$(NPM_BIN): $(DESTDIR)/usr/lib/$(NODE)/bin/node
@mkdir -p $(@D)
ln -sf $(DESTDIR)/usr/lib/$(NODE)/bin/npm $@
@touch $@
$(DESTDIR)/usr/lib/$(NODE)/bin/node: $(DEP)/node/$(OS)/$(NODE_VERSION).tar.gz
@mkdir -p $(@D)
tar xz -C $(DESTDIR)/usr/lib/$(NODE) --strip-components 1 -f $<
@touch $@
$(DEP)/node/$(OS)/$(NODE_VERSION).tar.gz:
http_proxy=$(PROXY) curl -q --create-dirs --fail --location https://nodejs.org/dist/v$(NODE_VERSION)/node-v$(NODE_VERSION)-linux-x64.tar.xz --output $@
@touch $@