File: rules

package info (click to toggle)
clazy 1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,804 kB
  • sloc: cpp: 18,333; python: 1,100; sh: 223; makefile: 25
file content (43 lines) | stat: -rwxr-xr-x 1,491 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
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# LLVM 6.0 headers produce lots of class-memaccess warnings
export DEB_CXXFLAGS_MAINT_APPEND = -Wno-class-memaccess

archs_that_need_atomic = armel
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(archs_that_need_atomic)))
export DEB_LDFLAGS_MAINT_APPEND = -latomic
endif

# keep the "++" at the end, to make sure the tool used is the C++ frontend
CLANGPP=$(shell realpath $$(which clang++))++

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -DCLANGPP_EXECUTABLE="$(CLANGPP)"

override_dh_auto_install:
	dh_auto_install
	# drop RPATH pointing to the private libdir of LLVM libraries,
	# i.e. /usr/lib/llvm-$VERSION/lib
	chrpath -d $(CURDIR)/debian/clazy/usr/bin/clazy-standalone $(CURDIR)/debian/clazy/usr/lib/*/*.so
	# drop extra license file
	rm $(CURDIR)/debian/clazy/usr/share/doc/clazy/COPYING-LGPL2.txt

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	chmod +x $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/clazy
	cd tests && env PATH=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE):$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/bin:$(PATH) LD_LIBRARY_PATH=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/lib DEB_HOST_ARCH=$(DEB_HOST_ARCH) ./run_tests.py --verbose
endif

override_dh_compress:
	# do not compress documentation markdown & JSON files
	dh_compress -X.md -X.json

override_dh_gencontrol:
	dh_gencontrol -- -V'clazy:clang=$(shell dpkg -S "$(CLANGPP)" | cut -d: -f1)'