#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 NUMJOBS=1 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) endif DEB_CONFIGURE_EXTRA_FLAGS=--with-dll --with-mt --without-autodep \ --without-makefile-auto-update --with-flat-makefile --without-caution \ --without-dbapi --without-lzo --with-runpath=/usr/lib/ncbi-blast+ \ --with-build-root=BUILD --without-debug --without-downloaded-vdb \ --with-mbedtls --without-sse42 proj=algo/blast/ app/ objmgr/ objtools/align_format/ objtools/blast/ #ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) DEB_CONFIGURE_EXTRA_FLAGS += --with-symbols #endif #export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie export DEB_CFLAGS_MAINT_APPEND=-Wall -pedantic export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) CFLAGS := $(shell dpkg-buildflags --get CFLAGS) CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed ifneq (,$(findstring mips,$(DEB_HOST_ARCH))) CXXFLAGS := $(CXXFLAGS:-O%=-O) DEB_CONFIGURE_EXTRA_FLAGS += FAST_CXXFLAGS=-O endif export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MAKE # used for run_with_lock DEB_CONFIGURE_EXTRA_FLAGS += CFLAGS_FOR_BUILD="$(CFLAGS) -fPIE" DEB_CONFIGURE_EXTRA_FLAGS += LDFLAGS_FOR_BUILD="$(LDFLAGS)" BLAST2_VERSION=1:$(shell dpkg-parsechangelog | awk '/^Version:/ { print $$2 }') llp=LD_LIBRARY_PATH override_dh_auto_configure-indep:; override_dh_auto_configure-arch: cd c++ && $(llp)=$(CURDIR)/c++/BUILD/lib$${$(llp)+:$$$(llp)} \ CONFIG_SHELL=/bin/bash ./configure $(DEB_CONFIGURE_EXTRA_FLAGS) \ || (tail -v -n +0 config.log BUILD/status/config.log; exit 1) override_dh_auto_build-arch: cd c++/BUILD/build && \ make -j$(NUMJOBS) -f Makefile.flat all_projects="$(proj)" # make all_r override_dh_auto_build-indep: echo "Save time and do nothing for architecture independent builds" override_dh_auto_test: -dh_auto_test -c++/BUILD/build/check.sh concat_err -cat c++/BUILD/build/check.sh.out_err instroot = debian/ncbi-blast+/usr leg_bin = debian/ncbi-blast+-legacy/usr/bin override_dh_auto_install-arch: # cp c++/BUILD/lib/*.so $(instroot)/lib/ncbi-blast+/ cp c++/BUILD/bin/* $(instroot)/bin/ override_dh_auto_install-indep: echo "Nothing to do for architecture independant installs" override_dh_install-arch: # dh_install mv $(instroot)/bin/rpsblast $(instroot)/bin/rpsblast+ mv $(instroot)/bin/seedtop $(instroot)/bin/seedtop+ mv $(instroot)/bin/legacy_blast.pl $(instroot)/bin/legacy_blast mv $(instroot)/bin/update_blastdb.pl $(instroot)/bin/update_blastdb mv $(instroot)/bin/windowmasker_2.2.22_adapter.py \ $(instroot)/bin/windowmasker_2.2.22_adapter # Clean up tests, demos, and internal build tools rm -f $(instroot)/bin/*test* $(instroot)/bin/seqdb_demo \ $(instroot)/bin/datatool $(instroot)/bin/run_with_lock \ $(instroot)/bin/project_tree_builder for x in $(instroot)/bin/*; do \ LD_LIBRARY_PATH=c++/BUILD/lib ldd $$x; \ done 2>/dev/null | awk '/BUILD/ { print $$3 }' | sort -u | \ xargs cp -v -t $(instroot)/lib/ncbi-blast+ override_dh_install-indep: #if test -d $(leg_bin); then cp debian/legacy/legacy.sh $(leg_bin)/; fi for x in blastall megablast blastpgp bl2seq rpsblast fastacmd formatdb \ seedtop; do \ sed -e "s/.{.*}/$$x/" debian/legacy/legacy.sh > $(leg_bin)/$$x; \ chmod +x $(leg_bin)/$$x; \ done override_dh_clean: cp c++/configure.orig configure.orig.save dh_clean #Tricky - for each module directory there may be several module files #or there may be none but then there is still a module named after the #directory. Clean everything! -for x in c++/src/objects/* ; do \ (cd "$$x" && ( \ mods="`echo *.module`" ; \ [ "$${mods#*\*}" = "$$mods" ] || mods="`basename $$x`" ; \ for mod in $$mods ; do \ ../../../BUILD/build/new_module.sh $$mod purge_sources ; \ done ) ; \ ) ; \ done rm -rf c++/compilers/dll c++/config.log c++/Makefile rm -f c++/configure.lineno c++/src/objects/blastxml/blastxml.module find -name check_exec.pid -delete rm -rf c++/BUILD mv configure.orig.save c++/configure.orig override_dh_gencontrol-indep: dh_gencontrol -pblast2 -- -v$(BLAST2_VERSION) dh_gencontrol -Nblast2 %: #dh $@ -Dc++ --with autotools_dev dh $@ -Dc++