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