Do not allow stamp or $(VERSION_FILE) to succeed without gitcrement
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 12 Aug 2012 18:07:59 +0000 (14:07 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 12 Aug 2012 18:08:03 +0000 (14:08 -0400)
Makefile

index 47a80672130dec809f98ea7ffbcf94576b925217..7771de0c06ee237cec24d52f540aca33fabf6f86 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -53,17 +53,16 @@ compiled:
 # Builds the version file template.
 version:
        if [[ -f $(VERSION_FILE) ]]; then $(MAKE) $(VERSION_FILE); fi
-$(VERSION_FILE): STAMP=$(shell date +%s)
-$(VERSION_FILE): BUILD=$(shell gitcrement next)
 $(VERSION_FILE):
+       which gitcrement
        @echo "// This file is automatically generated." > $(VERSION_FILE)
        @echo >> $(VERSION_FILE)
        @echo "$$.namespace('$(VERSION_NAMESPACE)');" >> $(VERSION_FILE)
        @echo >> $(VERSION_FILE)
        echo "$(VERSION_NAMESPACE).MAJOR = $(VERSION_MAJOR);" >> $(VERSION_FILE)
        echo "$(VERSION_NAMESPACE).MINOR = $(VERSION_MINOR);" >> $(VERSION_FILE)
-       echo "$(VERSION_NAMESPACE).BUILD = $(BUILD);" >> $(VERSION_FILE)
-       echo "$(VERSION_NAMESPACE).STAMP = $(STAMP);" >> $(VERSION_FILE)
+       echo "$(VERSION_NAMESPACE).BUILD = $(shell gitcrement next);" >> $(VERSION_FILE)
+       echo "$(VERSION_NAMESPACE).STAMP = $(shell date +%s);" >> $(VERSION_FILE)
 
 # Copies the version template to the source and commits it.
 stamp: $(VERSION_FILE)