File: rules

package info (click to toggle)
hdf-eos4 3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,960 kB
  • sloc: ansic: 43,570; sh: 11,324; fortran: 9,649; makefile: 261
file content (53 lines) | stat: -rwxr-xr-x 1,580 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
BUILDDIR:=$(shell pwd)

LIBS := -ljpeg -lz -lm -lsz

CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
CFLAGS_NOWARN:=$(shell dpkg-buildflags --get CFLAGS | sed -e 's/-Werror=implicit-function-declaration//' )
CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS)

# Set SHELL in examples/ makefiles to /bin/sh ?
# if set to sh then autoconf breaks
# export CONFIG_SHELL=/bin/sh

# Magic debhelper rule
%:
	dh   $@ 

override_dh_auto_clean:
	find . -type l -delete
	rm -f libtool config.status config.log samples/*.hdf testdrivers/*/*.hdf

override_dh_auto_test:
	@echo "Tests disabled"

override_dh_auto_configure:
	dh_auto_configure -- --enable-shared --with-pic \
		--enable-fortran \
		CFLAGS="$(CFLAGS_NOWARN)" \
		CPPFLAGS="$(CPPFLAGS) -Df2cFortran -I/usr/include/hdf" \
		LIBS="$(LIBS)"
	# FIXME: a sort of hack
	ln -sf testswath.f testdrivers/swath/testswath77.f
	ln -sf testpoint.f testdrivers/point/testpoint77.f

override_dh_auto_install:
	dh_auto_install
	# Undo permissions we don't want
	$(MAKE) -C samples clean
	chmod -x samples/*
	# Lose the builddir for reproducibility
	sed -e 's%${BUILDDIR}%/nonexistant%' < samples/Makefile > x
	mv x samples/Makefile
	# Symlinks
	dh_link -p libhdfeos0t64 $(LIBDIR)/libhdfeos.so.0.0.0  $(LIBDIR)/libhdfeos.so.0
	dh_link -p libhdfeos-dev $(LIBDIR)/libhdfeos.so.0.0.0 $(LIBDIR)/libhdfeos.so
	# Don't ship
	rm -f debian/tmp/usr/lib/*/libhdfeos.la