]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/rquotad/Makefile.am
Add --with-rpcgen= for configure so that the system rpcgen can be used.
[nfs-utils.git] / utils / rquotad / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3
4 GENFILES_XDR    = rquota_xdr.c
5 GENFILES_H      = rquota.h
6
7 BUILT_SOURCES   = $(GENFILES_H)
8
9 GENFILES        = $(GENFILES_XDR) $(GENFILES_H)
10 man8_MANS       = rquotad.man
11
12 RPCPREFIX       = rpc.
13 KPREFIX         = @kprefix@
14 sbin_PROGRAMS   = rquotad
15
16 EXTRA_DIST = rquota.x $(man8_MANS) NEW README.okir
17
18 rquotad_SOURCES = rquota_server.c rquota_svc.c rquota_xdr.c quotactl.c \
19                   hasquota.c mntent.h rquota.h
20 rquotad_LDADD = ../../support/export/libexport.a \
21                 ../../support/nfs/libnfs.a \
22                 ../../support/misc/libmisc.a \
23                 $(LIBBSD) $(LIBWRAP) $(LIBNSL)
24 rquotad_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) \
25                    -I$(top_srcdir)/support/export
26
27 MAINTAINERCLEANFILES = Makefile.in
28
29 if CONFIG_RPCGEN
30 RPCGEN          = $(top_builddir)/tools/rpcgen/rpcgen
31 $(RPCGEN):
32         make -C $(top_srcdir)/tools/rpcgen all
33 else
34 RPCGEN = @RPCGEN_PATH@
35 endif
36
37 $(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
38         test -f $@ && rm -rf $@ || true
39         $(RPCGEN) -c -o $@ $<
40
41
42 $(GENFILES_H): %.h: %.x $(RPCGEN)
43         test -f $@ && rm -rf $@ || true
44         $(RPCGEN) -h -o $@ $<
45
46 CLEANFILES = $(GENFILES)
47
48 #######################################################################
49 # The following allows the current practice of having
50 # daemons renamed during the install to include RPCPREFIX
51 # and the KPREFIX
52 # This could all be done much easier with program_transform_name
53 # ( program_transform_name = s/^/$(RPCPREFIX)$(KPREFIX)/ )
54 # but that also renames the man pages, which the current
55 # practice does not do.
56 install-exec-hook:
57         (cd $(DESTDIR)$(sbindir) && \
58           for p in $(sbin_PROGRAMS); do \
59             mv -f $$p$(EXEEXT) $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
60           done)
61 uninstall-hook:
62         (cd $(DESTDIR)$(sbindir) && \
63           for p in $(sbin_PROGRAMS); do \
64             rm -f $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
65           done)
66
67
68 # XXX This makes some assumptions about what automake does.
69 # XXX But there is no install-man-hook or install-man-local.
70 install-man: install-man8 install-man-links
71 uninstall-man: uninstall-man8 uninstall-man-links
72
73 install-man-links:
74         (cd $(DESTDIR)$(man8dir) && \
75           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
76             inst=`echo $$m | sed -e 's/man$$/8/'`; \
77             rm -f $(RPCPREFIX)$$inst ; \
78             $(LN_S) $$inst $(RPCPREFIX)$$inst ; \
79           done)
80
81 uninstall-man-links:
82         (cd $(DESTDIR)$(man8dir) && \
83           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
84             inst=`echo $$m | sed -e 's/man$$/8/'`; \
85             rm -f $(RPCPREFIX)$$inst ; \
86           done)
87