| 1 |
|
| 2 |
|
| 3 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto abi=+time64 |
| 4 |
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic |
| 5 |
|
| 6 |
%: |
| 7 |
ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),) |
| 8 |
dh $@ --with python3 --exclude=.la |
| 9 |
else |
| 10 |
dh $@ --exclude=.la |
| 11 |
endif |
| 12 |
|
| 13 |
override_dh_auto_configure: |
| 14 |
dh_auto_configure -- \ |
| 15 |
--enable-tools=yes \ |
| 16 |
--enable-bindings-cxx \ |
| 17 |
$(NULL) |
| 18 |
if ! echo "$(DEB_BUILD_PROFILES)" | grep -q "nopython"; then \ |
| 19 |
pybuild --configure -d bindings/python/; \ |
| 20 |
fi |
| 21 |
|
| 22 |
override_dh_auto_build: |
| 23 |
dh_auto_build |
| 24 |
if ! echo "$(DEB_BUILD_PROFILES)" | grep -q "nopython"; then \ |
| 25 |
CFLAGS="$(shell dpkg-buildflags --get CFLAGS) -I $(CURDIR)/include -I $(CURDIR)/tests/gpiosim/" \ |
| 26 |
LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS) -L $(CURDIR)/lib/.libs/ -L $(CURDIR)/tests/gpiosim/.libs/" \ |
| 27 |
pybuild --build -s pyproject -d bindings/python/; \ |
| 28 |
fi |
| 29 |
if ! echo "$(DEB_BUILD_OPTIONS)" | grep -q "nodoc"; then \ |
| 30 |
if command -v doxygen >/dev/null; then \ |
| 31 |
cd docs && doxygen Doxyfile; \ |
| 32 |
else \ |
| 33 |
echo "Warning: doxygen not found. Skipping documentation build."; \ |
| 34 |
fi; \ |
| 35 |
fi |
| 36 |
|
| 37 |
|
| 38 |
override_dh_auto_build-indep: |
| 39 |
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) |
| 40 |
dh_auto_build -- doc |
| 41 |
endif |
| 42 |
|
| 43 |
|
| 44 |
override_dh_auto_install-indep: |
| 45 |
|
| 46 |
override_dh_auto_install: |
| 47 |
dh_auto_install |
| 48 |
if ! echo "$(DEB_BUILD_PROFILES)" | grep -q "nopython"; then \ |
| 49 |
pybuild --install -s pyproject -d bindings/python/; \ |
| 50 |
fi |
| 51 |
|
| 52 |
override_dh_installdocs: |
| 53 |
|
| 54 |
dh_installdocs -X.md5 |
| 55 |
|
| 56 |
override_dh_clean: |
| 57 |
dh_clean |
| 58 |
rm -rf confdefs.h |
| 59 |
rm -rf doc/* |