Makefile: Move Linux kernel and Device Tree paths to Kconfig

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
This commit is contained in:
ivoszbg 2022-06-14 21:50:15 +03:00
parent c038c7839c
commit e246a8d60a
2 changed files with 33 additions and 16 deletions

22
Kconfig
View File

@ -4,6 +4,7 @@
#
mainmenu "uniLoader Configuration"
menu "Building options"
config CROSS_COMPILE
string "Cross-compiler tool prefix"
help
@ -12,6 +13,27 @@ config CROSS_COMPILE
need to set this unless you want the configured kernel build
directory to select the cross-compiler automatically.
config EMBED_LINUX
bool "Embed linux kernel and device tree"
default y
help
Select this if you want uniLoader to load a linux kernel and device tree
config KERNEL_PATH
string "Path to kernel image"
depends on EMBED_LINUX
default blob/Image
help
Path to the kernel, which is going to get embedded to uniLoader
config DT_PATH
string "Path to device tree image"
depends on EMBED_LINUX
default blob/dtb
help
Path to the device tree, which is going to get embedded to uniLoader
endmenu
source "lib/Kconfig"
source "soc/Kconfig"

View File

@ -1,11 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
#
# Defaut values
#
KERNEL_PATH?=blob/Image
DTB_PATH?=blob/dtb
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
# More info can be located in ./README
@ -106,6 +100,8 @@ VPATH := $(srctree)
export srctree objtree VPATH
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
KERNEL_PATH ?= $(CONFIG_KERNEL_PATH:"%"=%)
DT_PATH ?= $(CONFIG_DT_PATH:"%"=%)
KCONFIG_CONFIG ?= .config
export KCONFIG_CONFIG
@ -362,7 +358,7 @@ quiet_cmd_uniLoader = LD $@.o
cmd_uniLoader = $(LD) $(main-y) $(uniLoader-libs) -o $@.o --script=main/linker.lds
main/linker.lds: main/linker.lds.S $(KERNEL_PATH)
$(CPP) $< -DKERNEL_PATH=$(KERNEL_PATH) -DDTB_PATH=$(DTB_PATH) -P -o $@
$(CPP) $< -DKERNEL_PATH=$(KERNEL_PATH) -DDTB_PATH=$(DT_PATH) -P -o $@
uniLoader: $(uniLoader-all)
$(call if_changed,uniLoader)
@ -385,7 +381,6 @@ PHONY += $(uniLoader-dirs)
$(uniLoader-dirs): scripts_basic
$(Q)$(MAKE) $(build)=$@
###
# Cleaning is done on three levels.
# make clean Delete most generated files
@ -416,7 +411,7 @@ clean: $(clean-dirs)
$(call cmd,rmfiles)
@find . $(RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '.*.cmd' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' -o -name '*.lds' \
-o -name modules.builtin -o -name '.tmp_*.o.*' \
-o -name '*.gcno' \) -type f -print | xargs rm -f