No Description

Android.mk 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. # Copyright (C) 2007 The Android Open Source Project
  2. # Copyright (C) 2015 The CyanogenMod Project
  3. # Copyright (C) 2017 The Lineage Android Project
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. LOCAL_PATH := $(call my-dir)
  17. # Needed by build/make/core/Makefile.
  18. RECOVERY_API_VERSION := 3
  19. RECOVERY_FSTAB_VERSION := 2
  20. # libfusesideload (static library)
  21. # ===============================
  22. include $(CLEAR_VARS)
  23. LOCAL_SRC_FILES := fuse_sideload.cpp
  24. LOCAL_CFLAGS := -Wall -Werror
  25. LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
  26. LOCAL_MODULE := libfusesideload
  27. LOCAL_STATIC_LIBRARIES := \
  28. libcrypto \
  29. libbase
  30. include $(BUILD_STATIC_LIBRARY)
  31. # libmounts (static library)
  32. # ===============================
  33. include $(CLEAR_VARS)
  34. LOCAL_SRC_FILES := mounts.cpp
  35. LOCAL_CFLAGS := \
  36. -Wall \
  37. -Werror
  38. LOCAL_MODULE := libmounts
  39. LOCAL_STATIC_LIBRARIES := libbase
  40. include $(BUILD_STATIC_LIBRARY)
  41. # librecovery (static library)
  42. # ===============================
  43. include $(CLEAR_VARS)
  44. LOCAL_SRC_FILES := \
  45. install.cpp
  46. LOCAL_CFLAGS := -Wall -Werror
  47. LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
  48. ifeq ($(AB_OTA_UPDATER),true)
  49. LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
  50. endif
  51. LOCAL_MODULE := librecovery
  52. LOCAL_STATIC_LIBRARIES := \
  53. libminui \
  54. libotautil \
  55. libvintf_recovery \
  56. libcrypto_utils \
  57. libcrypto \
  58. libbase \
  59. libziparchive \
  60. libvolume_manager \
  61. include $(BUILD_STATIC_LIBRARY)
  62. # recovery (static executable)
  63. # ===============================
  64. include $(CLEAR_VARS)
  65. LOCAL_SRC_FILES := \
  66. adb_install.cpp \
  67. device.cpp \
  68. fuse_sdcard_provider.cpp \
  69. recovery.cpp \
  70. roots.cpp \
  71. rotate_logs.cpp \
  72. screen_ui.cpp \
  73. ui.cpp \
  74. volclient.cpp \
  75. vr_ui.cpp \
  76. wear_ui.cpp \
  77. LOCAL_MODULE := recovery
  78. LOCAL_FORCE_STATIC_EXECUTABLE := true
  79. LOCAL_REQUIRED_MODULES := mke2fs.conf
  80. LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
  81. LOCAL_CFLAGS += -Wall -Werror
  82. ifneq ($(TARGET_RECOVERY_UI_MARGIN_HEIGHT),)
  83. LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=$(TARGET_RECOVERY_UI_MARGIN_HEIGHT)
  84. else
  85. LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=0
  86. endif
  87. ifneq ($(TARGET_RECOVERY_UI_MARGIN_WIDTH),)
  88. LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_WIDTH=$(TARGET_RECOVERY_UI_MARGIN_WIDTH)
  89. else
  90. LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_WIDTH=0
  91. endif
  92. ifneq ($(TARGET_RECOVERY_UI_MARGIN_STATUSBAR),)
  93. LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_STATUSBAR=$(TARGET_RECOVERY_UI_MARGIN_STATUSBAR)
  94. else
  95. LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_STATUSBAR=0
  96. endif
  97. ifneq ($(TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD),)
  98. LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_LOW_THRESHOLD=$(TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD)
  99. else
  100. LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_LOW_THRESHOLD=50
  101. endif
  102. ifneq ($(TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD),)
  103. LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=$(TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD)
  104. else
  105. LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=90
  106. endif
  107. ifneq ($(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE),)
  108. LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=$(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE)
  109. else
  110. LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=259
  111. endif
  112. ifneq ($(TARGET_RECOVERY_UI_ANIMATION_FPS),)
  113. LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=$(TARGET_RECOVERY_UI_ANIMATION_FPS)
  114. else
  115. LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=30
  116. endif
  117. ifneq ($(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS),)
  118. LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=$(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS)
  119. else
  120. LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=9
  121. endif
  122. ifneq ($(TARGET_RECOVERY_UI_VR_STEREO_OFFSET),)
  123. LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=$(TARGET_RECOVERY_UI_VR_STEREO_OFFSET)
  124. else
  125. LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=0
  126. endif
  127. ifneq ($(TARGET_RECOVERY_BACKLIGHT_PATH),)
  128. LOCAL_CFLAGS += -DBACKLIGHT_PATH=\"$(TARGET_RECOVERY_BACKLIGHT_PATH)\"
  129. else
  130. LOCAL_CFLAGS += -DBACKLIGHT_PATH=\"/sys/class/leds/lcd-backlight\"
  131. endif
  132. ifeq ($(TARGET_BUILD_VARIANT),user)
  133. LOCAL_CFLAGS += -DRELEASE_BUILD
  134. endif
  135. LOCAL_C_INCLUDES += \
  136. system/vold \
  137. # Health HAL dependency
  138. LOCAL_STATIC_LIBRARIES := \
  139. android.hardware.health@2.0-impl \
  140. android.hardware.health@2.0 \
  141. android.hardware.health@1.0 \
  142. android.hardware.health@1.0-convert \
  143. libhealthstoragedefault \
  144. libhidltransport \
  145. libhidlbase \
  146. libhwbinder_noltopgo \
  147. libvndksupport \
  148. libbatterymonitor
  149. LOCAL_STATIC_LIBRARIES += \
  150. libmksh_driver \
  151. librecovery \
  152. libverifier \
  153. libbootloader_message \
  154. libfs_mgr \
  155. libext4_utils \
  156. libsparse \
  157. libreboot \
  158. libziparchive \
  159. libvolume_manager \
  160. libminipigz_static \
  161. libzopfli_static \
  162. libminizip_static \
  163. libminiunz_static \
  164. libotautil \
  165. libmounts \
  166. libminadbd \
  167. libasyncio \
  168. libfusesideload \
  169. libminui \
  170. libpng \
  171. libcrypto_utils \
  172. libcrypto \
  173. libvintf_recovery \
  174. libvintf \
  175. libhidl-gen-utils \
  176. libtinyxml2 \
  177. libbase \
  178. libutils \
  179. libcutils \
  180. liblog \
  181. libselinux \
  182. libz
  183. LOCAL_WHOLE_STATIC_LIBRARIES += \
  184. libawk_main
  185. # Libraries for FS tools
  186. LOCAL_WHOLE_STATIC_LIBRARIES += \
  187. libext2fs \
  188. libe2fsck \
  189. libmke2fs \
  190. libresize2fs \
  191. libtune2fs \
  192. libsparse
  193. LOCAL_WHOLE_STATIC_LIBRARIES += \
  194. libe2fsdroid
  195. LOCAL_WHOLE_STATIC_LIBRARIES += \
  196. libf2fs \
  197. libf2fs_fsck \
  198. libf2fs_mkfs
  199. LOCAL_WHOLE_STATIC_LIBRARIES += \
  200. libfsck_msdos
  201. LOCAL_WHOLE_STATIC_LIBRARIES += \
  202. libexfat \
  203. libexfat_mkfs \
  204. libexfat_fsck
  205. LOCAL_WHOLE_STATIC_LIBRARIES += \
  206. libfuse-lite \
  207. libntfs-3g \
  208. libntfs_utils \
  209. libntfs_fsck \
  210. libntfs_mkfs \
  211. libntfs_mount
  212. LOCAL_WHOLE_STATIC_LIBRARIES += \
  213. libsgdisk_static
  214. LOCAL_STATIC_LIBRARIES += \
  215. libext2_blkid \
  216. libext2_uuid \
  217. libext2_profile \
  218. libext2_quota \
  219. libext2_com_err \
  220. libext2_e2p \
  221. libc++_static \
  222. libz
  223. FILESYSTEM_TOOLS := \
  224. e2fsdroid e2fsdroid_static \
  225. e2fsck mke2fs mke2fs_static fsck.ext4 mkfs.ext4 \
  226. resize2fs tune2fs \
  227. mkfs.f2fs fsck.f2fs sload.f2fs \
  228. fsck_msdos \
  229. fsck.exfat mkfs.exfat \
  230. fsck.ntfs mkfs.ntfs mount.ntfs \
  231. sgdisk
  232. LOCAL_HAL_STATIC_LIBRARIES := libhealthd
  233. ifeq ($(AB_OTA_UPDATER),true)
  234. LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
  235. endif
  236. ifeq ($(BOARD_HAS_DOWNLOAD_MODE), true)
  237. LOCAL_CFLAGS += -DDOWNLOAD_MODE
  238. endif
  239. LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
  240. ifeq ($(TARGET_RECOVERY_UI_LIB),)
  241. LOCAL_SRC_FILES += default_device.cpp
  242. else
  243. LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
  244. endif
  245. ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
  246. LOCAL_REQUIRED_MODULES += recovery-persist recovery-refresh
  247. endif
  248. LOCAL_REQUIRED_MODULES += \
  249. toybox_static \
  250. recovery_mkshrc \
  251. bu_recovery
  252. # Symlinks
  253. RECOVERY_TOOLS := \
  254. reboot \
  255. setup_adbd \
  256. sh \
  257. gunzip \
  258. gzip \
  259. unzip \
  260. zip \
  261. awk \
  262. $(FILESYSTEM_TOOLS)
  263. LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(RECOVERY_TOOLS),ln -sf ${LOCAL_MODULE} $(LOCAL_MODULE_PATH)/$(t);)
  264. ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),)
  265. LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_RECOVERY_DEVICE_MODULES)
  266. endif
  267. include $(BUILD_EXECUTABLE)
  268. # mkshrc
  269. include $(CLEAR_VARS)
  270. LOCAL_MODULE := recovery_mkshrc
  271. LOCAL_MODULE_TAGS := optional
  272. LOCAL_MODULE_CLASS := ETC
  273. LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/etc
  274. LOCAL_SRC_FILES := etc/mkshrc
  275. LOCAL_MODULE_STEM := mkshrc
  276. include $(BUILD_PREBUILT)
  277. include $(CLEAR_VARS)
  278. LOCAL_MODULE := bu_recovery
  279. LOCAL_MODULE_STEM := bu
  280. LOCAL_MODULE_TAGS := optional
  281. LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
  282. LOCAL_FORCE_STATIC_EXECUTABLE := true
  283. LOCAL_SRC_FILES := \
  284. bu.cpp \
  285. backup.cpp \
  286. restore.cpp \
  287. roots.cpp
  288. LOCAL_CFLAGS += -DMINIVOLD
  289. LOCAL_CFLAGS += -Wno-unused-parameter
  290. LOCAL_STATIC_LIBRARIES += \
  291. libext4_utils \
  292. libsparse \
  293. libmounts \
  294. libz \
  295. libminadbd \
  296. libminui \
  297. libfs_mgr \
  298. libtar \
  299. libcrypto \
  300. libbase \
  301. libcutils \
  302. libutils \
  303. liblog \
  304. libselinux \
  305. libm \
  306. libc
  307. LOCAL_C_INCLUDES += \
  308. system/core/fs_mgr/include \
  309. system/core/include \
  310. system/core/libcutils \
  311. system/extras/ext4_utils \
  312. system/vold \
  313. external/libtar \
  314. external/libtar/listhash \
  315. external/openssl/include \
  316. external/zlib \
  317. bionic/libc/bionic
  318. include $(BUILD_EXECUTABLE)
  319. # Minizip static library
  320. include $(CLEAR_VARS)
  321. LOCAL_MODULE := libminizip_static
  322. LOCAL_MODULE_TAGS := optional
  323. LOCAL_CFLAGS := -Dmain=minizip_main -D__ANDROID__ -DIOAPI_NO_64
  324. LOCAL_C_INCLUDES := external/zlib
  325. LOCAL_SRC_FILES := \
  326. ../../external/zlib/src/contrib/minizip/ioapi.c \
  327. ../../external/zlib/src/contrib/minizip/minizip.c \
  328. ../../external/zlib/src/contrib/minizip/zip.c
  329. include $(BUILD_STATIC_LIBRARY)
  330. # Miniunz static library
  331. include $(CLEAR_VARS)
  332. LOCAL_MODULE := libminiunz_static
  333. LOCAL_MODULE_TAGS := optional
  334. LOCAL_CFLAGS := -Dmain=miniunz_main -D__ANDROID__ -DIOAPI_NO_64
  335. LOCAL_C_INCLUDES := external/zlib
  336. LOCAL_SRC_FILES := \
  337. ../../external/zlib/src/contrib/minizip/ioapi.c \
  338. ../../external/zlib/src/contrib/minizip/miniunz.c \
  339. ../../external/zlib/src/contrib/minizip/unzip.c
  340. include $(BUILD_STATIC_LIBRARY)
  341. # Reboot static library
  342. include $(CLEAR_VARS)
  343. LOCAL_MODULE := libreboot
  344. LOCAL_MODULE_TAGS := optional
  345. LOCAL_CFLAGS := -Dmain=reboot_main
  346. LOCAL_SRC_FILES := ../../system/core/reboot/reboot.c
  347. include $(BUILD_STATIC_LIBRARY)
  348. # recovery-persist (system partition dynamic executable run after /data mounts)
  349. # ===============================
  350. include $(CLEAR_VARS)
  351. LOCAL_SRC_FILES := \
  352. recovery-persist.cpp \
  353. rotate_logs.cpp
  354. LOCAL_MODULE := recovery-persist
  355. LOCAL_SHARED_LIBRARIES := liblog libbase
  356. LOCAL_CFLAGS := -Wall -Werror
  357. LOCAL_INIT_RC := recovery-persist.rc
  358. include $(BUILD_EXECUTABLE)
  359. # recovery-refresh (system partition dynamic executable run at init)
  360. # ===============================
  361. include $(CLEAR_VARS)
  362. LOCAL_SRC_FILES := \
  363. recovery-refresh.cpp \
  364. rotate_logs.cpp
  365. LOCAL_MODULE := recovery-refresh
  366. LOCAL_SHARED_LIBRARIES := liblog libbase
  367. LOCAL_CFLAGS := -Wall -Werror
  368. LOCAL_INIT_RC := recovery-refresh.rc
  369. include $(BUILD_EXECUTABLE)
  370. # libverifier (static library)
  371. # ===============================
  372. include $(CLEAR_VARS)
  373. LOCAL_MODULE := libverifier
  374. LOCAL_SRC_FILES := \
  375. asn1_decoder.cpp \
  376. verifier.cpp
  377. LOCAL_STATIC_LIBRARIES := \
  378. libotautil \
  379. libcrypto_utils \
  380. libcrypto \
  381. libbase
  382. LOCAL_CFLAGS := -Wall -Werror
  383. include $(BUILD_STATIC_LIBRARY)
  384. # Wear default device
  385. # ===============================
  386. include $(CLEAR_VARS)
  387. LOCAL_SRC_FILES := wear_device.cpp
  388. LOCAL_CFLAGS := -Wall -Werror
  389. # Should match TARGET_RECOVERY_UI_LIB in BoardConfig.mk.
  390. LOCAL_MODULE := librecovery_ui_wear
  391. include $(BUILD_STATIC_LIBRARY)
  392. # vr headset default device
  393. # ===============================
  394. include $(CLEAR_VARS)
  395. LOCAL_SRC_FILES := vr_device.cpp
  396. LOCAL_CFLAGS := -Wall -Werror
  397. # should match TARGET_RECOVERY_UI_LIB set in BoardConfig.mk
  398. LOCAL_MODULE := librecovery_ui_vr
  399. include $(BUILD_STATIC_LIBRARY)
  400. include \
  401. $(LOCAL_PATH)/boot_control/Android.mk \
  402. $(LOCAL_PATH)/minadbd/Android.mk \
  403. $(LOCAL_PATH)/minui/Android.mk \
  404. $(LOCAL_PATH)/tests/Android.mk \
  405. $(LOCAL_PATH)/tools/Android.mk \
  406. $(LOCAL_PATH)/updater/Android.mk \
  407. $(LOCAL_PATH)/update_verifier/Android.mk \