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

Unified Diff: src/tlcl/Makefile

Issue 2831027: Add version string in binary and simplify build. (Closed) Base URL: ssh://git@chromiumos-git/tpm_lite.git
Patch Set: sed -> cut and add warnings 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 | src/tlcl/Makefile.firmware » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tlcl/Makefile
diff --git a/src/tlcl/Makefile b/src/tlcl/Makefile
index cb59b95c7002a8274e91ae10eb87c30eac6e8076..791ff5da1fec74dad1f8ab34f20d53d221033929 100644
--- a/src/tlcl/Makefile
+++ b/src/tlcl/Makefile
@@ -18,18 +18,25 @@ HOSTCC = cc
libtlcl.a: tlcl.o
ar rcs libtlcl.a tlcl.o
-tlcl.o: tlcl.c tlcl_internal.h tlcl.h structures.h
+tlcl.o: tlcl.c tlcl_internal.h tlcl.h \
+ update-structures structures.h update-version version.h
-structures.h: generator
- ./generator > structures.h
- sed -e '0,/This file is automatically/d' < structures.h > x.tmp
- sed -e '0,/This file is automatically/d' < saved-structures.h > y.tmp
- cmp -s x.tmp y.tmp || \
- (echo "Please update saved-structures.h" && false)
+update-structures: generator
+ ./generator > structures.tmp
+ cmp -s structures.tmp structures.h || \
+ ( echo "%% Updating structures.h %%" && \
+ cp structures.tmp structures.h )
+
+update-version:
+ find \( -name '*.[ch]' -o -name 'Makefile*' \) -a \! -name version.h \
+ | sort | xargs cat | md5sum | cut -c 25-32 > x.tmp
+ echo "char* TlclVersion = \"TLCLv=$$(cat x.tmp)\";" > version.tmp
+ cmp -s version.tmp version.h || \
+ ( echo "** Updating version.h **" && cp version.tmp version.h )
generator: generator.c tlcl.h
$(HOSTCC) $(LOCAL_CFLAGS) -I$(ROOT)/usr/include \
-fpack-struct generator.c -o generator
clean:
- rm -f generator *.o *.a structures.h x.tmp y.tmp *~
+ rm -f generator *.o *.a version.tmp structures.tmp x.tmp *~
« no previous file with comments | « no previous file | src/tlcl/Makefile.firmware » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698