Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: firmware/Makefile

Issue 2817025: Automated version generation for vboot firmware. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Version ochange due to merging Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/Makefile
diff --git a/firmware/Makefile b/firmware/Makefile
index 2dc804801a37818c431a85c1f7152e4a31c436ee..952a1b6bd70bdd076ec50143d1faa35f9bc44eba 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -39,12 +39,22 @@ STUB_SRCS = \
./stub/tlcl.c \
./stub/utility_stub.c
-ALL_SRCS = ${LIB_SRCS} ${STUB_SRCS}
+ALL_SRCS = ${LIB_SRCS} ${STUB_SRCS} version.c
-test : $(FWLIB)
+test : $(FWLIB) update-version
$(CC) $(CFLAGS) $(INCLUDES) -o $(BUILD_ROOT)/a.out \
$(TESTDIR)/main.c $(FWLIB)
+# This is executed at every make, to see if anything has changed
+update-version :
+ find \( -name '*.[ch]' -o -name 'Makefile*' \) -a \! -name version.c \
+ | sort | xargs cat | md5sum | cut -c 25-32 > x.tmp
+ echo "char* VbootVersion = \"VBOOv=$$(cat x.tmp)\";" > version.tmp
+ cmp -s version.tmp version.c || \
+ ( echo "** Updating version.c **" && \
+ cp version.tmp version.c )
+
+
include ../common.mk
$(FWLIB) : $(ALL_OBJS)
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698