]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
open-vm-tools: cleanup rpcgen invocations.
authorVMware, Inc <>
Thu, 24 Feb 2011 23:01:43 +0000 (15:01 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 24 Feb 2011 23:01:43 +0000 (15:01 -0800)
Create a new script that hides most of the mess involved in executing
rpcgen from outside the source directory.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/configure.ac
open-vm-tools/lib/guestRpc/Makefile.am
open-vm-tools/libguestlib/Makefile.am
open-vm-tools/scripts/build/rpcgen_wrapper.sh.in [new file with mode: 0644]
open-vm-tools/services/plugins/dndcp/Makefile.am
open-vm-tools/services/plugins/unity/Makefile.am
open-vm-tools/tests/testDebug/Makefile.am
open-vm-tools/tests/testPlugin/Makefile.am

index ac9de9895c2654acdfd9e6e23c6bacabf437fac2..02a860e24c0200e11516ac8d83aae786a27649b9 100644 (file)
@@ -1128,6 +1128,7 @@ VMUSR_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmusr
 
 # General definitions
 INSTVMSG='$(SHELL) $(top_srcdir)/scripts/build/instvmsg.sh'
+RPCGEN_WRAPPER='$(SHELL) $(top_builddir)/scripts/build/rpcgen_wrapper.sh'
 
 ### General substs
 
@@ -1158,6 +1159,7 @@ if test "$os" = "freebsd" -a -n "$SYSDIR"; then
    AC_SUBST([SYSDIR])
 fi
 AC_SUBST([INSTVMSG])
+AC_SUBST([RPCGEN_WRAPPER])
 
 ### Lib substs
 
@@ -1254,7 +1256,8 @@ AC_CONFIG_FILES([                      \
    tests/testVmblock/Makefile          \
    docs/Makefile                       \
    docs/api/Makefile                   \
-   scripts/Makefile                   \
+   scripts/Makefile                           \
+   scripts/build/rpcgen_wrapper.sh     \
 ])
 
 ###
index b04f76d6a80a3d4aaefa33b2085152324f7261cc..b5e78c2c4f313d4028e773ec27a63f1404f52d6e 100644 (file)
@@ -38,15 +38,8 @@ EXTRA_DIST += nicinfo.x
 # to copy the sources to the build dir before compiling them.
 
 nicinfo.h: nicinfo.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then               \
-          cp -f $(top_srcdir)/lib/guestRpc/nicinfo.x $(builddir);  \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/nicinfo.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ lib/guestRpc/nicinfo.x $@
 
 nicinfo_xdr.c: nicinfo.x nicinfo.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/nicinfo.x
+       @RPCGEN_WRAPPER@ lib/guestRpc/nicinfo.x $@
 
index 4a0681e8e83eecd6c35ab2ed7de5ff493834021d..0ebe8c6ef4f671ad8c0d7c15e52a0c6161f1d603 100644 (file)
@@ -60,24 +60,15 @@ pkgconfig_DATA = vmguestlib.pc
 $(pkgconfig_DATA): $(top_builddir)/config.status
 
 guestlibIoctl.h: guestlibIoctl.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                     \
-          cp -f $(top_srcdir)/libguestlib/guestlibIoctl.x $(builddir);   \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/guestlibIoctl.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
+       @RPCGEN_WRAPPER@ libguestlib/guestlibIoctl.x $@
+
+guestlibIoctl_xdr.c: guestlibIoctl.x guestlibIoctl.h
+       @RPCGEN_WRAPPER@ libguestlib/guestlibIoctl.x $@
 
 guestlibV3.h: guestlibV3.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                     \
-          cp -f $(top_srcdir)/libguestlib/guestlibV3.x $(builddir);      \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/guestlibV3.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
+       @RPCGEN_WRAPPER@ libguestlib/guestlibV3.x $@
 
 guestlibV3_xdr.c: guestlibV3.x guestlibV3.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/guestlibV3.x
+       @RPCGEN_WRAPPER@ libguestlib/guestlibV3.x $@
 
-guestlibIoctl_xdr.c: guestlibIoctl.x guestlibIoctl.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/guestlibIoctl.x
 
diff --git a/open-vm-tools/scripts/build/rpcgen_wrapper.sh.in b/open-vm-tools/scripts/build/rpcgen_wrapper.sh.in
new file mode 100644 (file)
index 0000000..b33696c
--- /dev/null
@@ -0,0 +1,120 @@
+#!/bin/sh
+################################################################################
+### Copyright 2011 VMware, Inc.  All rights reserved.
+###
+### This program is free software; you can redistribute it and/or modify
+### it under the terms of version 2 of the GNU General Public License as
+### published by the Free Software Foundation.
+###
+### This program is distributed in the hope that it will be useful,
+### but WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+### GNU General Public License for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with this program; if not, write to the Free Software
+### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+################################################################################
+
+#
+# rpcgen_wrapper.sh - executes rpcgen.
+#
+# rpcgen is very finicky in the way it's invoked. It tends to pollute the
+# generated files with all sorts of weird stuff if you specify full paths to the
+# files being compiled. So this script copies the source file (plus any other
+# needed files) to the build directory before invoking rpcgen.
+#
+# The pattern to use in Makefile.am is:
+#
+# . have separate rules for generating the header and the source files, both
+#   invoking rpcgen_wrapper.sh
+# . make the source depend on the header
+#
+# The script assumes that $(builddir) is ".". The generated header is copied
+# to the "lib/include" directory under $(top_builddir).
+#
+# Arguments:
+#  input       ($1): path of .x file, relative to $(top_srcdir)
+#  output      ($2): name of output header file
+#  extra       ($@): other files to copy into the build directory; paths
+#                    relative to $(top_srcdir)
+#
+
+set -e
+
+rpcgen=@RPCGEN@
+rpcgenflags="@RPCGENFLAGS@"
+top_srcdir="@abs_top_srcdir@"
+top_builddir="@abs_top_builddir@"
+input=$1
+output=$2
+
+if [ -z "$output" ]; then
+   echo "Invalid arguments." >&2
+   exit 1
+fi
+
+shift 2
+
+# need_update($target, $source)
+need_update()
+{
+   test ! -f $1 -o $1 -ot $2
+}
+
+
+# do_rpcgen($type)
+# type is either "-h" or "-c"
+do_rpcgen()
+{
+   if need_update $output `basename $input`; then
+      rm -f $output
+   fi
+
+   $rpcgen $rpcgenflags $1 -o $output `basename $input`
+   sed 's,rpc/rpc\.h,vmxrpc.h,' $output > ${output}.tmp
+   mv ${output}.tmp $output
+}
+
+
+do_header()
+{
+   #
+   # Check both if srcdir != blddir, and also if we're copying a .x file from
+   # a different component.
+   #
+   top_builddir=`cd $top_builddir && pwd`
+   top_srcdir=`cd $top_srcdir && pwd`
+
+   if test $top_builddir != $top_srcdir -o \
+      `pwd` != `dirname $top_builddir/$input`; then
+      for f in $@; do
+         if need_update `basename $f` $top_srcdir/$f; then
+            cp -f $top_srcdir/$f .
+         fi
+      done
+      if need_update `basename $input` $top_srcdir/$input; then
+         cp -f $top_srcdir/$input .
+      fi
+   fi
+
+   do_rpcgen "-h"
+
+   # Export the generated header.
+   mkdir -p $top_builddir/lib/include/guestrpc
+   cp $output $top_builddir/lib/include/guestrpc
+}
+
+
+do_impl()
+{
+   do_rpcgen "-c"
+}
+
+
+case $output in
+   *.h) do_header ;;
+   *.c) do_impl ;;
+   *) echo "Unknown output file type: $output" ;;
+esac
+
index c5e17bf74b3fd2b220400bb412de51667751ab22..35c256afd16a632eaa1993afcfbba01ce9d23da9 100644 (file)
@@ -86,16 +86,9 @@ CLEANFILES += $(BUILT_SOURCES)
 libdndcp_la_SOURCES += cpFileContents_xdr.c
 
 cpFileContents.h: cpFileContents.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                               \
-          cp -f $(top_srcdir)/services/plugins/dndcp/cpFileContents.x $(builddir); \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/cpFileContents.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/dndcp/cpFileContents.x $@
 
 cpFileContents_xdr.c: cpFileContents.x cpFileContents.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/cpFileContents.x
+       @RPCGEN_WRAPPER@ services/plugins/dndcp/cpFileContents.x $@
 
 
index 375ec736109b629a532b9982c097d62fc8f0044f..01220d62a8981a4466adbc5b7ce7d8a8afdfd8d3 100644 (file)
@@ -121,154 +121,77 @@ clean-local:
        fi
 
 ghiGetBinaryHandlers.h: ghiGetBinaryHandlers.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiGetBinaryHandlers.x $(builddir);\
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiGetBinaryHandlers.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiGetBinaryHandlers.x $@ \
+          services/plugins/unity/ghiCommonDefines.h
 
 ghiGetBinaryHandlers_xdr.c: ghiGetBinaryHandlers.x ghiGetBinaryHandlers.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiGetBinaryHandlers.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiGetBinaryHandlers.x $@
 
 ghiGetExecInfoHash.h: ghiGetExecInfoHash.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiGetExecInfoHash.x $(builddir);  \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiGetExecInfoHash.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiGetExecInfoHash.x $@ \
+          services/plugins/unity/ghiCommonDefines.h
 
 ghiGetExecInfoHash_xdr.c: ghiGetExecInfoHash.x ghiGetExecInfoHash.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiGetExecInfoHash.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiGetExecInfoHash.x $@
 
 ghiProtocolHandler.h: ghiProtocolHandler.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiProtocolHandler.x $(builddir);  \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiProtocolHandler.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiProtocolHandler.x $@ \
+          services/plugins/unity/ghiCommonDefines.h
 
 ghiProtocolHandler_xdr.c: ghiProtocolHandler.x ghiProtocolHandler.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiProtocolHandler.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiProtocolHandler.x $@
 
 ghiStartMenu.h: ghiStartMenu.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiStartMenu.x $(builddir);        \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiStartMenu.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiStartMenu.x $@ \
+          services/plugins/unity/ghiCommonDefines.h
 
 ghiStartMenu_xdr.c: ghiStartMenu.x ghiStartMenu.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiStartMenu.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiStartMenu.x $@
 
 ghiShellAction.h: ghiShellAction.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiShellAction.x $(builddir);      \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiShellAction.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiShellAction.x $@ \
+          services/plugins/unity/ghiCommonDefines.h
 
 ghiShellAction_xdr.c: ghiShellAction.x ghiShellAction.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiShellAction.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiShellAction.x $@
 
 ghiTrayIcon.h: ghiTrayIcon.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiTrayIcon.x $(builddir);         \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiTrayIcon.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiTrayIcon.x $@ \
+          services/plugins/unity/ghiCommonDefines.h
 
 ghiTrayIcon_xdr.c: ghiTrayIcon.x ghiTrayIcon.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiTrayIcon.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiTrayIcon.x $@
 
 ghiSetFocusedWindow.h: ghiSetFocusedWindow.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiSetFocusedWindow.x $(builddir);         \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiSetFocusedWindow.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiSetFocusedWindow.x $@ \
+          services/plugins/unity/ghiCommonDefines.h
 
 ghiSetFocusedWindow_xdr.c: ghiSetFocusedWindow.x ghiSetFocusedWindow.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiSetFocusedWindow.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiSetFocusedWindow.x $@
 
 ghiSetGuestHandler.h: ghiSetGuestHandler.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiSetGuestHandler.x $(builddir);         \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiSetGuestHandler.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiSetGuestHandler.x $@ \
+          services/plugins/unity/ghiCommonDefines.h
 
 ghiSetGuestHandler_xdr.c: ghiSetGuestHandler.x ghiSetGuestHandler.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiSetGuestHandler.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiSetGuestHandler.x $@
 
 ghiSetOutlookTempFolder.h: ghiSetOutlookTempFolder.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiSetOutlookTempFolder.x $(builddir);         \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiSetOutlookTempFolder.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiSetOutlookTempFolder.x $@ \
+          services/plugins/unity/ghiCommonDefines.h
 
 ghiSetOutlookTempFolder_xdr.c: ghiSetOutlookTempFolder.x ghiSetOutlookTempFolder.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiSetOutlookTempFolder.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/ghiSetOutlookTempFolder.x $@
 
 unityActive.h: unityActive.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/unityActive.x $(builddir);         \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/unityActive.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/unityActive.x $@
 
 unityActive_xdr.c: unityActive.x unityActive.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/unityActive.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/unityActive.x $@
 
 unity.h: unity.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/unity.x $(builddir);               \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/unity.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
+       @RPCGEN_WRAPPER@ services/plugins/unity/unity.x $@
 
 unity_xdr.c: unity.x unity.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/unity.x
+       @RPCGEN_WRAPPER@ services/plugins/unity/unity.x $@
 
index 84a71e5fe8d265a22bc8c643656e8635d275a291..8a8ba0c632f5071a6b58d7192d6cb56e880f1620 100644 (file)
@@ -48,11 +48,8 @@ CLEANFILES += testData_xdr.c
 CLEANFILES += testData.h
 
 testData.h: $(top_srcdir)/tests/testPlugin/testData.x
-       cp -f $(top_srcdir)/tests/testPlugin/testData.x $(builddir)
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/testData.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
+       @RPCGEN_WRAPPER@ tests/testPlugin/testData.x $@
 
 testData_xdr.c: testData.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/testData.x
+       @RPCGEN_WRAPPER@ tests/testPlugin/testData.x $@
 
index 44824c442e54ceb986c9f6c438a5bab295bb6b55..34b060c8b33a77dd12cefe4dcdaf6387f06ed68e 100644 (file)
@@ -51,13 +51,8 @@ EXTRA_DIST =
 EXTRA_DIST += testData.x
 
 testData.h: testData.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                   \
-          cp -f $(top_srcdir)/tests/testPlugin/testData.x $(builddir); \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/testData.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
+       @RPCGEN_WRAPPER@ tests/testPlugin/testData.x $@
 
 testData_xdr.c: testData.x testData.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/testData.x
+       @RPCGEN_WRAPPER@ tests/testPlugin/testData.x $@