Patrick Georgi | 8480c0b | 2020-05-08 22:50:46 +0200 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Philipp Deppenwiese | 0f0e4e6 | 2018-06-19 20:22:32 +0200 | [diff] [blame] | 2 | |
Philipp Deppenwiese | 0f0e4e6 | 2018-06-19 20:22:32 +0200 | [diff] [blame] | 3 | project_dir=linuxboot |
Philipp Deppenwiese | 0f0e4e6 | 2018-06-19 20:22:32 +0200 | [diff] [blame] | 4 | |
| 5 | unexport $(COREBOOT_EXPORTS) |
Patrick Rudolph | 02c0814 | 2018-03-13 11:22:26 +0100 | [diff] [blame] | 6 | |
Marcello Sylvester Bauer | 9d3b1b2 | 2018-11-04 11:24:28 +0100 | [diff] [blame] | 7 | all: linuxboot |
Philipp Deppenwiese | 0f0e4e6 | 2018-06-19 20:22:32 +0200 | [diff] [blame] | 8 | |
Marcello Sylvester Bauer | 78d0256 | 2018-11-11 18:03:26 +0100 | [diff] [blame] | 9 | u-root: |
| 10 | $(MAKE) -f targets/u-root.mk |
| 11 | |
| 12 | ifeq ($(CONFIG_LINUXBOOT_BUILD_INITRAMFS),y) |
| 13 | ifeq ($(CONFIG_LINUXBOOT_UROOT),y) |
| 14 | initramfs: u-root |
| 15 | endif |
| 16 | else |
| 17 | ifneq ($(CONFIG_LINUXBOOT_INITRAMFS),) |
| 18 | initramfs: |
| 19 | if [[ ! -f "$(top)/$(CONFIG_LINUXBOOT_INITRAMFS)" ]]; then \ |
| 20 | echo "<< Linux initramfs '$(CONFIG_LINUXBOOT_INITRAMFS)' is missing. >>"; \ |
Patrick Rudolph | 02c0814 | 2018-03-13 11:22:26 +0100 | [diff] [blame] | 21 | exit 1; \ |
| 22 | fi |
Marcello Sylvester Bauer | 78d0256 | 2018-11-11 18:03:26 +0100 | [diff] [blame] | 23 | endif |
Philipp Deppenwiese | 0f0e4e6 | 2018-06-19 20:22:32 +0200 | [diff] [blame] | 24 | endif |
| 25 | |
Marcello Sylvester Bauer | e102c5d | 2018-11-21 17:45:43 +0100 | [diff] [blame] | 26 | initramfs_compressed: initramfs |
| 27 | ifeq ($(CONFIG_LINUXBOOT_INITRAMFS_COMPRESSION_XZ),y) |
Marcello Sylvester Bauer | f1d6883 | 2018-11-29 16:34:39 +0100 | [diff] [blame] | 28 | xz --keep --force --check=crc32 --lzma2=dict=1MiB $(top)/$(CONFIG_LINUXBOOT_INITRAMFS) |
Marcello Sylvester Bauer | e102c5d | 2018-11-21 17:45:43 +0100 | [diff] [blame] | 29 | endif |
| 30 | |
Marcello Sylvester Bauer | 78d0256 | 2018-11-11 18:03:26 +0100 | [diff] [blame] | 31 | ifeq ($(CONFIG_LINUXBOOT_COMPILE_KERNEL),y) |
| 32 | ifeq ($(CONFIG_LINUXBOOT_ARCH),arm64) |
| 33 | kernel: initramfs |
Marcello Sylvester Bauer | 79f9291 | 2018-12-05 08:45:26 +0100 | [diff] [blame] | 34 | if [[ ! -f "$(top)/$(CONFIG_LINUXBOOT_DTB_FILE)" ]]; then \ |
| 35 | echo "<< Linux kernel devicetree is missing. >>"; \ |
| 36 | exit 1; \ |
| 37 | fi |
Marcello Sylvester Bauer | 78d0256 | 2018-11-11 18:03:26 +0100 | [diff] [blame] | 38 | $(MAKE) -f targets/linux.mk |
Patrick Rudolph | 02c0814 | 2018-03-13 11:22:26 +0100 | [diff] [blame] | 39 | else |
Marcello Sylvester Bauer | 78d0256 | 2018-11-11 18:03:26 +0100 | [diff] [blame] | 40 | kernel: |
| 41 | $(MAKE) -f targets/linux.mk |
| 42 | endif |
| 43 | else |
| 44 | kernel: |
| 45 | if [[ ! -f "$(top)/$(CONFIG_LINUXBOOT_KERNEL)" ]]; then \ |
| 46 | echo "<< Linux kernel '$(CONFIG_LINUXBOOT_KERNEL)' is missing. >>"; \ |
| 47 | exit 1; \ |
| 48 | fi |
Philipp Deppenwiese | 0f0e4e6 | 2018-06-19 20:22:32 +0200 | [diff] [blame] | 49 | endif |
| 50 | |
Marcello Sylvester Bauer | e102c5d | 2018-11-21 17:45:43 +0100 | [diff] [blame] | 51 | linuxboot: kernel initramfs_compressed |
Patrick Rudolph | 02c0814 | 2018-03-13 11:22:26 +0100 | [diff] [blame] | 52 | |
Philipp Deppenwiese | 0f0e4e6 | 2018-06-19 20:22:32 +0200 | [diff] [blame] | 53 | clean: |
Arthur Heymans | 241c1c6 | 2022-06-15 15:19:42 +0200 | [diff] [blame^] | 54 | rm -rf $(project_dir)/kernel* |
Marcello Sylvester Bauer | e102c5d | 2018-11-21 17:45:43 +0100 | [diff] [blame] | 55 | rm -f $(project_dir)/u-root |
| 56 | rm -f $(project_dir)/initramfs* |
Patrik Tesarik | f5c2f25 | 2022-06-11 21:47:21 +0200 | [diff] [blame] | 57 | rm -f $(project_dir)/bzImage |
Philipp Deppenwiese | 0f0e4e6 | 2018-06-19 20:22:32 +0200 | [diff] [blame] | 58 | |
| 59 | distclean: |
| 60 | rm -rf $(project_dir) |
| 61 | |
Marcello Sylvester Bauer | e102c5d | 2018-11-21 17:45:43 +0100 | [diff] [blame] | 62 | .PHONY: linuxboot kernel initramfs_compressed initramfs u-root clean distclean |