File: rules

package info (click to toggle)
libint2 2.6.0-13
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 63,548 kB
  • sloc: ansic: 842,667; cpp: 44,138; sh: 3,275; makefile: 1,097; f90: 677; perl: 482; python: 226
file content (78 lines) | stat: -rwxr-xr-x 2,235 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
#!/usr/bin/make -f
# -*- makefile -*-

ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel armhf armel hppa m68k powerpc sh4 x32))
  LMAX=4
  DEB_CXXFLAGS_MAINT_APPEND += --param ggc-min-expand=20
  ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel))
    CXX_OPTFLAGS=-g0 -Os -Wall -DNDEBUG
  else
    CXX_OPTFLAGS=-g0 -O2 -Wall -DNDEBUG
  endif
else
  LMAX=5
  CXX_OPTFLAGS=-g -O2 -Wall -DNDEBUG
endif

UPSTREAM_VERSION=$$(dpkg-parsechangelog -S Version | sed -e s/^[0-9]*:// -e 's/-[^-]*$$//')
CPPFLAGS=-I/usr/include/eigen3

export CPPFLAGS
export DEB_CXXFLAGS_MAINT_APPEND

%:
	dh $@ --sourcedir=sourcedir


override_dh_auto_configure: prepare_sourcedir
	dh_auto_configure --					\
		--with-cxxgen-optflags='$(CXX_OPTFLAGS)'	\
		--with-cxx-optflags='$(CXX_OPTFLAGS)'		\
		--with-build-id=''				\
		--enable-shared					\
		--enable-fortran				\
		--with-cmakedir=/usr/share/cmake/libint2

prepare_sourcedir:
	dh_auto_configure --sourcedir=$(CURDIR) --		\
		--with-cxxgen-optflags='$(CXX_OPTFLAGS)'	\
		--with-cxx-optflags='$(CXX_OPTFLAGS)'		\
		--enable-eri=1					\
		--enable-eri2=1					\
		--enable-eri3=1					\
		--with-max-am=${LMAX}				\
		--with-eri-max-am=${LMAX},$$(( $(LMAX)-1))	\
		--with-eri2-max-am=$$(($(LMAX)+2)),$$(($(LMAX)+1))	\
		--with-eri3-max-am=$$(($(LMAX)+2)),$$(($(LMAX)+1))	\
		--with-opt-am=3 				\
		--enable-generic-code				\
		--disable-unrolling
	$(MAKE) -j4 export
	rm -rf sourcedir
	tar xf libint-$(UPSTREAM_VERSION).tgz
	mv libint-$(UPSTREAM_VERSION) sourcedir
ifeq ($(DEB_BUILD_ARCH_BITS), 32)
	(cd sourcedir && patch -p2 < ../debian//patches/fix_generated_source_for_32bit_builds.patch)
endif

override_dh_autoreconf:
	dh_autoreconf ./autogen.sh

override_dh_auto_build:
	dh_auto_build
	(cd sourcedir/fortran;  make libint_f.o ENABLE_FORTRAN=yes)

override_dh_auto_install:
	dh_auto_install
	cp ./sourcedir/fortran/libint_f.mod debian/tmp/usr/include

override_dh_auto_clean:
	dh_auto_clean --sourcedir=$(CURDIR)
	rm -f include/libint2/basis.h include/libint2/config.h src/lib/libint/MakeVars.features tests/MakeVars
	rm -rf sourcedir libint-$(UPSTREAM_VERSION).tgz

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	dh_auto_test
	(cd sourcedir/fortran && $(MAKE) -k check_test)
endif