summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2017-04-04 12:55:27 +0200
committerKaleb KEITHLEY <kkeithle@redhat.com>2017-04-04 21:27:49 -0400
commit7a49a4a6e3e2224afea7a961fbee9a460b9d58a0 (patch)
tree70f6b146c1c6f4b511888cb39ef10ec16aa1cce4
parentb75fa35694af916e0923f10e4f9491c364a4ba79 (diff)
build: place generated XDR .h and .c files under $(top_builddir)
Change-Id: I0487337223a54a52e73088cb6dd812ce6d47178d BUG: 1429696 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: https://review.gluster.org/16994 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Zhou Zhengping <johnzzpcrystal@gmail.com> Tested-by: Zhou Zhengping <johnzzpcrystal@gmail.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
-rw-r--r--rpc/xdr/gen/Makefile.am11
1 files changed, 6 insertions, 5 deletions
diff --git a/rpc/xdr/gen/Makefile.am b/rpc/xdr/gen/Makefile.am
index d6f416f93b7..6cffca4c3ac 100644
--- a/rpc/xdr/gen/Makefile.am
+++ b/rpc/xdr/gen/Makefile.am
@@ -10,6 +10,7 @@ CLEANFILES = $(XDRSOURCES) $(XDRHEADERS)
BUILT_SOURCES = $(XDRHEADERS) $(XDRSOURCES)
xdrsrc=$(top_srcdir)/rpc/xdr/src
+xdrdst=$(top_builddir)/rpc/xdr/src
# make's dependency resolution may mean that it decides to run
# rpcgen again (unnecessarily), but as the .c file already exists,
@@ -17,19 +18,19 @@ 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): $(XDRGENFILES)
- if [ ! -e $@ -o $(@:.c=.x) -nt $@ ]; then \
- rpcgen -c -o $@ $(@:.c=.x) && cp $@ $(xdrsrc)/ ;\
+ if [ ! -e $(xdrdst)/$@ -o $(@:.c=.x) -nt $(xdrdst)/$@ ]; then \
+ rpcgen -c -o $(xdrdst)/$@ $(@:.c=.x) ;\
fi
# d*mn sed in netbsd6 doesn't do -i (inline)
# (why are we still running smoke on netbsd6 and not netbsd7?)
$(XDRHEADERS): $(XDRGENFILES)
- if [ ! -e $@ -o $(@:.h=.x) -nt $@ ]; then \
+ if [ ! -e $(xdrdst)/$@ -o $(@:.h=.x) -nt $(xdrdst)/$@ ]; then \
rpcgen -h -o $(@:.h=.tmp) $(@:.h=.x) && \
sed -e '/#ifndef/ s/-/_/g' -e '/#define/ s/-/_/g' \
-e '/#endif/ s/-/_/' -e 's/TMP_/H_/g' \
- $(@:.h=.tmp) > $@ && rm -f $(@:.h=.tmp) && \
- cp $@ $(xdrsrc)/ ; \
+ $(@:.h=.tmp) > $(xdrdst)/$@ && \
+ rm -f $(@:.h=.tmp) ; \
fi