]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/statd/Makefile.am
17447914aa69c3066e7dda1b1ae5fb376072bf37
[nfs-utils.git] / utils / statd / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 man8_MANS = statd.man sm-notify.man
4
5 RPCPREFIX       = rpc.
6 KPREFIX         = @kprefix@
7 sbin_PROGRAMS   = statd sm-notify
8 dist_sbin_SCRIPTS       = start-statd
9 statd_SOURCES = callback.c notlist.c misc.c monitor.c hostname.c \
10                 simu.c stat.c statd.c svc_run.c rmtcall.c \
11                 notlist.h statd.h system.h version.h
12 sm_notify_SOURCES = sm-notify.c
13
14 BUILT_SOURCES = $(GENFILES)
15 statd_LDADD = ../../support/nsm/libnsm.a \
16               ../../support/nfs/libnfs.a \
17               ../../support/misc/libmisc.a \
18               $(LIBWRAP) $(LIBNSL) $(LIBCAP)
19 sm_notify_LDADD = ../../support/nsm/libnsm.a \
20                   ../../support/nfs/libnfs.a \
21                   $(LIBNSL) $(LIBCAP)
22
23 EXTRA_DIST = sim_sm_inter.x $(man8_MANS) COPYRIGHT simulate.c
24
25 if CONFIG_RPCGEN
26 RPCGEN  = $(top_builddir)/tools/rpcgen/rpcgen
27 $(RPCGEN):
28         make -C ../../tools/rpcgen all
29 else
30 RPCGEN = @RPCGEN_PATH@
31 endif
32
33 $(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN)
34         test -f $@ && rm -rf $@ || true
35         $(RPCGEN) -l -o $@ $<
36
37 $(GENFILES_SVC): %_svc.c: %.x $(RPCGEN)
38         test -f $@ && rm -rf $@ || true
39         $(RPCGEN) -m -o $@ $<
40
41 $(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
42         test -f $@ && rm -rf $@ || true
43         $(RPCGEN) -c -o $@ $<
44
45 $(GENFILES_H): %.h: %.x $(RPCGEN)
46         test -f $@ && rm -rf $@ || true
47         $(RPCGEN) -h -o $@ $<
48
49 MAINTAINERCLEANFILES = Makefile.in
50
51 CLEANFILES = $(GENFILES)
52
53 #######################################################################
54 # The following allows the current practice of having
55 # daemons renamed during the install to include RPCPREFIX
56 # and the KPREFIX
57 # This could all be done much easier with program_transform_name
58 # ( program_transform_name = s/^/$(RPCPREFIX)$(KPREFIX)/ )
59 # but that also renames the man pages, which the current
60 # practice does not do.
61 install-exec-hook:
62         (cd $(DESTDIR)$(sbindir) && \
63           for p in $(sbin_PROGRAMS); do \
64             [ $$p = sm-notify ] || mv -f $$p$(EXEEXT) $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
65           done)
66 uninstall-hook:
67         (cd $(DESTDIR)$(sbindir) && \
68           for p in $(sbin_PROGRAMS); do \
69             [ $$p = sm-notify ] || rm -f $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
70           done)
71
72
73 # XXX This makes some assumptions about what automake does.
74 # XXX But there is no install-man-hook or install-man-local.
75 install-man: install-man8 install-man-links
76 uninstall-man: uninstall-man8 uninstall-man-links
77
78 install-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             $(LN_S) $$inst $(RPCPREFIX)$$inst ; \
84           done)
85
86 uninstall-man-links:
87         (cd $(DESTDIR)$(man8dir) && \
88           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
89             inst=`echo $$m | sed -e 's/man$$/8/'`; \
90             rm -f $(RPCPREFIX)$$inst ; \
91           done)
92