forked from soundcloud/soundcloud-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (53 loc) · 1.83 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
71
72
73
74
OS := $(shell uname)
BUILD_DIR := $(PWD)/build
TMP := $(PWD)/.tmp
DEP := $(TMP)/deps
DESTDIR := $(BUILD_DIR)/system/$(OS)
DESTBIN := $(DESTDIR)/bin
NODE_VERSION := 4.1.0
NODE_MODULES := $(PWD)/node_modules
NODE := nodejs-$(NODE_VERSION)
NODE_BIN := $(DESTBIN)/node
NPM_BIN := $(DESTBIN)/npm
NM_BIN := $(PWD)/node_modules/.bin
NODE_HOST := https://nodejs.org/download/release
NODE_SRC := node-v$(NODE_VERSION).tar.gz
NPM_REGISTRY := http://npm.dev.s-cloud.net
export PATH := $(DESTBIN):$(NM_BIN):$(PATH)
.PHONY: setup build sc-vendor-libs test run publish dirs clean sc-vendor-libs
setup: $(NODE_BIN)
build: $(NODE_BIN)
$(NPM_BIN) install
$(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) sdk.js
vendor/audiomanager.js:
$(NPM_BIN) install @sc/audiomanager --registry=$(NPM_REGISTRY)
cp $(NODE_MODULES)/@sc/audiomanager/build/audiomanager.min.js vendor/audiomanager.js
vendor/scaudio.js:
$(NPM_BIN) install @sc/scaudio --registry=$(NPM_REGISTRY)
cp $(NODE_MODULES)/@sc/scaudio/scaudio.min.js vendor/scaudio.js
sc-vendor-libs: vendor/audiomanager.js vendor/scaudio.js
### nodejs
$(TMP):
mkdir -p $(TMP)
$(TMP)/$(NODE)/configure:
mkdir -p $(TMP)/${NODE}
curl -L $(NODE_HOST)/v$(NODE_VERSION)/$(NODE_SRC) | tar xzv -C $(TMP)/$(NODE) --strip-components 1
$(TMP)/$(NODE)/config.gypi: $(TMP)/$(NODE)/configure
cd $(TMP)/$(NODE); PKG_CONFIG_PATH=/usr/lib/pkgconfig/openssl.pc ./configure --prefix=$(DESTDIR)
$(NODE_BIN): $(TMP)/$(NODE)/config.gypi
PORTABLE=1 make -j4 -C $(TMP)/$(NODE) install