File: rules

package info (click to toggle)
libopenobex 1.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 972 kB
  • ctags: 1,552
  • sloc: ansic: 9,988; xml: 407; makefile: 96
file content (128 lines) | stat: -rwxr-xr-x 4,007 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/make -f
# -*- makefile -*-
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

CFLAGS = 
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS_RELEASE = -O0 -g -DNDEBUG $(CFLAGS)
	CFLAGS_DEBUG   = -O0 -g $(CFLAGS)
else
	CFLAGS_RELEASE = -O2 -g -DNDEBUG $(CFLAGS)
	CFLAGS_DEBUG   = -O2 -g $(CFLAGS)
endif

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

BUILD_TYPE = Release
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	BUILD_TYPE = Debug
endif

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    MAKEFLAGS += -j$(NUMJOBS)
endif

BUILD_FLAGS = -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
	      -DCMAKE_C_FLAGS_RELEASE="$(CFLAGS_RELEASE)" -DCMAKE_C_FLAGS_DEBUG="$(CFLAGS_DEBUG)" \
              -DCMAKE_SKIP_RPATH=ON -DCMAKE_VERBOSE_MAKEFILE=ON 
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
	BUILD_FLAGS += -DCMAKE_SYSTEM_NAME=$(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) \
                       -DCMAKE_SYSTEM_PROCESSOR=$(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU) \
                       -DCMAKE_C_COMPILER=$(DEB_BUILD_GNU_TYPE)-gcc
endif

debian/build/CMakeCache.txt:
	mkdir -p debian/build
	cd $(CURDIR)/debian/build && \
	  cmake $(BUILD_FLAGS) ../..

debian/build: debian/build/CMakeCache.txt

debian/build-static/CMakeCache.txt:
	mkdir -p debian/build-static
	cd $(CURDIR)/debian/build-static && \
	  cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_DOCUMENTATION=OFF $(BUILD_FLAGS) ../..

debian/build-static: debian/build-static/CMakeCache.txt

build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp: debian/build debian/build-static
	dh_testdir
	$(MAKE) -C debian/build $(MAKEFLAGS) openobex-apps
	$(MAKE) -C debian/build-static $(MAKEFLAGS) openobex
	touch build-arch-stamp

build-indep: build-indep-stamp
build-indep-stamp: debian/build
	dh_testdir
	$(MAKE) -C debian/build $(MAKEFLAGS) doc
	touch build-indep-stamp

clean:
	dh_testdir
	dh_testroot
	rm -rf debian/build
	rm -rf debian/build-static
	debian/rules unpatch
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) -C debian/build-static install DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C debian/build install DESTDIR=$(CURDIR)/debian/tmp

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_install --sourcedir=debian/tmp --autodest --fail-missing \
		-X share/doc -X share/man -X usr/sbin/ -X lib/udev/rules.d/
ifeq (linux,$(DEB_HOST_ARCH_OS))
	install -d debian/libopenobex2/usr/sbin/
	install -m 0755 debian/tmp/usr/sbin/obex-check-device \
			debian/libopenobex2/usr/sbin/obex-check-device
	install -d debian/libopenobex2/lib/udev/rules.d/
	install -m 0644 debian/tmp/lib/udev/rules.d/60-openobex.rules \
			debian/libopenobex2/lib/udev/rules.d/60-openobex.rules
endif
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install patch unpatch