File: rules

package info (click to toggle)
libjs-bootbox 5.5.3~ds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,244 kB
  • sloc: javascript: 3,834; makefile: 26; sh: 10
file content (42 lines) | stat: -rwxr-xr-x 1,012 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

STEMS = bootbox bootbox.all bootbox.locales
# generate documentation unless nodoc requested
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
DOCS = README.html README.txt
endif

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

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

# use staging dir for browser library (easier to install and clean)
debian/js/%.js: %.js
	mkdir --parents debian/js
	cp --force --target-directory debian/js $<

# optimize JavaScript for browser use
# * include source-map
debian/js/%.min.js: debian/js/%.js
	uglifyjs --compress --mangle \
		--source-map "base='$(abspath $(dir $@))',url='$(notdir $@).map'" \
		--output $@ \
		-- $<

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

%.html: %.md
	pandoc --from gfm-raw_html --to html --standalone --output $@ $<

%.txt: %.md
	pandoc --from gfm-raw_html --to plain --output $@ $<

%:
	dh $@

.SECONDARY: