3ed0ace96b6d28cd008f8cf5425f2fd972b5f3b7
[nfs-utils.git] / utils / mount / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 man8_MANS       = mount.nfs.man umount.nfs.man
4
5 RPCGEN  = $(top_builddir)/tools/rpcgen/rpcgen
6
7 GENFILES_CLNT   = nfsmount_clnt.c
8 GENFILES_XDR    = nfsmount_xdr.c
9 GENFILES_H      = nfsmount.h
10
11 GENFILES        = $(GENFILES_CLNT) $(GENFILES_XDR) $(GENFILES_H)
12
13 sbin_PROGRAMS   = mount.nfs
14 EXTRA_DIST = nfsmount.x $(man8_MANS)
15 mount_nfs_SOURCES = mount.c nfsmount.c nfs4mount.c nfsumount.c \
16                   nfsmount_xdr.c mount_constants.h nfs4_mount.h nfsmount.h \
17                   nfs_mount4.h
18
19 BUILT_SOURCES = $(GENFILES)
20 mount_nfs_LDADD = ../../support/nfs/libnfs.a
21
22
23 $(RPCGEN):
24         make -C ../../tools/rpcgen all
25
26 $(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN)
27         test -f $@ && rm -rf $@ || true
28         $(RPCGEN) -l -o $@ $<
29
30 $(GENFILES_SVC): %_svc.c: %.x $(RPCGEN)
31         test -f $@ && rm -rf $@ || true
32         $(RPCGEN) -m -o $@ $<
33
34 $(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
35         test -f $@ && rm -rf $@ || true
36         $(RPCGEN) -c -o $@ $<
37
38 $(GENFILES_H): %.h: %.x $(RPCGEN)
39         test -f $@ && rm -rf $@ || true
40         $(RPCGEN) -h -o $@ $<
41
42
43 MAINTAINERCLEANFILES = Makefile.in
44
45 CLEANFILES = $(GENFILES)
46
47 install-exec-hook:
48         (cd $(DESTDIR)$(sbindir) && \
49           ln -sf $(sbin_PROGRAMS) mount.nfs4 && \
50           ln -sf $(sbin_PROGRAMS) umount.nfs && \
51           ln -sf $(sbin_PROGRAMS) umount.nfs4)
52 uninstall-hook:
53         (cd $(DESTDIR)$(sbindir) && \
54             rm -f mount.nfs4 umount.nfs umount.nfs4)
55
56
57 install-man-links:
58         (cd $(DESTDIR)$(man8dir) && \
59           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
60             inst=`echo $$m | sed -e 's/man$$/8/'`; \
61             rm -f $$inst ; \
62           done)
63
64 uninstall-man-links:
65         (cd $(DESTDIR)$(man8dir) && \
66           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
67             inst=`echo $$m | sed -e 's/man$$/8/'`; \
68             rm -f $$inst ; \
69           done)
70