File: rules

package info (click to toggle)
ninja-build 1.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,332 kB
  • sloc: cpp: 15,824; python: 1,349; ansic: 569; sh: 109; lisp: 39; makefile: 34
file content (48 lines) | stat: -rwxr-xr-x 1,486 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
46
47
48
#!/usr/bin/make -f

export DEB_CFLAGS_MAINT_APPEND=$(shell dpkg-buildflags --get CPPFLAGS)
export DEB_CXXFLAGS_MAINT_APPEND=$(shell dpkg-buildflags --get CPPFLAGS)
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed

%:
	dh $@

override_dh_auto_configure:
	python3 ./configure.py --bootstrap --verbose

override_dh_auto_build:
	./ninja -v all
ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
	./ninja -v manual
	help2man --include=debian/ninja.1.in --output=build/ninja.1.org --no-info --no-discard-stderr ./ninja
	sed 's/\(default=\)[0-9]\+ on this system/\1\#CPUs/' build/ninja.1.org > build/ninja.1
	if cmp --silent build/ninja.1.org build/ninja.1; then echo "sed pattern not found"; exit 1; fi
endif

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Deliberately ignore errors from ulimit.
	# It allows more tests to run but some archs/buildds have a lower hard limit.
	sh -c "ulimit -n 2000; ./ninja_test"
endif

override_dh_auto_install:
	# noop

override_dh_auto_clean:
	# noop

override_dh_clean:
	dh_clean
	test -x ninja && ./ninja -t clean || true
	find -type f -iname "*.pyc" | xargs rm -f
	rm -f null.o
	rm -f build.ninja
	rm -rf build

override_dh_install-arch:
	dh_install
	mv debian/ninja-build/usr/share/bash-completion/completions/bash-completion \
	   debian/ninja-build/usr/share/bash-completion/completions/ninja
	mv debian/ninja-build/usr/share/zsh/vendor-completions/zsh-completion \
	   debian/ninja-build/usr/share/zsh/vendor-completions/_ninja