diff options
author | Robert Lippert <rlippert@google.com> | 2013-10-24 16:38:18 -0700 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-10-16 10:42:53 -0500 |
commit | f808a3099ed6c3e362529fe283573b2028929299 (patch) | |
tree | e56cb58352a7517142a150659a23c5fb6da00f55 /src/usr/errl | |
parent | 60a6933fb818b282fb7aa50b4a7f4d98ebd4657f (diff) | |
download | talos-hostboot-f808a3099ed6c3e362529fe283573b2028929299.tar.gz talos-hostboot-f808a3099ed6c3e362529fe283573b2028929299.zip |
build fix: don't rebuild errldisplaydata.C every time.
This changes to only update the errl genfiles if their contents
change to avoid extraneous build actions.
Change-Id: I8ff4621d02c5506146ef5abd72031f4dc04c665c
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11295
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/errl')
-rwxr-xr-x | src/usr/errl/parser/genErrlParsers.pl | 16 | ||||
-rw-r--r-- | src/usr/errl/parser/makefile | 4 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl index 7fb516683..a2ec5f08c 100755 --- a/src/usr/errl/parser/genErrlParsers.pl +++ b/src/usr/errl/parser/genErrlParsers.pl @@ -1052,14 +1052,14 @@ close(OFILE); # because this is actually part of hostboot. #------------------------------------------------------------------------------ $outputFileName = $outputDir . "/../errldisplaydata.C"; -open(OFILE, ">", $outputFileName) or die("Cannot open: $outputFileName: $!"); +open(OFILE, ">", $outputFileName . ".tmp") or + die("Cannot open: $outputFileName.tmp: $!"); print OFILE "/*\n"; print OFILE " * Automatically generated by Hostboot's $0\n"; print OFILE " * Do not modify this file in the hostboot tree, it is automatically\n"; print OFILE " * generated every build.\n"; print OFILE " *\n"; -print OFILE " * TimeStamp: $timestamp\n"; print OFILE " * Image Id: $imageId\n"; print OFILE " *\n"; print OFILE " */\n\n"; @@ -1091,6 +1091,18 @@ print OFILE "uint16_t ErrLogDisplay::compTableSize = sizeof(compTable) / sizeof( print OFILE "} // End Namespace\n"; close(OFILE); +use File::Compare; +use File::Copy; + +if (compare($outputFileName . ".tmp", $outputFileName) != 0) { + move($outputFileName . ".tmp", $outputFileName) or + die("Cannot move $outputFileName.tmp to $outputFileName: $!"); +} +else +{ + unlink $outputFileName . ".tmp"; +} + #------------------------------------------------------------------------------ # Subroutine that prints the usage #------------------------------------------------------------------------------ diff --git a/src/usr/errl/parser/makefile b/src/usr/errl/parser/makefile index 05a3ab0fa..16976271e 100644 --- a/src/usr/errl/parser/makefile +++ b/src/usr/errl/parser/makefile @@ -82,7 +82,9 @@ ${GENDIR}/comps.C: ${ROOTPATH}/src/include/usr/hbotcompid.H mkdirs grep "const compId_t [A-Z0-9]*_COMP_ID" $< | \ grep -v MY_COMP_ID | \ sed 's/const compId_t \([A-Z0-9]*\)_COMP_ID[ =\t]*\(0[xX][0-9a-fA-F]*\).*/{ "\1", \2 },/' \ - > $@ + > $@.tmp + cmp -s $@.tmp $@ || mv $@.tmp $@ + rm -f $@.tmp ${OBJDIR}/errlparser.o: errlparser.C ${ROOTPATH}/src/include/usr/errl/hberrltypes.H ${GENDIR}/comps.C $(CC) -c $(CFLAGS) -o $@ $< |