]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/nfsd/Makefile.am
nfs-utils: move nfssvc.c to nfsd dir and clean up linking of nfsd
[nfs-utils.git] / utils / nfsd / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 man8_MANS       = nfsd.man
4 EXTRA_DIST      = $(man8_MANS)
5
6 RPCPREFIX       = rpc.
7 KPREFIX         = @kprefix@
8 sbin_PROGRAMS   = nfsd
9
10 nfsd_SOURCES = nfsd.c nfssvc.c
11 nfsd_LDADD = ../../support/nfs/libnfs.a
12
13 MAINTAINERCLEANFILES = Makefile.in
14
15 #######################################################################
16 # The following allows the current practice of having
17 # daemons renamed during the install to include RPCPREFIX
18 # and the KPREFIX
19 # This could all be done much easier with program_transform_name
20 # ( program_transform_name = s/^/$(RPCPREFIX)$(KPREFIX)/ )
21 # but that also renames the man pages, which the current
22 # practice does not do.
23 install-exec-hook:
24         (cd $(DESTDIR)$(sbindir) && \
25           for p in $(sbin_PROGRAMS); do \
26             mv -f $$p$(EXEEXT) $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
27           done)
28 uninstall-hook:
29         (cd $(DESTDIR)$(sbindir) && \
30           for p in $(sbin_PROGRAMS); do \
31             rm -f $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
32           done)
33
34
35 # XXX This makes some assumptions about what automake does.
36 # XXX But there is no install-man-hook or install-man-local.
37 install-man: install-man8 install-man-links
38 uninstall-man: uninstall-man8 uninstall-man-links
39
40 install-man-links:
41         (cd $(DESTDIR)$(man8dir) && \
42           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
43             inst=`echo $$m | sed -e 's/man$$/8/'`; \
44             rm -f $(RPCPREFIX)$$inst ; \
45             $(LN_S) $$inst $(RPCPREFIX)$$inst ; \
46           done)
47
48 uninstall-man-links:
49         (cd $(DESTDIR)$(man8dir) && \
50           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
51             inst=`echo $$m | sed -e 's/man$$/8/'`; \
52             rm -f $(RPCPREFIX)$$inst ; \
53           done)
54