forked from mozilla-b2g/gonk-misc
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathAndroid.mk
342 lines (304 loc) · 10.3 KB
/
Android.mk
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# Copyright (C) 2012 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LOCAL_PATH:= $(call my-dir)
gonk_misc_LOCAL_PATH := $(LOCAL_PATH)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(gonk_misc_LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE := init.b2g.rc
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := init.b2g.rc
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := b2g.sh
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := DATA
LOCAL_SRC_FILES := b2g.sh
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := api-daemon.sh
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := DATA
LOCAL_SRC_FILES := api-daemon.sh
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := updater-daemon.sh
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := DATA
LOCAL_SRC_FILES := updater-daemon.sh
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := b2g-ps
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := DATA
LOCAL_SRC_FILES := b2g-ps
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := b2g-procrank
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := DATA
LOCAL_SRC_FILES := b2g-procrank
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
include $(BUILD_PREBUILT)
#
# Dhcpcd
#
include $(CLEAR_VARS)
LOCAL_MODULE := dhcpcd.conf
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/dhcpcd-6.8.2
LOCAL_SRC_FILES := dhcpcd/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := dhcpcd-run-hooks
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/dhcpcd-6.8.2
LOCAL_SRC_FILES := dhcpcd/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := 20-dns.conf
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/dhcpcd-6.8.2/dhcpcd-hooks
LOCAL_SRC_FILES := dhcpcd/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := 95-configured
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/dhcpcd-6.8.2/dhcpcd-hooks
LOCAL_SRC_FILES := dhcpcd/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := fakeappops
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := fakeappops.cpp
LOCAL_CFLAGS := -DANDROID_VERSION=$(PLATFORM_SDK_VERSION)
LOCAL_SHARED_LIBRARIES := libbinder libutils
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_MODULE := gonksched
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := gonksched.cpp
LOCAL_SHARED_LIBRARIES := libbinder libutils libcutils libmediautils libprocessgroup
LOCAL_CFLAGS := -DANDROID_VERSION=$(PLATFORM_SDK_VERSION)
LOCAL_C_INCLUDES := frameworks/av/media/utils
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_MODULE := gonkservices
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := gonkservices.cpp
LOCAL_SHARED_LIBRARIES := libbinder libutils libsensorprivacy
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_MODULE := b2gkillerd
LOCAL_MODULE_TAGS := optional
LCOAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := b2gkillerd.cpp
LOCAL_SHARED_LIBRARIES := libcutils liblog
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_MODULE := gfxdebugger
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := gfxdebugger.cpp
LOCAL_SHARED_LIBRARIES := libbinder libutils
LOCAL_C_INCLUDES := gecko/widget/gonk
include $(BUILD_EXECUTABLE)
#
# Gecko glue
#
include $(CLEAR_VARS)
GECKO_PATH ?= gecko
ifeq (,$(GECKO_OBJDIR))
GECKO_OBJDIR := $(TARGET_OUT_INTERMEDIATES)/objdir-gecko
endif
-include prebuilt-b2g/Android.mk
LOCAL_MODULE := gecko
LOCAL_MODULE_CLASS := DATA
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT)
include $(BUILD_SYSTEM)/base_rules.mk
B2G_SYSTEM_APPS ?= 0
USE_PREBUILT_B2G ?= 0
# Preserve the /system/b2g/defaults as its contents will be populated before this rule.
PRESERVE_DIRS := defaults
ifeq ($(B2G_SYSTEM_APPS), 1)
PRESERVE_DIRS += webapps
endif
$(LOCAL_INSTALLED_MODULE) : $(LOCAL_BUILT_MODULE)
@echo Install dir: $(TARGET_OUT)/b2g
rm -rf $(filter-out $(addprefix $(TARGET_OUT)/b2g/,$(PRESERVE_DIRS)),$(wildcard $(TARGET_OUT)/b2g/*))
mkdir -p $(TARGET_OUT)/b2g/defaults/pref
cd $(TARGET_OUT) && tar jxvf $(abspath $<)
ifneq ($(EXPORT_DEVICE_PREFS),)
cp -n $(EXPORT_DEVICE_PREFS)/*.js $(TARGET_OUT)/b2g/defaults/pref/
endif
ifneq ($(EXPORT_DEVICE_USER_BUILD_PREFS),)
cp -n $(EXPORT_DEVICE_USER_BUILD_PREFS) $(TARGET_OUT)/b2g/defaults/pref/
endif
ifneq ($(EXPORT_BUILD_PREFS),)
cp -n $(EXPORT_BUILD_PREFS) $(TARGET_OUT)/b2g/defaults/pref/
endif
GECKO_LIB_DEPS := \
liblog.so \
libmedia.so \
libmtp.so \
libstagefright.so \
libstagefright_omx.so \
libsysutils.so \
android.hardware.gnss@1.0.so \
android.hardware.graphics.composer@2.1.so \
android.hardware.graphics.composer@2.2.so \
android.hardware.graphics.composer@2.3.so \
android.hardware.power@1.0.so \
android.hardware.radio@1.0.so \
android.hardware.radio@1.1.so \
android.hardware.vibrator@1.0.so \
android.hardware.sensors@1.0.so \
android.hardware.sensors@2.0.so \
android.hardware.wifi@1.0.so \
android.hardware.wifi@1.1.so \
android.hardware.wifi@1.2.so \
android.hardware.wifi@1.3.so \
android.hardware.wifi.hostapd@1.0.so \
android.hardware.wifi.hostapd@1.1.so \
android.hardware.wifi.supplicant@1.0.so \
android.hardware.wifi.supplicant@1.1.so \
android.hardware.wifi.supplicant@1.2.so \
android.system.wifi.keystore@1.0.so \
libwificond_ipc_shared.so \
netd_aidl_interface-V2-cpp.so \
netd_event_listener_interface-V1-cpp.so \
dnsresolver_aidl_interface-V2-cpp.so \
binder_b2g_connectivity_interface-cpp.so \
binder_b2g_stub.so \
binder_b2g_system_interface-cpp.so \
binder_b2g_telephony_interface-cpp.so \
binder_b2g_remotesimunlock_interface-cpp.so \
libc++.so \
libbinder.so \
libfmq.so \
libutils.so \
libcutils.so \
libhardware_legacy.so \
libhardware.so \
libui.so \
libgui.so \
libsuspend.so \
libsync.so \
libhidlbase.so \
libvold_binder_shared.so \
libttspico.so \
libnetdbpf.so \
$(NULL)
# For APEX_MODULE_LIBS
ifeq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) < 29 ))" )))
GECKO_LIB_DEPS += \
libc.so \
libdl.so \
libm.so \
$(NULL)
else
GECKO_LIB_DEPS += \
android.hardware.gnss.visibility_control@1.0.so \
android.hardware.gnss@1.1.so \
android.hardware.gnss@2.0.so \
$(NULL)
GECKO_MODULE_DEPS += \
com.android.runtime
endif
# Currently, OEM hook is only supported on Qualcomm platform
ifneq ($(strip $(PRODUCT_MANUFACTURER)), QUALCOMM)
DISABLE_OEMHOOK=1
endif
# Build vendor library for OEM hook unless it's disabled
ifeq ($(DISABLE_OEMHOOK),)
GECKO_MODULE_DEPS += vendor.qti.hardware.radio.qcrilhook@1.0
endif
ifeq ($(IME_ENGINE), touchpal)
GECKO_LIB_DEPS += libtouchpal.so
endif
PRODUCTION_OS_NAME ?= KAIOS
.PHONY: $(LOCAL_BUILT_MODULE)
$(LOCAL_BUILT_MODULE): $(TARGET_CRTBEGIN_DYNAMIC_O) $(TARGET_CRTEND_O) $(addprefix $(TARGET_OUT_SHARED_LIBRARIES)/,$(GECKO_LIB_DEPS)) $(GECKO_LIB_STATIC) $(GECKO_MODULE_DEPS)
ifeq ($(USE_PREBUILT_B2G),1)
@echo -e "\033[0;33m ==== Use prebuilt gecko ==== \033[0m";
mkdir -p $(@D) && cp $(abspath $(PREFERRED_B2G)) $@
else
(echo "export GECKO_OBJDIR=$(abspath $(GECKO_OBJDIR))"; \
echo "export GONK_PRODUCT_NAME=$(TARGET_DEVICE)"; \
echo "export GONK_PATH=$(abspath .)"; \
echo "export PLATFORM_VERSION=$(PLATFORM_SDK_VERSION)"; \
echo "export TARGET_ARCH=$(TARGET_ARCH)"; \
echo "export TARGET_ARCH_VARIANT=$(TARGET_ARCH_VARIANT)"; \
echo "export TARGET_CPU_VARIANT=$(TARGET_CPU_VARIANT)"; \
echo "export PRODUCT_MANUFACTURER=$(PRODUCT_MANUFACTURER)"; \
echo "export MOZ_DISABLE_LTO=$(MOZ_DISABLE_LTO)"; \
echo "export MOZ_SANDBOX_GPU_NODE=$(MOZ_SANDBOX_GPU_NODE)" && \
echo "export HOST_OS=$(HOST_OS)"; \
echo "export PRODUCTION_OS_NAME=$(PRODUCTION_OS_NAME)"; \
echo "export ENABLE_RSU=$(ENABLE_RSU)"; \
) > .var.profile
unset CC_WRAPPER && unset CXX_WRAPPER && \
export GECKO_OBJDIR="$(abspath $(GECKO_OBJDIR))" && \
export GONK_PATH="$(abspath .)" && \
export GONK_PRODUCT_NAME="$(TARGET_DEVICE)" && \
export PLATFORM_VERSION="$(PLATFORM_SDK_VERSION)" && \
export TARGET_ARCH="$(TARGET_ARCH)" && \
export TARGET_ARCH_VARIANT="$(TARGET_ARCH_VARIANT)" && \
export TARGET_CPU_VARIANT="$(TARGET_CPU_VARIANT)" && \
export PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" && \
export MOZ_DISABLE_LTO="$(MOZ_DISABLE_LTO)" && \
export MOZ_SANDBOX_GPU_NODE="$(MOZ_SANDBOX_GPU_NODE)" && \
export HOST_OS="$(HOST_OS)" && \
export PRODUCTION_OS_NAME="$(PRODUCTION_OS_NAME)" && \
export ENABLE_RSU="$(ENABLE_RSU)" && \
(cd $(GECKO_PATH) ; $(SHELL) build-b2g.sh) && \
(cd $(GECKO_PATH) ; $(SHELL) build-b2g.sh package) && \
mkdir -p $(@D) && cp $(GECKO_OBJDIR)/dist/b2g-*.tar.bz2 $@
endif
.PHONY: buildsymbols
buildsymbols:
$(MAKE) -C $(GECKO_OBJDIR) $@ TARGET_OUT_UNSTRIPPED="$(abspath $(TARGET_OUT_UNSTRIPPED))"
# Include a copy of the repo manifest that has the revisions used
ifneq ($(DISABLE_SOURCES_XML),true)
ifneq (,$(realpath .repo/manifest.xml))
REPO := $(shell which repo)
ifeq (,$(REPO))
REPO := ./.repo/repo/repo
endif
include $(CLEAR_VARS)
LOCAL_MODULE := sources.xml
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := DATA
LOCAL_MODULE_PATH := $(TARGET_OUT)
include $(BUILD_SYSTEM)/base_rules.mk
# Use the native comamnd provided by git-repo to create sources.xml.
# The basic attributes that will be added into all depend on .repo/manifest.xml.
$(LOCAL_BUILT_MODULE):
mkdir -p $(@D)
$(REPO) manifest -r -o $@
# this dependency ensure the above rule will be executed if module is built
$(LOCAL_INSTALLED_MODULE) : $(LOCAL_BUILT_MODULE)
$(copy-file-to-new-target)
endif
endif