]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/rquotad/Makefile.am
Generate rquota_xdr.c and rquota.h from rquota.x
[nfs-utils.git] / utils / rquotad / Makefile.am
index 8e3e634ab8ecb62c07a6d4a152847f295b57b2a5..08837939618cea13baa8b065155b5417dc95cf44 100644 (file)
@@ -1,5 +1,11 @@
 ## Process this file with automake to produce Makefile.in
 
+RPCGEN         = $(top_builddir)/tools/rpcgen/rpcgen
+
+GENFILES_XDR   = rquota_xdr.c
+GENFILES_H     = rquota.h
+
+GENFILES       = $(GENFILES_XDR) $(GENFILES_H)
 man8_MANS      = rquotad.man
 
 RPCPREFIX      = rpc.
@@ -19,6 +25,19 @@ rquotad_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) \
 
 MAINTAINERCLEANFILES = Makefile.in
 
+
+$(RPCGEN):
+       make -C $(top_srcdir)/tools/rpcgen all
+
+$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
+       test -f $@ && rm -rf $@ || true
+       $(RPCGEN) -c -o $@ $<
+
+
+$(GENFILES_H): %.h: %.x $(RPCGEN)
+       test -f $@ && rm -rf $@ || true
+       $(RPCGEN) -h -o $@ $<
+
 #######################################################################
 # The following allows the current practice of having
 # daemons renamed during the install to include RPCPREFIX