Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2016 The CyanogenMod Project |
Zhao Wei Liew | d0850b3 | 2017-02-11 06:01:13 +0800 | [diff] [blame] | 3 | # 2017 The LineageOS Project |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 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 | # |
| 17 | |
LuK1337 | 56030be | 2018-02-25 19:05:14 +0100 | [diff] [blame] | 18 | ifeq ($(TARGET_SCREEN_WIDTH),) |
| 19 | $(warning TARGET_SCREEN_WIDTH is not set, using default value: 1080) |
| 20 | TARGET_SCREEN_WIDTH := 1080 |
| 21 | endif |
| 22 | ifeq ($(TARGET_SCREEN_HEIGHT),) |
| 23 | $(warning TARGET_SCREEN_HEIGHT is not set, using default value: 1920) |
| 24 | TARGET_SCREEN_HEIGHT := 1920 |
| 25 | endif |
| 26 | |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 27 | define build-bootanimation |
Dan Pasanen | 91f7620 | 2017-07-06 08:21:30 -0500 | [diff] [blame] | 28 | sh vendor/lineage/bootanimation/generate-bootanimation.sh \ |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 29 | $(TARGET_SCREEN_WIDTH) \ |
| 30 | $(TARGET_SCREEN_HEIGHT) \ |
| 31 | $(TARGET_BOOTANIMATION_HALF_RES) |
| 32 | endef |
| 33 | |
| 34 | TARGET_GENERATED_BOOTANIMATION := $(TARGET_OUT_INTERMEDIATES)/BOOTANIMATION/bootanimation.zip |
| 35 | $(TARGET_GENERATED_BOOTANIMATION): |
| 36 | @echo "Building bootanimation" |
| 37 | $(build-bootanimation) |
| 38 | |
| 39 | ifeq ($(TARGET_BOOTANIMATION),) |
| 40 | TARGET_BOOTANIMATION := $(TARGET_GENERATED_BOOTANIMATION) |
Zhao Wei Liew | d0850b3 | 2017-02-11 06:01:13 +0800 | [diff] [blame] | 41 | ifeq ($(shell command -v mogrify),) |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 42 | $(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 |
| 51 | endif |
| 52 | |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 53 | include $(CLEAR_VARS) |
| 54 | LOCAL_MODULE := bootanimation.zip |
| 55 | LOCAL_MODULE_CLASS := ETC |
| 56 | LOCAL_MODULE_PATH := $(TARGET_OUT)/media |
| 57 | |
| 58 | include $(BUILD_SYSTEM)/base_rules.mk |
| 59 | |
| 60 | $(LOCAL_BUILT_MODULE): $(TARGET_BOOTANIMATION) |
| 61 | @mkdir -p $(dir $@) |
| 62 | @cp $(TARGET_BOOTANIMATION) $@ |