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