blob: a608035ffb9e9ac7298698ccd32740d580cda656 [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
Dan Pasanen91f76202017-07-06 08:21:30 -050028 sh vendor/lineage/bootanimation/generate-bootanimation.sh \
Dan Pasanen24a1cc92016-12-28 22:59:21 -060029 $(TARGET_SCREEN_WIDTH) \
30 $(TARGET_SCREEN_HEIGHT) \
31 $(TARGET_BOOTANIMATION_HALF_RES)
32endef
33
34TARGET_GENERATED_BOOTANIMATION := $(TARGET_OUT_INTERMEDIATES)/BOOTANIMATION/bootanimation.zip
35$(TARGET_GENERATED_BOOTANIMATION):
36 @echo "Building bootanimation"
37 $(build-bootanimation)
38
39ifeq ($(TARGET_BOOTANIMATION),)
40 TARGET_BOOTANIMATION := $(TARGET_GENERATED_BOOTANIMATION)
Zhao Wei Liewd0850b32017-02-11 06:01:13 +080041 ifeq ($(shell command -v mogrify),)
Dan Pasanen24a1cc92016-12-28 22:59:21 -060042 $(info **********************************************)
43 $(info The boot animation could not be generated as)
44 $(info ImageMagick is not installed in your system.)
45 $(info $(space))
46 $(info Please install ImageMagick from this website:)
47 $(info https://imagemagick.org/script/binary-releases.php)
48 $(info **********************************************)
49 $(error stop)
50 endif
51endif
52
Dan Pasanen24a1cc92016-12-28 22:59:21 -060053include $(CLEAR_VARS)
54LOCAL_MODULE := bootanimation.zip
55LOCAL_MODULE_CLASS := ETC
56LOCAL_MODULE_PATH := $(TARGET_OUT)/media
57
58include $(BUILD_SYSTEM)/base_rules.mk
59
60$(LOCAL_BUILT_MODULE): $(TARGET_BOOTANIMATION)
61 @mkdir -p $(dir $@)
62 @cp $(TARGET_BOOTANIMATION) $@