File: rules

package info (click to toggle)
leveldb 1.23-6
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,572 kB
  • sloc: cpp: 20,432; ansic: 623; sh: 69; makefile: 49
file content (68 lines) | stat: -rwxr-xr-x 1,895 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
#!/usr/bin/make -f
# -*- makefile -*-

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

include /usr/share/dpkg/architecture.mk

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

export CXXFLAGS+=$(CPPFLAGS)
export CFLAGS+=$(CPPFLAGS)

export DESTDIR=debian/tmp
export PREFIX=/usr
export LIBDIR=lib/$(DEB_HOST_MULTIARCH)

ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
    OPT=-O0
else
    OPT=-O2
endif

export OPT += -g -DNDEBUG

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -Bobj-$(DEB_HOST_GNU_TYPE)/out-static -- -DCMAKE_CXX_STANDARD=17
	dh_auto_configure -Bobj-$(DEB_HOST_GNU_TYPE)/out-shared -- -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON

override_dh_auto_build:
	dh_auto_build -Bobj-$(DEB_HOST_GNU_TYPE)/out-static
	dh_auto_build -Bobj-$(DEB_HOST_GNU_TYPE)/out-shared

override_dh_auto_install:
	dh_auto_install -Bobj-$(DEB_HOST_GNU_TYPE)/out-static
	dh_auto_install -Bobj-$(DEB_HOST_GNU_TYPE)/out-shared

override_dh_installdocs:
	dh_installdocs
	echo "Convert md files to HTML"
	for md in `ls debian/leveldb-doc/usr/share/doc/leveldb-doc/*.md`; do \
		html=`echo $${md} | cut -d. -f1`.html; \
		markdown -f fencedcode $${md} >$${html}; \
	done

override_dh_auto_test:
ifeq ($(DEB_HOST_ARCH),mips)
	@echo "======== will not abort on test(s) failure ========"
	dh_auto_test --no-parallel -Bobj-$(DEB_HOST_GNU_TYPE)/out-static \
		|| true
	dh_auto_test --no-parallel -Bobj-$(DEB_HOST_GNU_TYPE)/out-shared \
	       	|| true
else
	dh_auto_test --no-parallel -Bobj-$(DEB_HOST_GNU_TYPE)/out-static
	dh_auto_test --no-parallel -Bobj-$(DEB_HOST_GNU_TYPE)/out-shared
endif

get-orig-source:
	debian/get-git-source.sh

.PHONY: override_dh_auto_configure override_dh_auto_build \
       	override_dh_auto_install override_dh_installdocs \
	override_dh_auto_test