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