File: rules

package info (click to toggle)
pnetcdf 1.7.0-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 9,212 kB
  • ctags: 7,127
  • sloc: ansic: 57,151; f90: 11,972; cpp: 8,771; fortran: 8,578; sh: 3,235; perl: 2,728; makefile: 2,265; yacc: 1,227; lex: 216
file content (49 lines) | stat: -rwxr-xr-x 1,671 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
#!/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)

SHLIB=libpnetcdf.so.0d

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

override_dh_auto_clean:
	rm -rf build-*

override_dh_auto_configure:
	dh_auto_configure  --builddirectory=build-static 
	dh_auto_configure  --builddirectory=build-shared -- \
		CFLAGS=" $(CFLAGS) -fPIC"  CXXFLAGS="$(CXXFLAGS) -fPIC" \
		FCFLAGS="$(FCFLAGS) -fPIC" FFLAGS="$(FFLAGS) -fPIC"

override_dh_auto_build:
	$(MAKE) -C build-static
	$(MAKE) -C build-shared
	( cd build-shared/src/lib && \
		mpicxx -shared -o $(SHLIB) -Wl,--soname -Wl,$(SHLIB) $(LDFLAGS) \
		-Wl,--whole-archive libpnetcdf.a -Wl,--no-whole-archive -lgfortran )
	chrpath -d ./build-shared/src/lib/libpnetcdf.so.0d

override_dh_auto_install:
	$(MAKE) -C build-static install DESTDIR=$(DESTDIR)
	mkdir -p $(DESTDIR)/$(LIBDIR) $(DESTDIR)/usr/share $(DESTDIR)/$(INCDIR)
	cp $(DESTDIR)/usr/include/pnetcdf.inc $(DESTDIR)/usr/include/pnetcdf.mod $(DESTDIR)/$(INCDIR)
	cp -a $(DESTDIR)/usr/man $(DESTDIR)/usr/share
	cp -a $(DESTDIR)/usr/lib/lib* $(DESTDIR)/$(LIBDIR)
	cp -a build-shared/src/lib/$(SHLIB) $(DESTDIR)/$(LIBDIR)
	dh_link -p libpnetcdf-dev $(LIBDIR)/$(SHLIB) $(LIBDIR)/libpnetcdf.so