Skip to content

Commit

Permalink
build: Support IoT.js
Browse files Browse the repository at this point in the history
Add make start helper

Relate-to: miroRucka#23
Origin: https://github.com/abandonware/bh1750
Change-Id: I38ac736a373702e87087d910ef30c91386d3a565
Relate-to: miroRucka#25
Forwarded: https://github.com/miroRucka/bh1750/pulls
Signed-off-by: Philippe Coval <rzr@users.sf.net>
  • Loading branch information
rzr committed Feb 24, 2020
1 parent 66b2316 commit c091991
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/make -f
# -*- makefile -*-
# SPDX-License-Identifier: MIT

default: help all
@echo "log: $@: $^"

tmp_dir ?= tmp
runtime ?= iotjs
export runtime
srcs_dir ?= lib example
srcs ?= $(wildcard *.js | sort | uniq)

main_src ?= example/index.js


help:
@echo "## Usage: "
@echo "# make start"

setup: setup/${runtime}

start/%: ${main_src}
${@F} $< ${run_args}

start: start/${runtime}

clean:
rm -rf ${tmp_dir}

cleanall: clean
rm -f *~

distclean: cleanall
rm -rf node_modules

setup/iotjs: ${iotjs_modules_dir}
@echo "Expected to see IoT.js' help"
${@F} --help ||:
ls $<

0 comments on commit c091991

Please sign in to comment.