-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
120 lines (95 loc) · 2.62 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/make -f
# -*- makefile -*-
# SPDX-License-Identifier: Apache-2.0
#{
# Copyright 2018-present Samsung Electronics France SAS, and other contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#}
default: help build
-@sync
runtime?=iotjs
srcs?=mastodon-lite.js
V?=1
eslint ?= node_modules/eslint/bin/eslint.js
run_args?=
url?=http://github.com/rzr/mastodon-lite
message?=${url} \#ActivityPub : \#MastodonLite test, ping @[email protected]
%/start: example/index.js
${@D} $< "${run_args}"
%/check: ${srcs}
${@D} $<
help:
@echo "# make start"
@echo "# make rule/npm/start"
@echo "# make check"
@echo "# make lint"
@echo "# make post"
@echo "# make post message=\"${message}# #MastodonLite from @[email protected]\""
@echo "# make -C example/webthing help"
start: ${runtime}/start
@echo "# log: $@: $^"
run: start
@echo "# log: $@: $^"
check: ${runtime}/check
@echo "# log: $@: $^"
test: check start
@echo "# log: $@: $^"
clean:
rm -rf *~
cleanall: clean
rm -rf node_modules iotjs_modules
distclean: cleanall
rm -rf tmp
setup:
@echo "log: Expected iotjs help to be printed"
${runtime} -h ||:
rule/npm/version/%: package.json
-git tag -d ${@F}
-git describe --tags
make -C example/webthings-activitypub-adapter "$@"
cd example/webthing && npm version ${@F}
-git add example/webthing/package*.json
-git add example/*/package*.json
-git commit -sam "webthing: Update version to ${@F}"
-git add package*.json
-git tag -d v${@F}
npm version ${@F}
-git tag -d v${@F}
@echo "# TODO: Edit Release ${@F}"
-git commit --amend
rule/npm/start: package.json
npm run ${@F}
${eslint}:
npm install --only=dev
rule/eslint: .eslintrc.js ${eslint}
@rm -rf tmp/dist
${eslint} --no-color --fix . ||:
${eslint} --no-color .
git diff --exit-code
lint: rule/eslint
@echo "# log: $@: $^"
timelines/%:
npm start get "$@"
${runtime} example get "$@"
timelines/direct:
npm -q start get "$@?limit=1"
${runtime} example get "$@?limit=1"
post:
${runtime} example post "${message}"
demo: timelines/home timelines/direct
@echo "# log: $@: $^"
iotjs/modules: ${iotjs_modules_dirs}
ls $<
all build:
@echo "# log: $@: $^"