File: rules

package info (click to toggle)
libjs-webrtc-adapter 7.2.1~ds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 520 kB
  • sloc: makefile: 35; sh: 4
file content (50 lines) | stat: -rwxr-xr-x 1,474 bytes parent folder | download
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
#!/usr/bin/make -f

STEMS = adapter adapter_no_global adapter_no_edge adapter_no_edge_no_global
DOCS = README.md

# concatenate for browsers using browserify-lite
_mkweb = mkdir --parents out && NODE_PATH=.:/usr/lib/nodejs \
 browserify-lite $(patsubst %,--standalone %,$3) --outfile $2 $1

%:
	dh $@

# optimize JavaScript for browser use
# TODO: include source-map when supported by concatenation
debian/js/%.min.js: debian/js/%.js
	mkdir --parents debian/js
	uglifyjs --compress --mangle \
		--output $@ \
		-- $<

# pre-compress for browser use
%.gz: %
	pigz --force --keep -11 -- $<
	brotli --force --keep --best -- $<

override_dh_auto_build: $(patsubst %,debian/js/%.min.js.gz,$(STEMS))

# build browser libraries
dist/adapter_core5.js: src/js/adapter_core5.js
	grunt babel
dist_x/adapter_core5.js: dist/adapter_core5.js
	cp --force --archive dist dist_x
	rm dist_x/edge/edge_shim.js
	sed --in-place --expression '/edge_shim/d' dist_x/adapter_factory.js
out/adapter.js: dist/adapter_core5.js
	$(call _mkweb, $<, $@, adapter)
out/adapter_no_global.js: dist/adapter_core5.js
	$(call _mkweb, $<, $@)
out/adapter_no_edge.js: dist_x/adapter_core5.js
	$(call _mkweb, $<, $@, adapter)
out/adapter_no_edge_no_global.js: dist_x/adapter_core5.js
	$(call _mkweb, $<, $@)
$(patsubst %,debian/js/%.js,$(STEMS)): debian/js/%.js: out/%.js
	mkdir --parents debian/js
	cp --force --target-directory debian/js $<

override_dh_installdocs:
	dh_installdocs --all -- $(DOCS)

.SECONDARY: