Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't duplicate Makefile shell code

Smaller, and conceptually easier to keep in sync,
way of handling build machines with and without git.
  • Loading branch information...
commit d74f2fe38d1111c01a908345afae1af271cbef18 1 parent db642e3
@ldoolitt ldoolitt authored committed
Showing with 6 additions and 10 deletions.
  1. +6 −10 Makefile.in
View
16 Makefile.in
@@ -186,17 +186,14 @@ iverilog-vpi.pdf: iverilog-vpi.ps
# version.h file in the source tree (included in snapshots and releases), and
# finally use nothing.
.PHONY: version.h
-version.h:
+# "true" and "false" in the next few lines are Unix shell command names
ifeq ($(GIT),none)
- @if test -r $(srcdir)/$@; then \
- echo "Using $(srcdir)/$@ for VERSION_TAG"; \
- diff $(srcdir)/$@ $@ > /dev/null 2>&1 || cp $(srcdir)/$@ $@; \
- else \
- echo "Using empty VERSION_TAG"; \
- echo '#define VERSION_TAG ""' > $@; \
- fi
+GIT_PRESENT = false
else
- @if test -d $(srcdir)/.git; then \
+GIT_PRESENT = true
+endif
+version.h:
+ @if $(GIT_PRESENT) && test -d $(srcdir)/.git; then \
echo "Using git-describe for VERSION_TAG"; \
tmp=`$(GIT) --git-dir $(srcdir)/.git describe \
| sed -e 's;\(.*\);#define VERSION_TAG "\1";'`; \
@@ -208,7 +205,6 @@ else
echo "Using empty VERSION_TAG"; \
echo '#define VERSION_TAG ""' > $@; \
fi
-endif
ifeq (@MINGW32@,yes)
ifeq ($(MAN),none)
Please sign in to comment.
Something went wrong with that request. Please try again.