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