]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/rquotad/Makefile.am
Add --with-rpcgen= for configure so that the system rpcgen can be used.
[nfs-utils.git] / utils / rquotad / Makefile.am
index b478fadfb659faa2157b4eb3291de34c14974e52..4bc036fca080d398e34ebb3863c353f58357c84f 100644 (file)
@@ -1,5 +1,12 @@
 ## Process this file with automake to produce Makefile.in
 
+
+GENFILES_XDR   = rquota_xdr.c
+GENFILES_H     = rquota.h
+
+BUILT_SOURCES  = $(GENFILES_H)
+
+GENFILES       = $(GENFILES_XDR) $(GENFILES_H)
 man8_MANS      = rquotad.man
 
 RPCPREFIX      = rpc.
@@ -9,7 +16,7 @@ sbin_PROGRAMS  = rquotad
 EXTRA_DIST = rquota.x $(man8_MANS) NEW README.okir
 
 rquotad_SOURCES = rquota_server.c rquota_svc.c rquota_xdr.c quotactl.c \
-                 hasquota.c mntent.h pathnames.h rquota.h
+                 hasquota.c mntent.h rquota.h
 rquotad_LDADD = ../../support/export/libexport.a \
                ../../support/nfs/libnfs.a \
                ../../support/misc/libmisc.a \
@@ -19,6 +26,25 @@ rquotad_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) \
 
 MAINTAINERCLEANFILES = Makefile.in
 
+if CONFIG_RPCGEN
+RPCGEN         = $(top_builddir)/tools/rpcgen/rpcgen
+$(RPCGEN):
+       make -C $(top_srcdir)/tools/rpcgen all
+else
+RPCGEN = @RPCGEN_PATH@
+endif
+
+$(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 $@ $<
+
+CLEANFILES = $(GENFILES)
+
 #######################################################################
 # The following allows the current practice of having
 # daemons renamed during the install to include RPCPREFIX