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