blob: 9526112c6e7d532d4bddf2ad0a63024129d37aac [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
18define build-bootanimation
Dan Pasanen91f76202017-07-06 08:21:30 -050019 sh vendor/lineage/bootanimation/generate-bootanimation.sh \
Dan Pasanen24a1cc92016-12-28 22:59:21 -060020 $(TARGET_SCREEN_WIDTH) \
21 $(TARGET_SCREEN_HEIGHT) \
22 $(TARGET_BOOTANIMATION_HALF_RES)
23endef
24
25TARGET_GENERATED_BOOTANIMATION := $(TARGET_OUT_INTERMEDIATES)/BOOTANIMATION/bootanimation.zip
26$(TARGET_GENERATED_BOOTANIMATION):
27 @echo "Building bootanimation"
28 $(build-bootanimation)
29
30ifeq ($(TARGET_BOOTANIMATION),)
31 TARGET_BOOTANIMATION := $(TARGET_GENERATED_BOOTANIMATION)
Zhao Wei Liewd0850b32017-02-11 06:01:13 +080032 ifeq ($(shell command -v mogrify),)
Dan Pasanen24a1cc92016-12-28 22:59:21 -060033 $(info **********************************************)
34 $(info The boot animation could not be generated as)
35 $(info ImageMagick is not installed in your system.)
36 $(info $(space))
37 $(info Please install ImageMagick from this website:)
38 $(info https://imagemagick.org/script/binary-releases.php)
39 $(info **********************************************)
40 $(error stop)
41 endif
42endif
43
44include $(CLEAR_VARS)
45LOCAL_MODULE := bootanimation.zip
46LOCAL_MODULE_CLASS := ETC
47LOCAL_MODULE_PATH := $(TARGET_OUT)/media
48
49include $(BUILD_SYSTEM)/base_rules.mk
50
51$(LOCAL_BUILT_MODULE): $(TARGET_BOOTANIMATION)
52 @mkdir -p $(dir $@)
53 @cp $(TARGET_BOOTANIMATION) $@