File: rules

package info (click to toggle)
fftw3 3.1.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 14,016 kB
  • ctags: 10,195
  • sloc: ansic: 154,845; asm: 33,960; ml: 12,962; sh: 8,943; perl: 1,392; makefile: 878; fortran: 108
file content (138 lines) | stat: -rwxr-xr-x 3,955 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
#!/usr/bin/make -f

ARCHITECTURE := $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFLAGS := -g -Wall

# 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 (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
ifeq ($(ARCHITECTURE), i386)
	archconfflags_single := --enable-sse
	archconfflags_double := --enable-sse2
	archconfflags := $(archconfflags) --with-gcc-arch=pentium4
endif
ifeq ($(ARCHITECTURE), m68k)
	#CFLAGS='-g -Wall -O0'
	#archconfflags :=
endif
ifeq ($(ARCHITECTURE), powerpc)
	# altivec detection and compilation broken
	archconfflags_single := --enable-altivec
	archconfflags := $(archconfflags) --with-gcc-arch=G5
	CFLAGS += -maltivec
endif
endif

SETCFLAGS := CFLAGS='$(CFLAGS)'

# common configure options
archconfflags := $(archconfflags) --prefix=/usr --enable-shared --enable-threads --enable-portable-binary

build-arch:
	# single precision
	$(SETCFLAGS) ./configure --enable-single $(archconfflags) $(archconfflags_single)
	$(MAKE)
	( cd tests ; $(MAKE) smallcheck )
	$(MAKE) install DESTDIR=`pwd`/debian/tmp-single
	#
	# double precision
	$(SETCFLAGS) ./configure $(archconfflags) $(archconfflags_double)
	$(MAKE)
	( cd tests ; $(MAKE) smallcheck )
	$(MAKE) install DESTDIR=`pwd`/debian/tmp-double
	#
	# long double precision
	# build only on architectures where double != long-double
	gcc -o test_long_long-double debian/test_long_long-double.c 
	if ! ./test_long_long-double; then \
		$(SETCFLAGS) ./configure --enable-long-double $(archconfflags) && \
		$(MAKE) && \
		( cd tests ; $(MAKE) smallcheck ) && \
		$(MAKE) install DESTDIR=`pwd`/debian/tmp-long-double; \
	fi
	touch build-arch

build-indep:
	-(cd doc ; $(MAKE) -k clean)
	-rm -f doc/*.info{,-[0-9]} doc/rfftwnd.png doc/html/*
	cd doc/FAQ && $(MAKE) fftw-faq.html fftw-faq.ascii
	cd doc && $(MAKE) && $(MAKE) html
	touch build-indep

build: build-arch

clean:
	dh_testdir
	dh_testroot
	rm -f build-arch build-indep
	-(cd doc ; $(MAKE) -k clean)
	-$(MAKE) -k distclean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif
	-rm -f doc/*.info{,-[0-9]} doc/rfftwnd.png doc/html/*
	-rm -f tools/*-wisdom.1 tools/fftw*-wisdom
	-rm -f *.la threads/*.la *.pc
	-rm -f test_long_long-double
	-rm -f config.cache config.status config.log
	-rm -rf debian/tmp-{single,double}
	chmod -R g-s .
	dh_clean

binary-indep: build-indep
	# build fftw3-doc
	dh_clean -k -i
	dh_testdir
	dh_testroot
	dh_installdocs -i README NEWS
	dh_installinfo -i
	dh_installchangelogs -i ChangeLog
	dh_compress -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build-arch
	# build fftw3
	dh_clean -k -a
	dh_installdocs -a README NEWS
	dh_installchangelogs -a ChangeLog
	dh_installexamples -a
	dh_installdirs -a
	dh_install -a --sourcedir=debian/tmp-single
	dh_install -a --sourcedir=debian/tmp-double
	dh_install -a --sourcedir=debian/tmp-long-double
	dh_installman -a
	dh_strip -a
	dh_compress -a -X.c -X.pl -X.am -X.in
	dh_fixperms -a
	dh_makeshlibs -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a
	
binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean