| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
COMMA = , |
| 4 |
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) |
| 5 |
NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) |
| 6 |
endif |
| 7 |
|
| 8 |
export DEB_BUILD_MAINT_OPTIONS=reproducible=+fixfilepath |
| 9 |
|
| 10 |
#export DH_VERBOSE=1 |
| 11 |
export DH_OPTIONS= |
| 12 |
|
| 13 |
CFLAGS := $(shell dpkg-buildflags --get CPPFLAGS; dpkg-buildflags --get CFLAGS) |
| 14 |
CXXFLAGS := $(shell dpkg-buildflags --get CPPFLAGS; dpkg-buildflags --get CXXFLAGS) |
| 15 |
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) |
| 16 |
CFLAGS += -D_LARGE_FILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 |
| 17 |
CXXFLAGS += -D_LARGE_FILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 |
| 18 |
export CFLAGS |
| 19 |
export CXXFLAGS |
| 20 |
export LDFLAGS |
| 21 |
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) |
| 22 |
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 23 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 24 |
|
| 25 |
clang_archs = $(shell sed -n 's/.*\bllvm-dev[[:space:]]*\[\(.*\)\].*/\1/p' debian/control) |
| 26 |
|
| 27 |
with_doxywizard = $(if $(filter stage1,$(DEB_BUILD_PROFILES)),no,yes) |
| 28 |
|
| 29 |
CONFIGUREFLAGS += -DCMAKE_INSTALL_PREFIX=/usr |
| 30 |
CONFIGUREFLAGS += -Dbuild_wizard=$(if $(filter yes, $(with_doxywizard)),ON,OFF) |
| 31 |
CONFIGUREFLAGS += -Dbuild_doc=$(if $(filter yes, $(with_docs)),ON,OFF) |
| 32 |
CONFIGUREFLAGS += -DPYTHON_EXECUTABLE=/usr/bin/python3 |
| 33 |
CONFIGUREFLAGS += -Duse_libclang=$(if $(filter $(DEB_HOST_ARCH),$(clang_archs)),ON,OFF) |
| 34 |
CONFIGUREFLAGS += -Dbuild_search=ON |
| 35 |
CONFIGUREFLAGS += -Dbuild_parse=ON |
| 36 |
CONFIGUREFLAGS += -Duse_sys_spdlog=ON |
| 37 |
CONFIGUREFLAGS += -Duse_sys_fmt=ON |
| 38 |
CONFIGUREFLAGS += -Duse_sys_sqlite3=ON |
| 39 |
CONFIGUREFLAGS += -Dforce_qt=Qt6 |
| 40 |
|
| 41 |
configure-stamp: |
| 42 |
dh_testdir |
| 43 |
$(MAKE) -C deps/jquery install |
| 44 |
rm -rf build |
| 45 |
mkdir -p build |
| 46 |
cd build && cmake -G "Unix Makefiles" $(CONFIGUREFLAGS) $(CURDIR) |
| 47 |
touch $@ |
| 48 |
|
| 49 |
build: with_docs=yes |
| 50 |
build-arch: with_docs=no |
| 51 |
build-indep: with_docs=yes |
| 52 |
|
| 53 |
build: build-stamp |
| 54 |
build-arch: build-stamp |
| 55 |
build-indep: build-stamp |
| 56 |
build-stamp: configure-stamp |
| 57 |
dh_testdir |
| 58 |
$(MAKE) -C build $(NJOBS) VERBOSE=1 |
| 59 |
[ "$(with_docs)" = no ] || FORCE_SOURCE_DATE=1 $(MAKE) -C build $(NJOBS) VERBOSE=1 docs |
| 60 |
[ "$(with_docs)" = no ] || find build/html/examples/ -type f -iregex .*pdf -exec mat2 --inplace '{}' \; |
| 61 |
touch $@ |
| 62 |
|
| 63 |
clean: |
| 64 |
dh_testdir |
| 65 |
dh_testroot |
| 66 |
$(MAKE) -C deps/jquery clean |
| 67 |
rm -f configure-stamp build-stamp install*stamp |
| 68 |
rm -rf build |
| 69 |
rm -f templates/html/jquery.js |
| 70 |
rm -f templates/html/tabs.css |
| 71 |
rm -f debian/dh-doxygen/dh_doxygen.1 |
| 72 |
dh_clean |
| 73 |
|
| 74 |
uninstall: |
| 75 |
dh_testdir |
| 76 |
dh_testroot |
| 77 |
rm -f install*stamp |
| 78 |
dh_prep |
| 79 |
|
| 80 |
install-indep: build-indep |
| 81 |
install-indep: install-indep-stamp |
| 82 |
install-indep-stamp: |
| 83 |
dh_testdir |
| 84 |
dh_testroot |
| 85 |
dh_prep -i |
| 86 |
dh_installdirs -i |
| 87 |
$(MAKE) -C build install \ |
| 88 |
VERBOSE=1 \ |
| 89 |
DESTDIR=$(CURDIR)/debian/doxygen-doc |
| 90 |
mkdir -p debian/doxygen-doc/usr/share/doc/doxygen |
| 91 |
mv debian/doxygen-doc/usr/share/doc/packages/doxygen/* \ |
| 92 |
debian/doxygen-doc/usr/share/doc/doxygen/. |
| 93 |
rm -rf debian/doxygen-doc/usr/share/doc/packages |
| 94 |
rm -rf debian/doxygen-doc/usr/bin |
| 95 |
rm -rf debian/doxygen-doc/usr/share/man |
| 96 |
-find debian -name .cvsignore -o -name CVS | xargs rm -rf |
| 97 |
touch $@ |
| 98 |
|
| 99 |
install-arch: build-arch |
| 100 |
install-arch: install-arch-stamp |
| 101 |
install-arch-stamp: |
| 102 |
dh_testdir |
| 103 |
dh_testroot |
| 104 |
dh_prep -a |
| 105 |
dh_installdirs -a |
| 106 |
$(MAKE) -C build install \ |
| 107 |
VERBOSE=1 \ |
| 108 |
DESTDIR=$(CURDIR)/debian/doxygen |
| 109 |
cd debian/dh-doxygen && pod2man -c Debhelper -r '' dh_doxygen dh_doxygen.1 |
| 110 |
: # FIXME: man pages not installed when building without docs |
| 111 |
: # Fixed in verison 1.11.0 |
| 112 |
[ -f debian/doxygen/usr/share/man/man1/doxygen.1 ] \ |
| 113 |
|| install -D doc/doxygen.1 debian/doxygen/usr/share/man/man1/doxygen.1 |
| 114 |
[ -f debian/doxygen/usr/share/man/man1/doxyindexer.1 ] \ |
| 115 |
|| install -D doc/doxyindexer.1 debian/doxygen/usr/share/man/man1/doxyindexer.1 |
| 116 |
[ -f debian/doxygen/usr/share/man/man1/doxysearch.1 ] \ |
| 117 |
|| install -D doc/doxysearch.1 debian/doxygen/usr/share/man/man1/doxysearch.1 |
| 118 |
ifeq ($(with_doxywizard),yes) |
| 119 |
[ -f debian/doxygen/usr/share/man/man1/doxywizard.1 ] \ |
| 120 |
|| install -D doc/doxywizard.1 debian/doxygen/usr/share/man/man1/doxywizard.1 |
| 121 |
else |
| 122 |
rm -f debian/doxygen/usr/share/man/man1/doxywizard.1 |
| 123 |
endif |
| 124 |
dh_movefiles -pdoxygen-gui --sourcedir=debian/doxygen \ |
| 125 |
usr/bin/doxywizard \ |
| 126 |
usr/share/man/man1/doxywizard.1 |
| 127 |
rm -rf debian/doxygen/usr/share/doc/packages |
| 128 |
-find debian -name .cvsignore -o -name CVS | xargs rm -rf |
| 129 |
dh_movefiles -pdoxygen-doxyparse --sourcedir=debian/doxygen \ |
| 130 |
usr/bin/doxyparse |
| 131 |
touch $@ |
| 132 |
|
| 133 |
install: build |
| 134 |
install: install-indep install-arch |
| 135 |
|
| 136 |
binary: with_docs=yes |
| 137 |
binary-arch: with_docs=no |
| 138 |
binary-indep: with_docs=yes |
| 139 |
|
| 140 |
binary-indep: install-indep |
| 141 |
dh_testdir |
| 142 |
dh_testroot |
| 143 |
dh_installdocs -i |
| 144 |
dh_lintian -i |
| 145 |
./debian/dh-doxygen/dh_doxygen |
| 146 |
rdfind -outputname /dev/null -makehardlinks true debian/doxygen-doc/usr/share/doc/doxygen |
| 147 |
dh_installchangelogs doc/changelog.dox |
| 148 |
dh_link -i |
| 149 |
dh_compress -i -X.pdf |
| 150 |
dh_fixperms -i |
| 151 |
dh_installdeb -i |
| 152 |
dh_shlibdeps -i |
| 153 |
dh_gencontrol -i |
| 154 |
dh_md5sums -i |
| 155 |
dh_builddeb -i |
| 156 |
|
| 157 |
binary-arch: install-arch |
| 158 |
dh_testdir |
| 159 |
dh_testroot |
| 160 |
dh_install -a |
| 161 |
dh_installdocs -a LANGUAGE.HOWTO README.md VERSION |
| 162 |
dh_installman -a |
| 163 |
dh_installchangelogs -a doc/changelog.dox |
| 164 |
dh_strip -a |
| 165 |
dh_link -a |
| 166 |
dh_compress -a |
| 167 |
dh_fixperms -a |
| 168 |
dh_installdeb -a |
| 169 |
dh_shlibdeps -a |
| 170 |
dh_gencontrol -a |
| 171 |
dh_md5sums -a |
| 172 |
dh_builddeb -a |
| 173 |
|
| 174 |
binary: install |
| 175 |
binary: binary-arch binary-indep |
| 176 |
|
| 177 |
.PHONY: configure build clean uninstall |
| 178 |
.PHONY: install-arch install-indep install |
| 179 |
.PHONY: binary-arch binary-indep binary |