File: rules

package info (click to toggle)
android-platform-frameworks-base 1%3A10.0.0%2Br36-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 321,788 kB
  • sloc: java: 962,234; cpp: 274,314; xml: 242,770; python: 5,060; sh: 1,432; ansic: 494; makefile: 47; sed: 19
file content (64 lines) | stat: -rwxr-xr-x 2,818 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
#!/usr/bin/make -f

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

export CC=clang
export CXX=clang++

# https://android.googlesource.com/platform/development/+/android-10.0.0_r36/sdk/build_tools_source.prop_template
export ANDROID_BUILD_TOOLS_VERSION = 29.0.3
export DEB_HOST_MULTIARCH
export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG -I/usr/include/android
export DEB_LDFLAGS_MAINT_APPEND = -fPIC

# https://android.googlesource.com/platform/build/soong/+/refs/tags/android-10.0.0_r36/cc/config/global.go#116
CPPFLAGS += -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -fno-strict-aliasing
export CPPFLAGS

debian/out/aapt: debian/aapt.mk debian/out/libaapt.so
	dh_auto_build --buildsystem=makefile -- -f $<

debian/out/aapt2: debian/aapt2.mk debian/out/libandroidfw.so
	dh_auto_build --buildsystem=makefile -- -f $<

debian/out/libaapt.so: debian/libaapt.mk debian/out/libandroidfw.so
	dh_auto_build --buildsystem=makefile -- -f $<

debian/out/libandroidfw.so: debian/libandroidfw.mk
	dh_auto_build --buildsystem=makefile -- -f $<

debian/out/split-select: debian/split-select.mk debian/out/libandroidfw.so debian/out/libaapt.so
	dh_auto_build --buildsystem=makefile -- -f $<

%:
	dh $@ --with bash-completion

override_dh_auto_build-arch: debian/out/aapt debian/out/aapt2 debian/out/split-select
	mkdir --parent debian/out
	pandoc -s -o debian/out/split-select.1 debian/split-select.1.md

override_dh_auto_build-indep: debian/out/aapt2
	mkdir --parents debian/out
	cp /usr/lib/$(DEB_HOST_MULTIARCH)/android/*.so.0 debian/out
	ln -s /usr/lib/p7zip/7z.so debian/out/7z.so
	chrpath --replace debian/out debian/out/aapt2
	debian/out/aapt2 compile --dir core/res/res \
				-o debian/out/resources.zip
	debian/out/aapt2 link --manifest core/res/AndroidManifest.xml \
				debian/out/resources.zip \
				-o debian/out/framework-res.apk \
				-A core/res/assets \
				--min-sdk-version 29 --target-sdk-version 29 \
				--product default \
				--version-code 29 --version-name 10.0.0
	chrpath --replace /usr/lib/$(DEB_HOST_MULTIARCH)/android debian/out/aapt2

get-orig-source: $(subst android-platform-,,$(DEB_SOURCE)).tar.gz
	mkdir -p $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
	tar -f $< -x --gzip --directory $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
	(cd $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM); tar --create --xz -f ../../$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig.tar.xz --exclude-from ../debian/orig.excludes --mtime=20121221 *)
	$(RM) -r $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)

$(subst android-platform-,,$(DEB_SOURCE)).tar.gz:
	wget https://android.googlesource.com/platform/$(subst -,/,$(subst android-platform-,,$(DEB_SOURCE)))/+archive/android-$(subst +,_,$(DEB_VERSION_UPSTREAM)).tar.gz -O $@