summaryrefslogtreecommitdiff
path: root/python/automake.mk
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-03-12 10:34:22 -0700
committerBen Pfaff <blp@nicira.com>2012-03-12 12:30:44 -0700
commitc95ca86e67b8c55230e4c890906a261221651bcc (patch)
tree90888df4bd2d90cdaed3f20a7304c385e5f058bd /python/automake.mk
parent746cb7604e734c6e220c7a68218d8df50e692a56 (diff)
downloadopenvswitch-c95ca86e67b8c55230e4c890906a261221651bcc.tar.gz
python: Fix "make distcheck" error on version.py.
The generated version.py has to go in the srcdir and has to be regenerated based on config.status, which breaks "make distcheck" because it write-protects the srcdir. However, the contents of version.py only change when the version number changes, so we can just "touch" it when it doesn't really need to change. The same pattern is used elsewhere in the tree for other files in the same situation, e.g. the various RPM spec files. Reported-by: Chris Wright <chrisw@sous-sol.org> Acked-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'python/automake.mk')
-rw-r--r--python/automake.mk12
1 files changed, 6 insertions, 6 deletions
diff --git a/python/automake.mk b/python/automake.mk
index 967204210..447c08fc6 100644
--- a/python/automake.mk
+++ b/python/automake.mk
@@ -62,10 +62,10 @@ ovs-uninstall-local:
ALL_LOCAL += $(srcdir)/python/ovs/version.py
$(srcdir)/python/ovs/version.py: config.status
- $(ro_shell) > $@.tmp
- echo 'VERSION = "$(VERSION)"' >> $@.tmp
+ $(ro_shell) > $(@F).tmp
+ echo 'VERSION = "$(VERSION)"' >> $(@F).tmp
if [ "$(BUILDNR)" != "0" ]; \
- then echo 'BUILDNR = "+build$(BUILDNR)"' >> $@.tmp; \
- else echo 'BUILDNR = ""' >> $@.tmp; \
- fi;
- mv $@.tmp $@
+ then echo 'BUILDNR = "+build$(BUILDNR)"' >> $(@F).tmp; \
+ else echo 'BUILDNR = ""' >> $(@F).tmp; \
+ fi
+ if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi