blob: 7eaf96c445faf89e49d119ced769a2bf20b2b58e [file] [log] [blame]
Dan Pasanen24a1cc92016-12-28 22:59:21 -06001#
2# Copyright (C) 2016 The CyanogenMod Project
Zhao Wei Liewd0850b32017-02-11 06:01:13 +08003# 2017 The LineageOS Project
Dan Pasanen24a1cc92016-12-28 22:59:21 -06004#
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#
17
LuK133756030be2018-02-25 19:05:14 +010018ifeq ($(TARGET_SCREEN_WIDTH),)
19 $(warning TARGET_SCREEN_WIDTH is not set, using default value: 1080)
20 TARGET_SCREEN_WIDTH := 1080
21endif
22ifeq ($(TARGET_SCREEN_HEIGHT),)
23 $(warning TARGET_SCREEN_HEIGHT is not set, using default value: 1920)
24 TARGET_SCREEN_HEIGHT := 1920
25endif
26
Dan Pasanen24a1cc92016-12-28 22:59:21 -060027define build-bootanimation
Vasyl Gellobc4bce82019-07-01 13:52:35 +000028 $(shell) vendor/lineage/bootanimation/generate-bootanimation.sh \
29 $(PRODUCT_OUT) \
Dan Pasanen24a1cc92016-12-28 22:59:21 -060030 $(TARGET_SCREEN_WIDTH) \
31 $(TARGET_SCREEN_HEIGHT) \
32 $(TARGET_BOOTANIMATION_HALF_RES)
33endef
34
35TARGET_GENERATED_BOOTANIMATION := $(TARGET_OUT_INTERMEDIATES)/BOOTANIMATION/bootanimation.zip
36$(TARGET_GENERATED_BOOTANIMATION):
37 @echo "Building bootanimation"
38 $(build-bootanimation)
39
40ifeq ($(TARGET_BOOTANIMATION),)
41 TARGET_BOOTANIMATION := $(TARGET_GENERATED_BOOTANIMATION)
Zhao Wei Liewd0850b32017-02-11 06:01:13 +080042 ifeq ($(shell command -v mogrify),)
Dan Pasanen24a1cc92016-12-28 22:59:21 -060043 $(info **********************************************)
44 $(info The boot animation could not be generated as)
45 $(info ImageMagick is not installed in your system.)
46 $(info $(space))
47 $(info Please install ImageMagick from this website:)
48 $(info https://imagemagick.org/script/binary-releases.php)
49 $(info **********************************************)
50 $(error stop)
51 endif
52endif
53
Dan Pasanen24a1cc92016-12-28 22:59:21 -060054include $(CLEAR_VARS)
55LOCAL_MODULE := bootanimation.zip
56LOCAL_MODULE_CLASS := ETC
57LOCAL_MODULE_PATH := $(TARGET_OUT)/media
58
59include $(BUILD_SYSTEM)/base_rules.mk
60
61$(LOCAL_BUILT_MODULE): $(TARGET_BOOTANIMATION)
62 @mkdir -p $(dir $@)
63 @cp $(TARGET_BOOTANIMATION) $@