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 | |
| 18 | define build-bootanimation |
Dan Pasanen | 91f7620 | 2017-07-06 08:21:30 -0500 | [diff] [blame] | 19 | sh vendor/lineage/bootanimation/generate-bootanimation.sh \ |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 20 | $(TARGET_SCREEN_WIDTH) \ |
| 21 | $(TARGET_SCREEN_HEIGHT) \ |
| 22 | $(TARGET_BOOTANIMATION_HALF_RES) |
| 23 | endef |
| 24 | |
| 25 | TARGET_GENERATED_BOOTANIMATION := $(TARGET_OUT_INTERMEDIATES)/BOOTANIMATION/bootanimation.zip |
| 26 | $(TARGET_GENERATED_BOOTANIMATION): |
| 27 | @echo "Building bootanimation" |
| 28 | $(build-bootanimation) |
| 29 | |
| 30 | ifeq ($(TARGET_BOOTANIMATION),) |
| 31 | TARGET_BOOTANIMATION := $(TARGET_GENERATED_BOOTANIMATION) |
Zhao Wei Liew | d0850b3 | 2017-02-11 06:01:13 +0800 | [diff] [blame] | 32 | ifeq ($(shell command -v mogrify),) |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 33 | $(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 |
| 42 | endif |
| 43 | |
| 44 | include $(CLEAR_VARS) |
| 45 | LOCAL_MODULE := bootanimation.zip |
| 46 | LOCAL_MODULE_CLASS := ETC |
| 47 | LOCAL_MODULE_PATH := $(TARGET_OUT)/media |
| 48 | |
| 49 | include $(BUILD_SYSTEM)/base_rules.mk |
| 50 | |
| 51 | $(LOCAL_BUILT_MODULE): $(TARGET_BOOTANIMATION) |
| 52 | @mkdir -p $(dir $@) |
| 53 | @cp $(TARGET_BOOTANIMATION) $@ |