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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
#!/usr/bin/make -f
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
ifeq (libfftw3-quad3,$(findstring libfftw3-quad3, $(shell dh_listpackages)))
QUAD := quad
else
QUAD :=
endif
ifeq (libfftw3-long3,$(findstring libfftw3-long3, $(shell dh_listpackages)))
LONG := long
else
LONG :=
endif
PREC := single double $(LONG) $(QUAD)
# old configure stuff needs a --target
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
archconfflags := $(archconfflags) --build $(DEB_HOST_GNU_TYPE)
else
archconfflags := $(archconfflags) --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
#--enable-k7 enable AMD K7 optimizations, including 3dNow! (single precision)
#--enable-sse enable SSE optimizations (single precision only)
#--enable-sse2 enable SSE2 optimizations (double precision only)
#--enable-altivec enable Altivec optimizations (single precision only)
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
ifneq (,$(filter $(DEB_HOST_ARCH), i386 amd64 x32))
archconfflags_single := --enable-sse --enable-avx
archconfflags_double := --enable-sse2 --enable-avx
endif
# no avx support in debian yet see #674760
ifneq (,$(filter $(DEB_HOST_ARCH), kfreebsd-i386 kfreebsd-amd64))
archconfflags_single := --enable-sse
archconfflags_double := --enable-sse2
endif
ifeq ($(DEB_HOST_ARCH), powerpc)
archconfflags_single := --enable-altivec
endif
ifneq (,$(filter $(DEB_HOST_ARCH), armhf arm64))
archconfflags_single := --enable-neon --with-slow-timer
endif
endif
ifneq (,$(findstring nog77,$(DEB_BUILD_OPTIONS)))
archconfflags := $(archconfflags) F77="gfortran"
else
archconfflags := $(archconfflags) F77="gfortran -ff2c"
endif
# common configure options
archconfflags := $(archconfflags) --prefix=/usr --enable-shared --enable-threads --enable-openmp --enable-mpi --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) MPILIBS="$(shell mpicc --showme:link)"
%:
dh $@
override_dh_auto_build-arch:
# single precision
./configure --enable-single $(archconfflags) $(archconfflags_single)
$(MAKE)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
( cd tests ; $(MAKE) smallcheck )
endif
$(MAKE) install DESTDIR=`pwd`/debian/tmp-single
#
# double precision
./configure $(archconfflags) $(archconfflags_double)
$(MAKE)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
( cd tests ; $(MAKE) smallcheck )
endif
$(MAKE) install DESTDIR=`pwd`/debian/tmp-double
# long double precision
ifeq (long,$(LONG))
./configure --enable-long-double $(archconfflags)
$(MAKE)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
( cd tests ; $(MAKE) smallcheck )
endif
$(MAKE) install DESTDIR=`pwd`/debian/tmp-long;
endif
ifeq (quad,$(QUAD))
# quad precision
./configure $(archconfflags) --enable-quad-precision --disable-mpi
$(MAKE)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
( cd tests ; $(MAKE) smallcheck )
endif
$(MAKE) install DESTDIR=`pwd`/debian/tmp-quad
endif
override_dh_auto_build-indep:
-(cd doc ; $(MAKE) -j1 -k clean)
-rm -f doc/*.info* doc/rfftwnd.png doc/html/*
[ -f doc/Makefile ] || ./configure
cd doc/FAQ && $(MAKE) -j1 fftw-faq.html fftw-faq.ascii
cd doc && $(MAKE) -j1 && $(MAKE) -j1 html
# Those are actually handled by override_dh_auto_build
override_dh_auto_configure:
override_dh_auto_test:
override_dh_auto_install:
override_dh_auto_clean:
(cd doc ; [ ! -f Makefile ] || $(MAKE) -k clean)
[ ! -f Makefile ] || $(MAKE) distclean
-rm -f *.pc tools/*wisdom tools/*wisdom.1
-find . -name "*.la" | xargs -r rm -f
-rm -f test_long_long-double
-rm -f config.cache config.status config.log
-rm -rf debian/tmp-single debian/tmp-double debian/tmp-long debian/tmp-quad
rm -f mpi/mpi-bench
chmod -R g-s .
override_dh_installdocs-arch:
dh_installdocs -A README NEWS debian/README.Debian
override_dh_installchangelogs-indep:
dh_installchangelogs ChangeLog
override_dh_installchangelogs-arch:
dh_installchangelogs -XChangeLog
override_dh_install-arch:
set -e && for s in $(PREC); do \
dh_install -plibfftw3-bin --sourcedir=debian/tmp-$$s; \
dh_install -plibfftw3-$${s}3 --sourcedir=debian/tmp-$$s; \
dh_install -plibfftw3-dev --sourcedir=debian/tmp-$$s; \
if [ $$s != "quad" ]; then \
dh_install -plibfftw3-mpi3 --sourcedir=debian/tmp-$$s; \
dh_install -plibfftw3-mpi-dev --sourcedir=debian/tmp-$$s; \
rm debian/libfftw3-$${s}3/usr/lib/$(DEB_HOST_MULTIARCH)/libfftw3*mpi*; \
fi; \
done
rm debian/libfftw3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libfftw3*mpi* \
debian/libfftw3-dev/usr/include/*mpi*
chrpath --delete debian/libfftw3-mpi3/usr/lib/$(DEB_HOST_MULTIARCH)/libfftw3*mpi*so*
find $(CURDIR)/debian/libfftw3-dev -type d -empty -delete
|