diff options
Diffstat (limited to 'rpc/xdr/src/Makefile.am')
-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 |