mirror of
https://github.com/ivoszbg/uniLoader.git
synced 2024-11-10 06:00:07 +00:00
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:
parent
c038c7839c
commit
e246a8d60a
22
Kconfig
22
Kconfig
@ -4,6 +4,7 @@
|
|||||||
#
|
#
|
||||||
mainmenu "uniLoader Configuration"
|
mainmenu "uniLoader Configuration"
|
||||||
|
|
||||||
|
menu "Building options"
|
||||||
config CROSS_COMPILE
|
config CROSS_COMPILE
|
||||||
string "Cross-compiler tool prefix"
|
string "Cross-compiler tool prefix"
|
||||||
help
|
help
|
||||||
@ -12,6 +13,27 @@ config CROSS_COMPILE
|
|||||||
need to set this unless you want the configured kernel build
|
need to set this unless you want the configured kernel build
|
||||||
directory to select the cross-compiler automatically.
|
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 "lib/Kconfig"
|
||||||
|
|
||||||
source "soc/Kconfig"
|
source "soc/Kconfig"
|
||||||
|
13
Makefile
13
Makefile
@ -1,11 +1,5 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
#
|
|
||||||
# Defaut values
|
|
||||||
#
|
|
||||||
KERNEL_PATH?=blob/Image
|
|
||||||
DTB_PATH?=blob/dtb
|
|
||||||
|
|
||||||
# *DOCUMENTATION*
|
# *DOCUMENTATION*
|
||||||
# To see a list of typical targets execute "make help"
|
# To see a list of typical targets execute "make help"
|
||||||
# More info can be located in ./README
|
# More info can be located in ./README
|
||||||
@ -106,6 +100,8 @@ VPATH := $(srctree)
|
|||||||
export srctree objtree VPATH
|
export srctree objtree VPATH
|
||||||
|
|
||||||
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
|
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
|
||||||
|
KERNEL_PATH ?= $(CONFIG_KERNEL_PATH:"%"=%)
|
||||||
|
DT_PATH ?= $(CONFIG_DT_PATH:"%"=%)
|
||||||
|
|
||||||
KCONFIG_CONFIG ?= .config
|
KCONFIG_CONFIG ?= .config
|
||||||
export KCONFIG_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
|
cmd_uniLoader = $(LD) $(main-y) $(uniLoader-libs) -o $@.o --script=main/linker.lds
|
||||||
|
|
||||||
main/linker.lds: main/linker.lds.S $(KERNEL_PATH)
|
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)
|
uniLoader: $(uniLoader-all)
|
||||||
$(call if_changed,uniLoader)
|
$(call if_changed,uniLoader)
|
||||||
@ -385,7 +381,6 @@ PHONY += $(uniLoader-dirs)
|
|||||||
$(uniLoader-dirs): scripts_basic
|
$(uniLoader-dirs): scripts_basic
|
||||||
$(Q)$(MAKE) $(build)=$@
|
$(Q)$(MAKE) $(build)=$@
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# Cleaning is done on three levels.
|
# Cleaning is done on three levels.
|
||||||
# make clean Delete most generated files
|
# make clean Delete most generated files
|
||||||
@ -416,7 +411,7 @@ clean: $(clean-dirs)
|
|||||||
$(call cmd,rmfiles)
|
$(call cmd,rmfiles)
|
||||||
@find . $(RCS_FIND_IGNORE) \
|
@find . $(RCS_FIND_IGNORE) \
|
||||||
\( -name '*.[oas]' -o -name '.*.cmd' \
|
\( -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 modules.builtin -o -name '.tmp_*.o.*' \
|
||||||
-o -name '*.gcno' \) -type f -print | xargs rm -f
|
-o -name '*.gcno' \) -type f -print | xargs rm -f
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user