[tor-commits] [tor/master] Clean up generated files.

nickm at torproject.org nickm at torproject.org
Wed Mar 18 18:28:01 UTC 2015


commit 7a86d53deef573e110da9af35c9283349942c962
Author: cypherpunks <cypherpunks at torproject.org>
Date:   Wed Feb 25 16:04:02 2015 +0100

    Clean up generated files.
    
    Remove src/or/or_sha1.i and src/common/common_sha1.i on `make clean` and remove
    the temporary micro-revision file when its no longer needed.
    
    Additional changes;
    - show a message when generating the micro-revision file.
    - add the temporary micro revision file to the list of files to be removed on
      `make clean` just in case.
    - fix indentation of the make rule to improve readability.
---
 src/common/include.am |    2 +-
 src/or/include.am     |   32 +++++++++++++++++---------------
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/src/common/include.am b/src/common/include.am
index 5b63392..cad0fe1 100644
--- a/src/common/include.am
+++ b/src/common/include.am
@@ -133,7 +133,7 @@ COMMONHEADERS = \
 
 noinst_HEADERS+= $(COMMONHEADERS)
 
-DISTCLEANFILES+= src/common/common_sha1.i
+CLEANFILES+= src/common/common_sha1.i
 
 src/common/common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(COMMONHEADERS)
 	$(AM_V_GEN)if test "@SHA1SUM@" != none; then \
diff --git a/src/or/include.am b/src/or/include.am
index 47746e2..068519e 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -193,20 +193,22 @@ noinst_HEADERS+= $(ORHEADERS) micro-revision.i
 src/or/config_codedigest.o: src/or/or_sha1.i
 
 micro-revision.i: FORCE
-	@rm -f micro-revision.tmp;				\
-	if test -d "$(top_srcdir)/.git" &&				\
-	  test -x "`which git 2>&1;true`"; then				\
-	  HASH="`cd "$(top_srcdir)" && git rev-parse --short=16 HEAD`";	\
-	  echo \"$$HASH\" > micro-revision.tmp; 			\
-        fi;								\
-	if test ! -f micro-revision.tmp ; then			\
-	  if test ! -f micro-revision.i ; then			\
-	    echo '""' > micro-revision.i;			\
-	  fi;								\
-	elif test ! -f micro-revision.i ||			\
-	  test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
-	  mv micro-revision.tmp micro-revision.i;		\
-	fi; true
+	$(AM_V_GEN)rm -f micro-revision.tmp; \
+	if test -d "$(top_srcdir)/.git" && \
+			test -x "`which git 2>&1;true`"; then \
+		HASH="`cd "$(top_srcdir)" && git rev-parse --short=16 HEAD`"; \
+		echo \"$$HASH\" > micro-revision.tmp; \
+	fi; \
+	if test ! -f micro-revision.tmp; then \
+		if test ! -f micro-revision.i; then \
+			echo '""' > micro-revision.i; \
+		fi; \
+	elif test ! -f micro-revision.i || \
+			test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
+		mv micro-revision.tmp micro-revision.i; \
+	fi; \
+	rm -f micro-revision.tmp; \
+	true
 
 src/or/or_sha1.i: $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS)
 	$(AM_V_GEN)if test "@SHA1SUM@" != none; then \
@@ -220,6 +222,6 @@ src/or/or_sha1.i: $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS)
 	  touch src/or/or_sha1.i; \
 	fi
 
-CLEANFILES+= micro-revision.i src/or/micro-revision.i
+CLEANFILES+= src/or/or_sha1.i micro-revision.i src/or/micro-revision.i micro-revision.tmp
 
 FORCE:





More information about the tor-commits mailing list