WindCharger: Fixed u-boot build race condition.
The .depend file in the windcharger board's implementation dir looks for
a file that is autogenerated by the root Makefile:
include/version_autogenerated.h
This file can exist without having been completely created by the root
Makefile. This change forces the u-boot's main dependency array (built
by the root Makefile) to wait for the "version" directive to complete first.
This was tested using abf@ suggestion to splice in a sleep 5s in the
version directive while running a parallel make. This change resulted
in parallel makes completing successfully every time.
Change-Id: I23448f9ae07f538ffffb48cda7ba6cf4adf8f7d3
diff --git a/Makefile b/Makefile
index 42ae18d..e73e5fa 100755
--- a/Makefile
+++ b/Makefile
@@ -219,7 +219,12 @@
u-boot.dis: u-boot
$(OBJDUMP) -d $< > $@
-u-boot: depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT) board/atheros/board953x/extra.o
+U_BOOT_MAIN_DEPS = $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT) \
+ board/atheros/board953x/extra.o
+
+$(U_BOOT_MAIN_DEPS): version
+
+u-boot: depend $(U_BOOT_MAIN_DEPS)
UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
$(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) $(BOARD_EXTRA_OBJS) board/atheros/board953x/extra.o \
--start-group $(LIBS) --end-group $(PLATFORM_LIBS) \