File: rules

package info (click to toggle)
dieharder 3.31.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 4,532 kB
  • sloc: ansic: 17,042; sh: 4,377; makefile: 498; perl: 73; php: 2
file content (182 lines) | stat: -rwxr-xr-x 4,990 bytes parent folder | download
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/usr/bin/make -f
# 							-*- makefile -*-
# debian/rules file for the Debian/GNU Linux dieharder package
# Copyright 2007 - 2019  Dirk Eddelbuettel <edd@debian.org>

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# For autoconf 2.52 and newer only
CONFFLAGS =
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
else
  CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

DEBUGFLAGS=-g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	DEBUGFLAGS += -O0
else
	DEBUGFLAGS += -O3
ifeq ($(arch),m68k)
	DEBUGFLAGS += -O0
endif
endif



# edd 18 Nov 2006:  add -fexceptions, but don't use -O3 as
#                   'make check' as gcc hangs in cblas/ after test_ger.c
# edd 27 Dec 2015:  add dpkg-buildflags as well
CFLAGS	   :=-Wall -pipe -fexceptions -D_REENTRANT $(DEBUGFLAGS) $(shell dpkg-buildflags --get CFLAGS)
# edd 29 Sep 2005   alpha needs -mieee with gcc 4.0
ifeq ($(arch),alpha)
CFLAGS	+= -mieee
endif

configure: configure-stamp
configure-stamp:
	dh_testdir
	dh_testdir

	ln -sf /usr/share/misc/config.sub .
	ln -sf /usr/share/misc/config.guess .
	rm -f config.cache
        #./autogen.sh
	autoreconf -ifv

	./configure 	CFLAGS="$(CFLAGS)" 		\
			--prefix=/usr 			\
			$(CONFFLAGS)

        # patch libtool re rpath (see lintian docu)
	sed < libtool > libtool-2 \
			-e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \
			-e '/^archive_cmds="/s/"$$/ \\$$deplibs"/'
	mv libtool-2 libtool
	chmod 755 libtool
        # end libtool rpath patch
	touch configure-stamp

build: configure build-arch build-indep
build-arch: configure-stamp build-stamp
build-indep: configure-stamp build-stamp
build-stamp:
	dh_testdir
	$(MAKE)

        # manually call for manual build
#	(cd manual && make && cd -)
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

        # Robert uses a non-standard way of building things; make clean does call
        # configure and fails in the chroot/build unless we run autogen.sh first. Sigh
        # so we fixed this by deleting Makefile from the upstream tarball. Sigh.
	#[ ! -f Makefile ] || $(MAKE) clean distclean

	rm -rf buildroot
	rm -f dieharder.pdf
	rm -f config.guess config.sub config.status

        # extra cleanup in manual/
	rm -vf manual/dieharder.dvi manual/dieharder.pdf

	dh_clean -d

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

#	# Add here commands to install the package into debian/tmp.
#	#$(MAKE) prefix=`pwd`/debian/tmp/usr install
	$(MAKE) prefix=`pwd`/debian/dieharder/usr install

#	(cd debian/dieharder/usr/lib && \
#		ls -l )
#		rm -vf libdieharder.so )
#		ln -s libdieharder.so.2.*.* libdieharder.so.2 && \
#		ln -s libdieharder.so.2 libdieharder.so )

	dh_movefiles --sourcedir=debian/dieharder \
				-plibdieharder3 -plibdieharder-dev

#	install -m 0644 manual/dieharder.pdf \
#		`pwd`/debian/libdieharder-dev/usr/share/doc/libdieharder-dev/

        # cleanups to make lintian happy
	rmdir -v `pwd`/debian/dieharder/usr/share/man/man3 	\
		 `pwd`/debian/dieharder/usr/include/dieharder	\
		 `pwd`/debian/dieharder/usr/include/

        # edd 03 Jun 2011
        # empty dependency_lib in .la files (cf #621199)
	find debian/dieharder/ -name \*.la | \
		xargs perl -p -i -e "s/dependency_libs='.*'/dependency_libs=''/"


# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will
# affect _all_ packages. Anything you want to only affect one package
# should be put in another target, such as the install target.
binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_lintian
#	dh_installdebconf
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installcatalogs
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installman
#	dh_installcron
#	dh_installinfo
#	dh_undocumented
	dh_strip
	dh_link
	dh_compress
	dh_fixperms
#	dh_perl
#	dh_python
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
binary-indep: build install
# (Uncomment this next line if you have such packages.)
#	 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

# Any other binary targets build just one binary package at a time.
binary-%: build install
	make -f debian/rules binary-common DH_OPTIONS=-p$*

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary-common binary install