File: rules

package info (click to toggle)
android-platform-external-boringssl 14.0.0%2Br45-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 132,612 kB
  • sloc: asm: 270,131; ansic: 132,231; cpp: 82,828; perl: 54,598; python: 961; sh: 233; makefile: 91; xml: 32
file content (108 lines) | stat: -rwxr-xr-x 3,523 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
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
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk

## Security Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
export DEB_CFLAGS_MAINT_APPEND = -fPIC -std=gnu17
export DEB_CXXFLAGS_MAINT_APPEND = -fPIC -std=gnu++2a
export DEB_LDFLAGS_MAINT_APPEND = -fPIC
export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG -UDEBUG \
  -DBORINGSSL_ANDROID_SYSTEM \
  -DBORINGSSL_IMPLEMENTATION \
  -DBORINGSSL_SHARED_LIBRARY \
  -DOPENSSL_SMALL \
  -fmessage-length=0 \
  -fno-exceptions \
  -fno-strict-aliasing \
  -no-canonical-prefixes \

ifneq (, $(shell which clang))
  export CC = clang
  export CXX = clang++
  export DEB_CFLAGS_MAINT_APPEND += -gdwarf-4
  export DEB_CXXFLAGS_MAINT_APPEND += -gdwarf-4
endif
ifneq (, $(shell which lld))
  export DEB_LDFLAGS_MAINT_APPEND += -fuse-ld=lld -Wl,--build-id=sha1
endif

ifeq ($(IMPORT_VER),)
	GBP_IMPORT = --uscan
else ifneq ("$(wildcard ../$(DEB_SOURCE)_$(IMPORT_VER).tar.gz)","")
	GBP_IMPORT = ../$(DEB_SOURCE)_$(IMPORT_VER).tar.gz
else
	GBP_IMPORT =
endif

%:
	dh $@

lib%.so: debian/lib%.mk
	dh_auto_build --buildsystem=makefile -- --file=$<

compiler_test: debian/compiler_test.mk
	dh_auto_build --buildsystem=makefile -- --file=$<
	debian/out/test/$@

%_test: debian/%_test.mk libtest_support.so libcrypto.so libssl.so
	dh_auto_build --buildsystem=makefile -- --file=$<

ifeq ($(filter hurd-amd64 hurd-i386,$(DEB_HOST_ARCH)),)
override_dh_auto_build-arch: compiler_test tool_test
else
# TODO: compiler_test, tool_test build fails on hurd-* currently
override_dh_auto_build-arch:
endif
	dh_auto_build

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
override_dh_auto_test-arch: crypto_test ssl_test
ifeq ($(filter hurd-amd64 hurd-i386,$(DEB_HOST_ARCH)),)
	LD_LIBRARY_PATH=debian/out debian/out/bssl-tool genrsa
endif
	LD_LIBRARY_PATH=debian/out debian/out/crypto_test
	LD_LIBRARY_PATH=debian/out debian/out/ssl_test
endif

override_dh_dwz:
	dh_dwz || true

# Since this depends on golang-go, not gccgo, so let's update manually
# Depends: golang-go
update-sources-mk:
	dpkg-source --before-build .
	python3 src/util/generate_build_files.py eureka
	cp eureka.mk debian/sources.mk
get-orig-source:
	gbp import-orig $(GBP_IMPORT) \
		--no-interactive --debian-branch=$(shell git symbolic-ref --short HEAD) \
		--postimport="\
		dch -b -v\$$GBP_DEBIAN_VERSION \"New upstream release \$$GBP_UPSTREAM_VERSION\"; \
		git add debian/changelog; \
		git commit -m\"dch: Note new upstream version \$$GBP_UPSTREAM_VERSION\""
check-upstream:
	$(eval count = $$(shell git show upstream|wc -l))
	@test $(count) -gt 10 || ( \
		git reset --hard HEAD^^; \
		git tag -d upstream/$(shell echo $(DEB_VERSION_UPSTREAM)|sed "s/~/_/g;s/:/%/g"); \
		git checkout upstream; git reset --hard HEAD^; git checkout $(shell git symbolic-ref --short HEAD); \
		echo; \
		echo error: Line count of upstream/$(DEB_VERSION_UPSTREAM): $(count); \
		echo Upstream changes does not deserve an update.;\
		echo; \
		exit 1; \
	)
ifeq ($(GBP_IMPORT),)
update:
	@echo Cannot find orig to import: ../$(DEB_SOURCE)_$(IMPORT_VER).tar.gz
else
update: get-orig-source check-upstream update-sources-mk
	git diff --quiet debian/sources.mk || \
		(dch -a "debian/sources.mk: Update by script."; \
		git add debian/sources.mk debian/changelog; \
		git commit --amend -m "d/sources.mk: Update by script")
	git clean -fdx; git reset --hard
	@echo Package updated to upstream version: $(shell dpkg-parsechangelog -SVersion|sed 's/-[^-]*$$//'|sed 's/^[0-9]*://')
endif