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