Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 # resolve DEB_VERSION DEB_VERSION_UPSTREAM
4 include /usr/share/dpkg/pkg-info.mk
5
6 # generate documentation unless nodoc requested
7 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
8 DOCSscip-makefile . . . DOCS. = README.html README.txt
9 endif
10
11 export DEB_BUILD_MAINT_OPTIONSscip-makefile . . . DEB_BUILD_MAINT_OPTIONS. = hardening=+all
12 export DEB_CFLAGS_MAINT_APPENDscip-makefile . . . DEB_CFLAGS_MAINT_APPEND. = -Wall -pedantic
13 export DEB_CXXFLAGS_MAINT_APPENDscip-makefile . . . DEB_CXXFLAGS_MAINT_APPEND. = -Wall -pedantic
14
15 # trust upstream optimization level unless explicitly disabled
16 ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
17 export DEB_CFLAGS_MAINT_STRIPscip-makefile . . . DEB_CFLAGS_MAINT_STRIP.=-O2
18 export DEB_CXXFLAGS_MAINT_STRIPscip-makefile . . . DEB_CXXFLAGS_MAINT_STRIP.=-O2
19 endif
20
21 # generate manual pages from output of clap-based Rust binary
22 # arguments: 1:MANFILEPATH 2:COMMANDPATH 3:SUBCOMMAND(S)
23 _help2manscip-makefile . . . _help2man. = \
24 $(eval suffix = $(lastword $(subst ., ,$(1))))\
25 $(eval stem = $(patsubst %.$(suffix),%,$(1)))\
26 help2man --section $(suffix) --no-info \
27 --version-string='$(DEB_VERSION_UPSTREAM)' \
28 --name $(shell $(2) $(3) --help | head --lines=1 | xargs -0 shell-quote --) \
29 --output '$(stem)$(if $(3),-$(subst $() ,-,$(strip $(3)))).$(suffix)' \
30 '$(2)$(if $(3), $(3))' \
31 || { $(2) $(3) --help; false; }
32
33 mainpkgscip-makefile . . . mainpkg. = wasm-tools
34 cmdscip-makefile . . . cmd. = wasm-tools
35 subcmds_$(cmdscip-makefile . . . cmd.) = \
36 parse validate print smith shrink mutate dump objdump strip compose \
37 demangle component metadata wit-smith addr2line json-from-wast wast
38
39 # generate documentation unless nodoc requested
40 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
41 MANPAGESscip-makefile . . . MANPAGES. = $(cmdscip-makefile . . . cmd.).1
42 endif
43
44 %scip-makefile . . . `%`/:
45 dh $@scip-makefile . . . `@`.
46
47 %.htmlscip-makefile . . . `%.html`/: %.mdscip-makefile . . . `%.md`/
48 cmark-gfm $<scip-makefile . . . `<`. > $@scip-makefile . . . `@`.
49
50 %.txtscip-makefile . . . `%.txt`/: %.mdscip-makefile . . . `%.md`/
51 cmark-gfm --to plaintext $<scip-makefile . . . `<`. > $@scip-makefile . . . `@`.
52
53 execute_after_dh_auto_buildscip-makefile . . . execute_after_dh_auto_build/: $(scip-makefile . . . `$(DOCS)`/DOCSscip-makefile . . . DOCS.)scip-makefile . . . `$(DOCS)`/
54
55 execute_after_dh_auto_install-archscip-makefile . . . execute_after_dh_auto_install-arch/: debian/$(scip-makefile . . . `debian/$(mainpkg)/usr/bin/$(cmd)`/mainpkgscip-makefile . . . mainpkg.)/usr/bin/$(scip-makefile . . . `debian/$(mainpkg)/usr/bin/$(cmd)`/cmdscip-makefile . . . cmd.)scip-makefile . . . `debian/$(mainpkg)/usr/bin/$(cmd)`/ $(scip-makefile . . . `$(MANPAGES)`/MANPAGESscip-makefile . . . MANPAGES.)scip-makefile . . . `$(MANPAGES)`/
56 mkdir --parents debian/build
57 $<scip-makefile . . . `<`. completion bash > debian/build/bash-completion
58 $<scip-makefile . . . `<`. completion zsh > debian/build/_$(cmdscip-makefile . . . cmd.)
59
60 # avoid cleaning unless source is patched
61 override_dh_auto_cleanscip-makefile . . . override_dh_auto_clean/:
62 grep -q playground Cargo.toml || dh_auto_clean --buildsystem rust
63
64 override_dh_installdocsscip-makefile . . . override_dh_installdocs/:
65 dh_installdocs -- $(DOCSscip-makefile . . . DOCS.)
66
67 override_dh_gencontrolscip-makefile . . . override_dh_gencontrol/:
68 dh_gencontrol -plibrust-wasm-tools-dev -- \
69 -V'rust:Version:zero-based=$(patsubst 1.%,0.%,$(DEB_VERSION))'
70 dh_gencontrol --remaining-packages
71
72 # build manpages
73 $(scip-makefile . . . `$(cmd).1`/cmdscip-makefile . . . cmd.).1scip-makefile . . . `$(cmd).1`/: %.1:scip-makefile . . . `%.1:`/ debian/$(scip-makefile . . . `debian/$(mainpkg)/usr/bin/%`/mainpkgscip-makefile . . . mainpkg.)/usr/bin/%scip-makefile . . . `debian/$(mainpkg)/usr/bin/%`/
74 $(call _help2man,$@scip-makefile . . . `@`.,$<scip-makefile . . . `<`.)
75 set -e; $(foreach x,$(subcmds_$(cmdscip-makefile . . . cmd.)),\
76 $(call _help2man,$@scip-makefile . . . `@`.,$<scip-makefile . . . `<`.,$x);)