| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
# debian/rules file for the Debian/GNU Linux dieharder package |
| 4 |
# Copyright 2007 - 2019 Dirk Eddelbuettel <[email protected]> |
| 5 |
|
| 6 |
# Uncomment this to turn on verbose mode. |
| 7 |
#export DH_VERBOSE=1 |
| 8 |
|
| 9 |
# This has to be exported to make some magic below work. |
| 10 |
export DH_OPTIONS |
| 11 |
|
| 12 |
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 13 |
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
| 14 |
|
| 15 |
# For autoconf 2.52 and newer only |
| 16 |
CONFFLAGS = |
| 17 |
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) |
| 18 |
CONFFLAGS += --build $(DEB_HOST_GNU_TYPE) |
| 19 |
else |
| 20 |
CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) |
| 21 |
endif |
| 22 |
|
| 23 |
DEBUGFLAGS=-g |
| 24 |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 25 |
DEBUGFLAGS += -O0 |
| 26 |
else |
| 27 |
DEBUGFLAGS += -O3 |
| 28 |
ifeq ($(arch),m68k) |
| 29 |
DEBUGFLAGS += -O0 |
| 30 |
endif |
| 31 |
endif |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
# edd 18 Nov 2006: add -fexceptions, but don't use -O3 as |
| 36 |
# 'make check' as gcc hangs in cblas/ after test_ger.c |
| 37 |
# edd 27 Dec 2015: add dpkg-buildflags as well |
| 38 |
CFLAGS :=-Wall -pipe -fexceptions -D_REENTRANT $(DEBUGFLAGS) $(shell dpkg-buildflags --get CFLAGS) |
| 39 |
# edd 29 Sep 2005 alpha needs -mieee with gcc 4.0 |
| 40 |
ifeq ($(arch),alpha) |
| 41 |
CFLAGS += -mieee |
| 42 |
endif |
| 43 |
|
| 44 |
configure: configure-stamp |
| 45 |
configure-stamp: |
| 46 |
dh_testdir |
| 47 |
dh_testdir |
| 48 |
|
| 49 |
ln -sf /usr/share/misc/config.sub . |
| 50 |
ln -sf /usr/share/misc/config.guess . |
| 51 |
rm -f config.cache |
| 52 |
#./autogen.sh |
| 53 |
autoreconf -ifv |
| 54 |
|
| 55 |
./configure CFLAGS="$(CFLAGS)" \ |
| 56 |
--prefix=/usr \ |
| 57 |
$(CONFFLAGS) |
| 58 |
|
| 59 |
# patch libtool re rpath (see lintian docu) |
| 60 |
sed < libtool > libtool-2 \ |
| 61 |
-e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \ |
| 62 |
-e '/^archive_cmds="/s/"$$/ \\$$deplibs"/' |
| 63 |
mv libtool-2 libtool |
| 64 |
chmod 755 libtool |
| 65 |
# end libtool rpath patch |
| 66 |
touch configure-stamp |
| 67 |
|
| 68 |
build: configure build-arch build-indep |
| 69 |
build-arch: configure-stamp build-stamp |
| 70 |
build-indep: configure-stamp build-stamp |
| 71 |
build-stamp: |
| 72 |
dh_testdir |
| 73 |
$(MAKE) |
| 74 |
|
| 75 |
# manually call for manual build |
| 76 |
# (cd manual && make && cd -) |
| 77 |
touch build-stamp |
| 78 |
|
| 79 |
clean: |
| 80 |
dh_testdir |
| 81 |
dh_testroot |
| 82 |
rm -f build-stamp configure-stamp |
| 83 |
|
| 84 |
# Robert uses a non-standard way of building things; make clean does call |
| 85 |
# configure and fails in the chroot/build unless we run autogen.sh first. Sigh |
| 86 |
# so we fixed this by deleting Makefile from the upstream tarball. Sigh. |
| 87 |
#[ ! -f Makefile ] || $(MAKE) clean distclean |
| 88 |
|
| 89 |
rm -rf buildroot |
| 90 |
rm -f dieharder.pdf |
| 91 |
rm -f config.guess config.sub config.status |
| 92 |
|
| 93 |
# extra cleanup in manual/ |
| 94 |
rm -vf manual/dieharder.dvi manual/dieharder.pdf |
| 95 |
|
| 96 |
dh_clean -d |
| 97 |
|
| 98 |
install: DH_OPTIONS= |
| 99 |
install: build |
| 100 |
dh_testdir |
| 101 |
dh_testroot |
| 102 |
dh_prep |
| 103 |
dh_installdirs |
| 104 |
|
| 105 |
# # Add here commands to install the package into debian/tmp. |
| 106 |
# #$(MAKE) prefix=`pwd`/debian/tmp/usr install |
| 107 |
$(MAKE) prefix=`pwd`/debian/dieharder/usr install |
| 108 |
|
| 109 |
# (cd debian/dieharder/usr/lib && \ |
| 110 |
# ls -l ) |
| 111 |
# rm -vf libdieharder.so ) |
| 112 |
# ln -s libdieharder.so.2.*.* libdieharder.so.2 && \ |
| 113 |
# ln -s libdieharder.so.2 libdieharder.so ) |
| 114 |
|
| 115 |
dh_movefiles --sourcedir=debian/dieharder \ |
| 116 |
-plibdieharder3t64 -plibdieharder-dev |
| 117 |
|
| 118 |
# install -m 0644 manual/dieharder.pdf \ |
| 119 |
# `pwd`/debian/libdieharder-dev/usr/share/doc/libdieharder-dev/ |
| 120 |
|
| 121 |
# cleanups to make lintian happy |
| 122 |
rmdir -v `pwd`/debian/dieharder/usr/share/man/man3 \ |
| 123 |
`pwd`/debian/dieharder/usr/include/dieharder \ |
| 124 |
`pwd`/debian/dieharder/usr/include/ |
| 125 |
|
| 126 |
# edd 03 Jun 2011 |
| 127 |
# empty dependency_lib in .la files (cf #621199) |
| 128 |
find debian/dieharder/ -name \*.la | \ |
| 129 |
xargs perl -p -i -e "s/dependency_libs='.*'/dependency_libs=''/" |
| 130 |
|
| 131 |
|
| 132 |
# This single target is used to build all the packages, all at once, or |
| 133 |
# one at a time. So keep in mind: any options passed to commands here will |
| 134 |
# affect _all_ packages. Anything you want to only affect one package |
| 135 |
# should be put in another target, such as the install target. |
| 136 |
binary-common: |
| 137 |
dh_testdir |
| 138 |
dh_testroot |
| 139 |
dh_installchangelogs |
| 140 |
dh_installdocs |
| 141 |
dh_installexamples |
| 142 |
dh_installmenu |
| 143 |
dh_lintian |
| 144 |
# dh_installdebconf |
| 145 |
# dh_installlogrotate |
| 146 |
# dh_installemacsen |
| 147 |
# dh_installcatalogs |
| 148 |
# dh_installpam |
| 149 |
# dh_installmime |
| 150 |
# dh_installinit |
| 151 |
# dh_installman |
| 152 |
# dh_installcron |
| 153 |
# dh_installinfo |
| 154 |
# dh_undocumented |
| 155 |
dh_strip |
| 156 |
dh_link |
| 157 |
dh_compress |
| 158 |
dh_fixperms |
| 159 |
# dh_perl |
| 160 |
# dh_python |
| 161 |
dh_makeshlibs |
| 162 |
dh_installdeb |
| 163 |
dh_shlibdeps |
| 164 |
dh_gencontrol |
| 165 |
dh_md5sums |
| 166 |
dh_builddeb |
| 167 |
|
| 168 |
# Build architecture independant packages using the common target. |
| 169 |
binary-indep: build install |
| 170 |
# (Uncomment this next line if you have such packages.) |
| 171 |
# $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
| 172 |
|
| 173 |
# Build architecture dependant packages using the common target. |
| 174 |
binary-arch: build install |
| 175 |
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common |
| 176 |
|
| 177 |
# Any other binary targets build just one binary package at a time. |
| 178 |
binary-%: build install |
| 179 |
make -f debian/rules binary-common DH_OPTIONS=-p$* |
| 180 |
|
| 181 |
binary: binary-indep binary-arch |
| 182 |
.PHONY: build clean binary-indep binary-arch binary-common binary install |