More reliably handle make install from read-only directory
commonly, the make install is run in a compiled directory by a different user (i.e. an administrator) that doesn't necessarily have write access to the build directory. This patch fixes it so that the test that the version.h is up to date doesn't need to write a temporary file in the build directory. It also makes sure that if there is a real need to update the verion.h, and it is not writable, then properly fail the build.
This commit is contained in:
parent
6eb9825ab7
commit
844447b995
|
|
@ -189,9 +189,9 @@ iverilog-vpi.pdf: iverilog-vpi.ps
|
|||
version.h:
|
||||
@if test -d $(srcdir)/.git; then \
|
||||
echo "Using git-describe for VERSION_TAG"; \
|
||||
git --git-dir $(srcdir)/.git describe \
|
||||
| sed -e 's;\(.*\);#define VERSION_TAG "\1";' > $@tmp; \
|
||||
diff $@tmp $@ > /dev/null 2>&1 || mv $@tmp $@; \
|
||||
tmp=`git --git-dir $(srcdir)/.git describe \
|
||||
| sed -e 's;\(.*\);#define VERSION_TAG "\1";'`; \
|
||||
echo "$$tmp" | diff - $@ > /dev/null 2>&1 || echo "$$tmp" > $@ || exit 1; \
|
||||
elif test -r $(srcdir)/$@; then \
|
||||
echo "Using $(srcdir)/$@ for VERSION_TAG"; \
|
||||
diff $(srcdir)/$@ $@ > /dev/null 2>&1 || cp $(srcdir)/$@ $@; \
|
||||
|
|
|
|||
Loading…
Reference in New Issue