| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
|
| 7 |
TARGET_BUILD=iwyu-build |
| 8 |
VERSION=$(shell dpkg-parsechangelog |grep "^Version:"|sed -e "s|Version: \(.*\)|\1|") |
| 9 |
include /usr/share/dpkg/architecture.mk |
| 10 |
ADDITIONAL_CXX_FLAGS="" |
| 11 |
|
| 12 |
ifneq (,$(filter $(DEB_BUILD_ARCH),mips64el)) |
| 13 |
ADDITIONAL_CXX_FLAGS += -mxgot |
| 14 |
endif |
| 15 |
|
| 16 |
ifneq (,$(filter $(DEB_HOST_ARCH), armel)) |
| 17 |
export DEB_LDFLAGS_MAINT_APPEND = -latomic |
| 18 |
endif |
| 19 |
|
| 20 |
%: |
| 21 |
dh $@ --buildsystem=cmake --builddirectory=$(TARGET_BUILD) |
| 22 |
|
| 23 |
|
| 24 |
override_dh_auto_configure: |
| 25 |
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$(ADDITIONAL_CXX_FLAGS)" -DLLVM_PATH=/usr/lib/llvm-19/ -DCMAKE_PREFIX_PATH=/usr/lib/llvm-19/ -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE |
| 26 |
|
| 27 |
|
| 28 |
override_dh_auto_build: |
| 29 |
dh_auto_build |
| 30 |
help2man --no-info --version-string "$(VERSION)" -n "Analyze #includes in C and C++ source files" $(TARGET_BUILD)/bin/include-what-you-use > $(TARGET_BUILD)/include-what-you-use.1 |
| 31 |
cd $(TARGET_BUILD) && rm -f iwyu.1 && ln -s include-what-you-use.1 iwyu.1 && \ |
| 32 |
cp ../fix_includes.py fix_include |
| 33 |
chrpath -d $(TARGET_BUILD)/bin/include-what-you-use |
| 34 |
|
| 35 |
|
| 36 |
override_dh_auto_install: |
| 37 |
dh_auto_install |
| 38 |
cd debian/iwyu/usr/bin; \ |
| 39 |
rm -f fix_includes.py; \ |
| 40 |
mv iwyu_tool.py iwyu_tool |
| 41 |
|
| 42 |
override_dh_auto_test: |
| 43 |
# Do not fail the build if a test is failing. |
| 44 |
# It isn't tested upstream besides i386 & amd64 |
| 45 |
dh_auto_test || true |
| 46 |
|
| 47 |
override_dh_auto_clean: |
| 48 |
rm -rf $(TARGET_BUILD) |