[makesystem] reworked default environment handling
This patch improves the default environment handling, now the makesystem bails out if the default environment path is empty or points to an invalid directory (with activated default environment). It also fixes this error: find: invalid predicate `' Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
981499dd40
commit
7b498d9838
16
Makefile
16
Makefile
|
@ -4,6 +4,22 @@ SUBLEVEL = 0
|
|||
EXTRAVERSION =-git
|
||||
NAME = Homicidal Dwarf Hamster
|
||||
|
||||
#
|
||||
# sanity checks for check default environemnt
|
||||
#
|
||||
ifdef CONFIG_DEFAULT_ENVIRONMENT
|
||||
|
||||
ifeq ($(CONFIG_DEFAULT_ENVIRONMENT_PATH),"")
|
||||
$(error default environment path empty))
|
||||
endif
|
||||
|
||||
saved-env_path := $(CONFIG_DEFAULT_ENVIRONMENT_PATH)
|
||||
CONFIG_DEFAULT_ENVIRONMENT_PATH := $(shell cd $(CONFIG_DEFAULT_ENVIRONMENT_PATH) && /bin/pwd)
|
||||
$(if $(CONFIG_DEFAULT_ENVIRONMENT_PATH),, \
|
||||
$(error default environment path $(saved-env_path) does not exist))
|
||||
|
||||
endif # ifdef CONFIG_DEFAULT_ENVIRONMENT
|
||||
|
||||
# *DOCUMENTATION*
|
||||
# To see a list of typical targets execute "make help"
|
||||
# More info can be located in ./README
|
||||
|
|
|
@ -19,14 +19,13 @@ obj-y += memsize.o
|
|||
obj-$(CONFIG_MODULES) += module.o
|
||||
extra-$(CONFIG_MODULES) += module.lds
|
||||
|
||||
ifdef CONFIG_DEFAULT_ENVIRONMENT_PATH
|
||||
|
||||
startup.o: include/uboot_default_env.h
|
||||
|
||||
include/uboot_default_env.h: $(shell find $(CONFIG_DEFAULT_ENVIRONMENT_PATH) -type f)
|
||||
$(Q)scripts/ubootenv -s $(CONFIG_DEFAULT_ENVIRONMENT_PATH) uboot_default_env
|
||||
$(Q)cat uboot_default_env | scripts/bin2c default_environment > $@
|
||||
|
||||
ifdef CONFIG_DEFAULT_ENVIRONMENT
|
||||
$(obj)/startup.o: include/uboot_default_env.h
|
||||
$(obj)/env.o: include/uboot_default_env.h
|
||||
endif
|
||||
|
||||
ENV_FILES := $(shell find $(CONFIG_DEFAULT_ENVIRONMENT_PATH))
|
||||
endif # ifdef CONFIG_DEFAULT_ENVIRONMENT
|
||||
|
||||
include/uboot_default_env.h: $(ENV_FILES)
|
||||
$(Q)scripts/ubootenv -s $(CONFIG_DEFAULT_ENVIRONMENT_PATH) | \
|
||||
scripts/bin2c default_environment > $@
|
||||
|
|
Loading…
Reference in New Issue