File: rules

package info (click to toggle)
pnetcdf 1.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 30,120 kB
  • sloc: ansic: 84,714; f90: 10,505; fortran: 9,028; cpp: 8,858; sh: 4,788; perl: 2,833; makefile: 2,812; yacc: 1,227; lex: 216
file content (70 lines) | stat: -rwxr-xr-x 2,454 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
#!/usr/bin/make -f

export DH_VERBOSE=1

DESTDIR:=$(CURDIR)/debian/tmp/
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
INCDIR:=/usr/include/$(DEB_HOST_MULTIARCH)

# To enable all, uncomment following line
DEB_BUILD_MAINT_OPTIONS:= hardening=+all
DEB_CFLAGS_MAINT_APPEND:= -Wall -pedantic 
DEB_CXXFLAGS_MAINT_APPEND:= -Wall -pedantic
DEB_FCFLAGS_MAINT_APPEND:= -Wall -pedantic
DEB_FFLAGS_MAINT_APPEND:= -Wall -pedantic
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) -Wl,--no-as-needed -lgfortran -Wl,--as-needed

# See #957692
GF10_FLAGS:=$(if $(filter $(shell readlink /usr/bin/gfortran), gfortran-10), \
                 -fallow-invalid-boz -fallow-argument-mismatch, )
FFLAGS=$(shell dpkg-buildflags --get FFLAGS) $(GF10_FLAGS)
FCFLAGS=$(FFLAGS)

export FC=gfortran
export OMPI_FC=gfortran
export MPIF77=mpif77
export MPIF90=mpif90
export FFLAGS FCFLAGS
SHLIB=libpnetcdf.so.0d

# The magic debhelper  rule
%:
	dh $@ # --with fortran_mod

override_dh_auto_clean:
	rm -rf build-*

override_dh_auto_configure:
	dh_auto_configure  --builddirectory=build-static 
		OMPI_CFLAGS=" $(CFLAGS)"   OMPI_CXXFLAGS="$(CXXFLAGS)" \
		OMPI_FCFLAGS="$(FCFLAGS)" OMPI_FFLAGS="$(FFLAGS)" \
		OMPI_LDFLAGS="$(LDFLAGS)"  \
		OMPI_FC=gfortran FC=gfortran
	dh_auto_configure  --builddirectory=build-shared -- \
		CFLAGS=" $(CFLAGS) -fPIC -g"  CXXFLAGS="$(CXXFLAGS) -fPIC -g" \
		FCFLAGS="$(FCFLAGS) -fPIC -g" FFLAGS="$(FFLAGS) -fPIC -g" \
		LDFLAGS="$(LDFLAGS) -g" \
		OMPI_CFLAGS=" $(CFLAGS) -fPIC -g"  OMPI_CXXFLAGS="$(CXXFLAGS) -fPIC -g" \
		OMPI_FCFLAGS="$(FCFLAGS) -fPIC -g" OMPI_FFLAGS="$(FFLAGS) -fPIC -g" \
		OMPI_LDFLAGS="$(LDFLAGS) -g"  \
		OMPI_FC=gfortran FC=gfortran

override_dh_auto_build:
	$(MAKE) -C build-static
	$(MAKE) -C build-shared
	( cd build-shared/src/libs && \
		mpicxx -shared -o $(SHLIB) -Wl,--soname -Wl,$(SHLIB) $(LDFLAGS) \
		-Wl,--whole-archive .libs/libpnetcdf.a -Wl,--no-whole-archive  )
	chrpath -d ./build-shared/src/libs/libpnetcdf.so.0d
	for d in ncmpidiff  ncmpidump  ncmpigen  ncoffsets  ncvalidator  pnetcdf_version ; do \
		chrpath -d ./build-shared/src/utils/$$d/$$d ;  \
		chrpath -d ./build-static/src/utils/$$d/$$d ; done

override_dh_auto_test:
	( cd build-static/test && $(MAKE) check ) || true
	( cd build-shared/test && $(MAKE) check ) || true

override_dh_auto_install:
	$(MAKE) -C build-static install DESTDIR=$(DESTDIR)
	find $(DESTDIR) -name '*.la' -delete