libril: port Samsung responseDataCallList to O libril
[GitHub/LineageOS/android_hardware_samsung.git] / mkbootimg.mk
CommitLineData
67a74448
JC
1# Copyright (C) 2017 The LineageOS Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
18ifneq ($(strip $(BOARD_KERNEL_PREBUILT_DT)),true)
19ifeq ($(strip $(BUILD_TINY_ANDROID)),true)
20include device/qcom/common/dtbtool/Android.mk
21endif
22
23ifeq ($(strip $(TARGET_CUSTOM_DTBTOOL)),)
977aee55 24DTBTOOL_NAME := dtbToolLineage
67a74448
JC
25else
26DTBTOOL_NAME := $(TARGET_CUSTOM_DTBTOOL)
27endif
28
29DTBTOOL := $(HOST_OUT_EXECUTABLES)/$(DTBTOOL_NAME)$(HOST_EXECUTABLE_SUFFIX)
30
31INSTALLED_DTIMAGE_TARGET := $(PRODUCT_OUT)/dt.img
32
33ifeq ($(strip $(TARGET_CUSTOM_DTBTOOL)),)
34# dtbToolCM will search subdirectories
35possible_dtb_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/
36else
37# Most specific paths must come first in possible_dtb_dirs
9432ff33 38possible_dtb_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts/exynos/ $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts/ $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/
67a74448
JC
39endif
40
41define build-dtimage-target
42 $(call pretty,"Target dt image: $@")
43 $(hide) for dir in $(possible_dtb_dirs); do \
44 if [ -d "$$dir" ]; then \
45 dtb_dir="$$dir"; \
46 break; \
47 fi; \
48 done; \
49 $(DTBTOOL) $(BOARD_DTBTOOL_ARGS) -o $@ -s $(BOARD_KERNEL_PAGESIZE) -p $(KERNEL_OUT)/scripts/dtc/ "$$dtb_dir";
50 $(hide) chmod a+r $@
51endef
52
53$(INSTALLED_DTIMAGE_TARGET): $(DTBTOOL) $(INSTALLED_KERNEL_TARGET)
54 $(build-dtimage-target)
55 @echo "Made DT image: $@"
56
57.PHONY: dtimage
58dtimage: $(INSTALLED_DTIMAGE_TARGET)
59
60endif
61endif
62
63$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOTIMAGE_EXTRA_DEPS)
64 $(call pretty,"Target boot image: $@")
65 $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
66 $(hide) echo -n "SEANDROIDENFORCE" >> $@
67 $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
68 @echo "Made boot image: $@"
69
70$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(recovery_ramdisk) $(recovery_kernel) $(RECOVERYIMAGE_EXTRA_DEPS)
71 @echo "----- Making recovery image ------"
72 $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ --id > $(RECOVERYIMAGE_ID_FILE)
73 $(hide) echo -n "SEANDROIDENFORCE" >> $@
74 $(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
75 @echo "Made recovery image: $@"