File: rules

package info (click to toggle)
fftw 2.1.5-4.2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 6,864 kB
  • ctags: 3,761
  • sloc: ansic: 65,239; sh: 12,650; ml: 3,084; perl: 2,894; makefile: 416; fortran: 102
file content (139 lines) | stat: -rwxr-xr-x 4,610 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
#!/usr/bin/make -f

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

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

CONFFLAGS := --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-shared --enable-mpi --enable-threads

ifeq ($(ARCHITECTURE), i386)
  ARCHCONFFLAGS := --enable-i386-hacks
endif

build: build-arch build-indep

autoreconf-stamp: 
	autoreconf -f -i -I.
	touch autoreconf-stamp

build-arch: build-arch-stamp
build-arch-stamp: autoreconf-stamp 
	dh_testdir
	# single precision
	F77=gfortran CFLAGS="$(CFLAGS)" CC=mpicc ./configure $(CONFFLAGS) --enable-float --enable-type-prefix $(ARCHCONFFLAGS)
	$(MAKE)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	#$(MAKE) -C tests check
	./tests/fftw_test  -t -e -v -p 1024 -x 1
	./tests/rfftw_test -t -e -v -p 1024 -x 1
endif
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp-single
	$(MAKE) clean
	# double precision
	F77=gfortran CFLAGS="$(CFLAGS)" CC=mpicc ./configure $(CONFFLAGS) $(ARCHCONFFLAGS)
	$(MAKE)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	#$(MAKE) -C tests check
	./tests/fftw_test  -t -e -v -p 1024 -x 1
	./tests/rfftw_test -t -e -v -p 1024 -x 1
endif
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp-double
	touch build-arch-stamp

build-indep: build-indep-stamp
build-indep-stamp: autoreconf-stamp
	# docs
	F77=gfortran CFLAGS="$(CFLAGS)" ./configure $(CONFFLAGS) --enable-float --enable-type-prefix $(ARCHCONFFLAGS)
	rm -f doc/fftw.info
	$(MAKE) -C doc
	$(MAKE) -C doc html 
	$(MAKE) -C FAQ 
	touch build-indep-stamp

clean: clean1st 
clean1st:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp autoreconf-stamp
	# Add here commands to clean up after the build process.
	[ ! -f Makefile ] || $(MAKE) distclean
	[ ! -f Makefile ] || $(MAKE) -C doc clean-local
	[ ! -f Makefile ] || $(MAKE) -C FAQ clean
	rm -f compile fftw/libfftw.la mpi/libfftw_mpi.la mpi/librfftw_mpi.la rfftw/librfftw.la threads/libfftw_threads.la threads/librfftw_threads.la
	rm -rf $(CURDIR)/debian/tmp-*
	dh_clean 

install: install-indep install-arch
install-indep:
	dh_testdir
	dh_testroot
	dh_clean -k -i
	dh_installdirs -i
	dh_install -p fftw-docs FAQ/fftw-faq.html/*.html usr/share/doc/fftw-docs/FAQ
	dh_install -p fftw-docs doc/*.html usr/share/doc/fftw-docs/html
	dh_install -p fftw-docs doc/*.gif usr/share/doc/fftw-docs/html
	#
	dh_install -p fftw-docs debian/mpi/Makefile mpi/TOMS_transpose.h \
		mpi/fftw_mpi_test.c mpi/rfftw_mpi_test.c mpi/sched.h \
		mpi/test_sched.c mpi/test_transpose_mpi.c \
		usr/share/doc/fftw-docs/examples/mpi
	#
	dh_install -p fftw-docs debian/tests/Makefile fftw/config.h fftw/fftw-int.h usr/share/doc/fftw-docs/examples/tests
	for i in README fftw_test.c rfftw_test.c test_main.c test_main.h; do \
		dh_install -p fftw-docs tests/$$i usr/share/doc/fftw-docs/examples/tests; \
	done
	#
	dh_install -p fftw-docs debian/threads/Makefile usr/share/doc/fftw-docs/examples/threads
	for i in fftw_threads-int.h fftw_threads_test.c rfftw_threads_test.c; do \
		dh_install -p fftw-docs threads/$$i usr/share/doc/fftw-docs/examples/threads; \
	done

install-arch:
	dh_testdir
	dh_testroot
	dh_clean -k -s
	dh_installdirs -s
	mkdir -p $(CURDIR)/debian/tmp-single/usr/share/doc/sfftw-dev/fortran
	mkdir -p $(CURDIR)/debian/tmp-double/usr/share/doc/fftw-dev/fortran
	cp -a fortran/fftw_f77.i $(CURDIR)/debian/tmp-single/usr/share/doc/sfftw-dev/fortran/
	cp -a fortran/fftw_f77.i $(CURDIR)/debian/tmp-double/usr/share/doc/fftw-dev/fortran/
	dh_install --sourcedir=$(CURDIR)/debian/tmp-single -p sfftw2
	dh_install --sourcedir=$(CURDIR)/debian/tmp-single -p sfftw-dev
	dh_install --sourcedir=$(CURDIR)/debian/tmp-double -p fftw2
	dh_install --sourcedir=$(CURDIR)/debian/tmp-double -p fftw-dev

binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installexamples
	dh_installman
	dh_installinfo
	dh_link
	dh_strip
	dh_compress -X.c -X.h -XMakefile
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch clean1st autoreconf-stamp