File: rules

package info (click to toggle)
rust-regalloc2 0.10.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 680 kB
  • sloc: makefile: 22; sh: 1
file content (45 lines) | stat: -rwxr-xr-x 1,212 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
43
44
45
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_CXXFLAGS_MAINT_APPEND  = -Wall -pedantic

# trust upstream optimization level unless explicitly disabled
ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
export DEB_CFLAGS_MAINT_STRIP=-O2
export DEB_CXXFLAGS_MAINT_STRIP=-O2
endif

# generate documentation unless nodoc requested
DOCS_stem = README $(basename $(wildcard docs/*.md))
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
DOCS = $(addsuffix .html,$(DOCS_stem)) $(addsuffix .txt,$(DOCS_stem))
MANPAGES = regalloc2-tool.1
endif

%:
	dh $@

%.html: %.md
	cmark-gfm $< > $@

%.txt: %.md
	cmark-gfm --to plaintext $< > $@

execute_after_dh_auto_build: $(DOCS)

# TODO: enable when upstream code supports non-tty execution
#execute_after_dh_auto_install: #$(MANPAGES)
override_dh_installman:

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

# build manpages
# TODO: enable when upstream code supports non-tty execution
#regalloc2-tool.1: %.1: debian/regalloc2-tool/usr/bin/%
#	mkdir --parents $(dir $@)
#	help2man --section 1 --no-info \
#		--name "tool for testing regalloc2" \
#		--output $@ $< \
#		|| { $1 --help; false; }