Merge tag 'pull-24apr19' of git://git.denx.de/u-boot-dm
[oweals/u-boot.git] / Makefile
index 66a09ac900c37511054b9fb30693b2daf0aeac15..f2c7bb6041a25d0d3bc0795d1e44c7ec3a4cb763 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1977,6 +1977,13 @@ endif
        $(build)=$(build-dir) $(@:.ko=.o)
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 
+quiet_cmd_genenv = GENENV $@
+cmd_genenv = $(OBJCOPY) --dump-section .rodata.default_environment=$@ env/common.o; \
+       sed --in-place -e 's/\x00/\x0A/g' $@
+
+u-boot-initial-env: u-boot.bin
+       $(call if_changed,genenv)
+
 # Consistency checks
 # ---------------------------------------------------------------------------