-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
62 lines (46 loc) · 1.3 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
#!/bin/make -f
# -*- makefile -*-
default: help start
@echo "# $@: $^"
main_src ?= dist/example/fade.js
runtime ?= iotjs
project?=node-blinkt
iotjs_modules_dir ?= iotjs_modules
iotjs_wiringpi_dir ?= ${iotjs_modules_dir}/iotjs-wiringpi
iotjs_wiringpi_url ?= https://github.com/SamsungInternet/wiringpi-iotjs
iotjs_wiringpi_revision ?= v0.0.1
deploy_dir ?= ${CURDIR}/tmp/deploy
deploy_modules_dir ?= ${deploy_dir}/iotjs_modules
deploy_module_dir ?= ${deploy_modules_dir}/${project}
deploy_srcs += ${deploy_module_dir}/dist/*.js
deploy_srcs += ${deploy_module_dir}/dist/*/*.js
deploy_srcs += ${deploy_module_dir}/index.js
help:
@echo "Usage:"
@echo "# make start"
cleanall:
rm -rf iotjs_modules node_modules
run/node: ${main_src} node_modules
npm test
run/iotjs: ${main_src} ${iotjs_modules_dir}
-which iotjs
-iotjs -h
iotjs $<
run: run/node run/iotjs
${iotjs_modules_dir}/wiringpi-node:
mkdir -p $@
git clone --depth 1 --recursive -b ${iotjs_wiringpi_revision} ${iotjs_wiringpi_url} $@
${iotjs_modules_dir}: ${iotjs_modules_dir}/wiringpi-node
du -ks $@
node_modules: package.json
npm install --only=dev
${main_src}: package.json node_modules
npm run build
ls $@
start: run/${runtime}
${deploy_module_dir}/%: %
@echo "# TODO: minify: $<"
install -d ${@D}
install $< $@
deploy: ${deploy_srcs}
ls $<