diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2016-09-19 09:13:09 -0400 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2016-09-20 04:45:45 -0700 |
commit | c5426a13ad28fb2c6f0ed62404dbe60ea0dfaad2 (patch) | |
tree | 664666f9d15bd1013b690f230627527f4a8ccb9f /rpc | |
parent | 12ae3c448c8435decdff27643d5785698ac19dff (diff) |
build: rpc/xdr .c and .h files are regenerated unnecessarily
.c and .h files are blindly (re)generated. If you run `make`
followed by a second `make` or `make install` the subsequent
`make` will unnecessarily recompile everything because of the
redundant regeneration of the .c and .h files are now newer
than the prior builds .o files
Change-Id: I7e477bcdcc20869e144ada7e6d91e7221b8ee71f
BUG: 1377341
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/15530
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Anoop C S <anoopcs@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/xdr/src/Makefile.am | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/rpc/xdr/src/Makefile.am b/rpc/xdr/src/Makefile.am index 73640614c55..10487e27664 100644 --- a/rpc/xdr/src/Makefile.am +++ b/rpc/xdr/src/Makefile.am @@ -39,14 +39,18 @@ xdrsrc=$(top_srcdir)/rpc/xdr/src # could use a '-' (i.e. -@rpcgen ...) and suffer with noisy warnings # in the build. Or we do this crufty thing instead. $(XDRSOURCES): $(XDRHEADERS) - @rpcgen -c -o $(@:.c=.tmp) $(@:.c=.x) && mv $(@:.c=.tmp) $@ + @if [ ! -e $@ -o $(@:.c=.x) -nt $@ ]; then \ + rpcgen -c -o $(@:.c=.tmp) $(@:.c=.x) && mv $(@:.c=.tmp) $@ ; \ + fi # d*mn sed in netbsd6 doesn't do -i (inline) # (why are we still running smoke on netbsd6 and not netbsd7?) $(XDRHEADERS): $(XDRGENFILES) - @rpcgen -h -o $(@:.h=.tmp) $(@:.h=.x) - @sed -e '/#ifndef/ s/-/_/g' -e '/#define/ s/-/_/g' -e '/#endif/ s/-/_/' \ - $(@:.h=.tmp) > $@ && rm -f $(@:.h=.tmp) + @if [ ! -e $@ -o $(@:.h=.x) -nt $@ ]; then \ + rpcgen -h -o $(@:.h=.tmp) $(@:.h=.x) ; \ + sed -e '/#ifndef/ s/-/_/g' -e '/#define/ s/-/_/g' -e '/#endif/ s/-/_/' \ + $(@:.h=.tmp) > $@ && rm -f $(@:.h=.tmp) ; \ + fi # link .x files when doing out-of-tree builds # have to use .PHONY here to force it; all versions of make |