summaryrefslogtreecommitdiffstats
path: root/bootimg.mk
blob: f34bb061c24e15e1cfda107b416f9553f9fde39e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright (C) 2012-2014 Paul Kocialkowski <contact@paulk.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

LOCAL_PATH := $(call my-dir)

INSTALLED_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.cpio
INSTALLED_BOOTABLE_TARGET := $(PRODUCT_OUT)/bootable.zip
INSTALLED_UBOOT_SCRIPT_MODULE := $(PRODUCT_OUT)/boot.scr
INSTALLED_UBOOT_SPLASH_MODULE := $(PRODUCT_OUT)/splash.rgb16z

.PHONY: bootable
bootable: $(INSTALLED_BOOTABLE_TARGET)

BUILT_RAMDISK_TARGET := $(INSTALLED_RAMDISK_TARGET)

$(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES)
	$(call pretty,"Target ram disk: $@")
	$(hide) $(MKBOOTFS) $(TARGET_ROOT_OUT) > $@

$(INSTALLED_BOOTIMAGE_TARGET): $(INSTALLED_KERNEL_TARGET)
	$(ACP) $(INSTALLED_KERNEL_TARGET) $@
	@echo -e ${CL_CYN}"Made boot image: $@"${CL_RST}

$(INSTALLED_RECOVERYIMAGE_TARGET): $(INSTALLED_RECOVERY_KERNEL_TARGET)
	$(ACP) $(INSTALLED_RECOVERY_KERNEL_TARGET) $@
	@echo -e ${CL_CYN}"Made recovery image: $@"${CL_RST}

$(INSTALLED_BOOTLOADERIMAGE_TARGET): $(INSTALLED_XLOADER_MODULE) $(INSTALLED_UBOOT_MODULE) $(MKIMAGE)
	@echo -e ${CL_CYN}"Made X-Loader: $(INSTALLED_XLOADER_MODULE)"${CL_RST}
	$(ACP) $(UBOOT_SRC)/../boot-scr/splash.rgb16z $(INSTALLED_UBOOT_SPLASH_MODULE)
	@echo -e ${CL_CYN}"Made U-Boot splash: $(INSTALLED_UBOOT_SPLASH_MODULE)"${CL_RST}
	$(MKIMAGE) -A arm -T script -C none -n "boot.scr" -d $(UBOOT_SRC)/../boot-scr/boot.txt $(INSTALLED_UBOOT_SCRIPT_MODULE)
	@echo -e ${CL_CYN}"Made U-Boot script: $(INSTALLED_UBOOT_SCRIPT_MODULE)"${CL_RST}
	@echo -e ${CL_CYN}"Made U-Boot: $(INSTALLED_UBOOT_MODULE)"${CL_RST}

$(INSTALLED_BOOTABLE_TARGET): $(INSTALLED_RECOVERYIMAGE_TARGET) $(INSTALLED_BOOTLOADERIMAGE_TARGET) $(PRODUCT_OUT)/replicant_gta04_install.sh
	zip -qj $@ $(INSTALLED_RECOVERYIMAGE_TARGET) $(INSTALLED_XLOADER_MODULE) $(INSTALLED_UBOOT_SPLASH_MODULE) $(INSTALLED_UBOOT_SCRIPT_MODULE) $(INSTALLED_UBOOT_MODULE)
	@echo -e ${CL_CYN}"Made bootable: $@"${CL_RST}