File: rules

package info (click to toggle)
yaml-cpp0.3 0.3.0-1.2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 696 kB
  • ctags: 1,783
  • sloc: cpp: 10,571; ansic: 512; makefile: 34
file content (49 lines) | stat: -rwxr-xr-x 1,290 bytes parent folder | download | duplicates (3)
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

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

CPPFLAGS :=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS   :=$(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS :=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS  :=$(shell dpkg-buildflags --get LDFLAGS)

export DEB_HOST_MULTIARCH CPPFLAGS CFLAGS CXXFLAGS LDFLAGS

override_dh_auto_configure:
	dh_testdir
	mkdir build-static; cd build-static; \
		cmake .. -DCMAKE_INSTALL_PREFIX=/usr
	mkdir build-shared; cd build-shared; \
		cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON

override_dh_auto_build:
	dh_testdir
	$(MAKE) -C build-static
	$(MAKE) -C build-shared

override_dh_auto_install:
	dh_testdir
	dh_prep
	$(MAKE) -C build-static install DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C build-shared install DESTDIR=$(CURDIR)/debian/tmp
	mkdir debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
	mv debian/tmp/usr/lib/lib* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
	sed -i -e 's/lib$$/lib\/$(DEB_HOST_MULTIARCH)/' \
		debian/tmp/usr/lib/pkgconfig/yaml-cpp.pc

clean:
	dh_testdir
	dh_auto_clean
	dh_clean
	rm -rf build-static build-shared

%:
	dh $@

.PHONY: clean