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