]> git.sur5r.net Git - u-boot/blobdiff - Makefile
Allow providing default environment from file
[u-boot] / Makefile
index 5fa14789d99f7f265385029fa55954a9157e05ae..bfe115cf18de0e2b2460f5435404c995cdea8952 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,9 @@
 #
 
 VERSION = 2018
-PATCHLEVEL = 03
+PATCHLEVEL = 05
 SUBLEVEL =
-EXTRAVERSION =
+EXTRAVERSION = -rc1
 NAME =
 
 # *DOCUMENTATION*
@@ -423,6 +423,7 @@ endif
 
 version_h := include/generated/version_autogenerated.h
 timestamp_h := include/generated/timestamp_autogenerated.h
+defaultenv_h := include/generated/defaultenv_autogenerated.h
 
 no-dot-config-targets := clean clobber mrproper distclean \
                         help %docs check% coccicheck \
@@ -600,9 +601,13 @@ KBUILD_CFLAGS      += -g
 KBUILD_AFLAGS  += -g
 
 # Report stack usage if supported
+# ARC tools based on GCC 7.1 has an issue with stack usage
+# with naked functions, see commit message for more details
+ifndef CONFIG_ARC
 ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-stack-usage.sh $(CC)),y)
        KBUILD_CFLAGS += -fstack-usage
 endif
+endif
 
 KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
 
@@ -1387,6 +1392,10 @@ ifeq ($(wildcard $(LDSCRIPT)),)
        @/bin/false
 endif
 
+ifeq ($(CONFIG_USE_DEFAULT_ENV_FILE),y)
+prepare1: $(defaultenv_h)
+endif
+
 archprepare: prepare1 scripts_basic
 
 prepare0: archprepare FORCE
@@ -1434,12 +1443,23 @@ define filechk_timestamp.h
        fi)
 endef
 
+define filechk_defaultenv.h
+       (grep -v '^#' | \
+        grep -v '^$$' | \
+        tr '\n' '\0' | \
+        sed -e 's/\\\x0/\n/' | \
+        xxd -i ; echo ", 0x00" ; )
+endef
+
 $(version_h): include/config/uboot.release FORCE
        $(call filechk,version.h)
 
 $(timestamp_h): $(srctree)/Makefile FORCE
        $(call filechk,timestamp.h)
 
+$(defaultenv_h): $(CONFIG_DEFAULT_ENV_FILE:"%"=%) FORCE
+       $(call filechk,defaultenv.h)
+
 # ---------------------------------------------------------------------------
 quiet_cmd_cpp_lds = LDS     $@
 cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \