]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/rquotad/Makefile.am
Add generated files to CLEANFILES in rquotad
[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 CLEANFILES = $(GENFILES)
44
45 #######################################################################
46 # The following allows the current practice of having
47 # daemons renamed during the install to include RPCPREFIX
48 # and the KPREFIX
49 # This could all be done much easier with program_transform_name
50 # ( program_transform_name = s/^/$(RPCPREFIX)$(KPREFIX)/ )
51 # but that also renames the man pages, which the current
52 # practice does not do.
53 install-exec-hook:
54         (cd $(DESTDIR)$(sbindir) && \
55           for p in $(sbin_PROGRAMS); do \
56             mv -f $$p$(EXEEXT) $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
57           done)
58 uninstall-hook:
59         (cd $(DESTDIR)$(sbindir) && \
60           for p in $(sbin_PROGRAMS); do \
61             rm -f $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
62           done)
63
64
65 # XXX This makes some assumptions about what automake does.
66 # XXX But there is no install-man-hook or install-man-local.
67 install-man: install-man8 install-man-links
68 uninstall-man: uninstall-man8 uninstall-man-links
69
70 install-man-links:
71         (cd $(DESTDIR)$(man8dir) && \
72           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
73             inst=`echo $$m | sed -e 's/man$$/8/'`; \
74             rm -f $(RPCPREFIX)$$inst ; \
75             $(LN_S) $$inst $(RPCPREFIX)$$inst ; \
76           done)
77
78 uninstall-man-links:
79         (cd $(DESTDIR)$(man8dir) && \
80           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
81             inst=`echo $$m | sed -e 's/man$$/8/'`; \
82             rm -f $(RPCPREFIX)$$inst ; \
83           done)
84