]> git.ipfire.org Git - thirdparty/util-linux.git/blame - mount/Makefile
Imported from util-linux-2.11t tarball.
[thirdparty/util-linux.git] / mount / Makefile
CommitLineData
7eda085c 1include ../make_include
6dbe3af9 2include ../MCONFIG
fd6b7a7f 3
fd6b7a7f 4DEFINES = -DHAVE_NFS
fd6b7a7f 5
6dbe3af9
KZ
6RPCSVCDIR = rpcsvc
7RPC_CFLAGS = -Wno-unused
8RPCGEN = rpcgen
6dbe3af9 9
66ee8158 10COMPILE = $(CC) -c $(CFLAGS) $(DEFINES)
6dbe3af9
KZ
11LINK = $(CC) $(LDFLAGS)
12
13SUID_PROGS = mount umount
fd6b7a7f 14NOSUID_PROGS = swapon losetup
6dbe3af9 15MAN5 = fstab.5 nfs.5
fd6b7a7f 16MAN8 = mount.8 swapoff.8 swapon.8 umount.8 losetup.8
6dbe3af9 17
22853e4a
KZ
18ifeq "$(HAVE_PIVOT_ROOT)" "yes"
19NOSUID_PROGS := $(NOSUID_PROGS) pivot_root
20MAN8 := $(MAN8) pivot_root.8
21endif
22
23PROGS = $(SUID_PROGS) $(NOSUID_PROGS)
24
66ee8158
KZ
25MAYBE = pivot_root swapoff
26
c07ebfa1 27LO_OBJS = lomount.o $(LIB)/xstrncpy.o
fd6b7a7f 28NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o
22853e4a 29GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
6dbe3af9 30
6dbe3af9
KZ
31all: $(PROGS)
32
33install: $(PROGS)
34 $(INSTALLDIR) $(BINDIR) $(SBINDIR)
22853e4a
KZ
35 $(INSTALLSUID) $(SUID_PROGS) $(BINDIR)
36 $(INSTALLBIN) $(NOSUID_PROGS) $(SBINDIR)
6dbe3af9
KZ
37 (cd $(SBINDIR); ln -sf swapon swapoff)
38 $(INSTALLDIR) $(MAN5DIR) $(MAN8DIR)
39 $(INSTALLMAN) $(MAN5) $(MAN5DIR)
40 $(INSTALLMAN) $(MAN8) $(MAN8DIR)
41
726f69e2 42%.o: %.c
6dbe3af9
KZ
43 $(COMPILE) $<
44
5c36a0eb
KZ
45mount: mount.o fstab.o sundries.o realpath.o mntent.o version.o \
46 mount_guess_fstype.o mount_by_label.o getusername.o \
364cda48 47 $(LIB)/setproctitle.o $(LIB)/env.o $(NFS_OBJS) $(LO_OBJS)
5c36a0eb 48 $(LINK) $^ -o $@
6dbe3af9 49
5c36a0eb 50umount: umount.o fstab.o sundries.o realpath.o mntent.o getusername.o \
364cda48 51 version.o $(LIB)/env.o $(LO_OBJS)
5c36a0eb 52 $(LINK) $^ -o $@
6dbe3af9 53
fd6b7a7f 54swapon: swapon.o version.o
5c36a0eb 55 $(LINK) $^ -o $@
6dbe3af9 56
c07ebfa1 57main_losetup.o: lomount.c
66ee8158 58 $(COMPILE) -DMAIN lomount.c -o $@
22853e4a 59
c07ebfa1 60losetup: main_losetup.o $(LIB)/xstrncpy.o
5c36a0eb 61 $(LINK) $^ -o $@
2b6fc908 62
eb63b9b8 63mount.o umount.o nfsmount.o losetup.o fstab.o realpath.o sundries.o: sundries.h
fd6b7a7f
KZ
64
65mount.o umount.o fstab.o sundries.o: fstab.h
66
5c36a0eb
KZ
67mount.o fstab.o mntent.o: mntent.h
68
69mount.o mount_guess_fstype.o: mount_guess_fstype.h
70
71mount.o: $(LIB)/setproctitle.h
72
73mount.o umount.o getusername.o: getusername.h
74
2b6fc908 75mount.o umount.o losetup.o lomount.o: lomount.h loop.h
fd6b7a7f 76
5c36a0eb 77swapon.o: swap_constants.h swapargs.h
6dbe3af9 78
fd6b7a7f 79sundries.o nfsmount.o nfsmount_xdr.o nfsmount_clnt.o: nfsmount.h
6dbe3af9 80
2b6fc908
KZ
81umount.o: mount_constants.h
82
5c36a0eb
KZ
83mount.o mount_by_label.o mount_guess_fstype.o: linux_fs.h
84
eb63b9b8
KZ
85sundries.o realpath.o: realpath.h
86
fd6b7a7f
KZ
87nfsmount_clnt.o: nfsmount_clnt.c
88 $(COMPILE) $(RPC_CFLAGS) nfsmount_clnt.c
6dbe3af9 89
fd6b7a7f
KZ
90nfsmount_xdr.o: nfsmount_xdr.c
91 $(COMPILE) $(RPC_CFLAGS) nfsmount_xdr.c
6dbe3af9 92
22853e4a 93ifeq "$(HAVE_GOOD_RPC)" "yes"
63cccae4
KZ
94nfsmount.h: nfsmount.x
95 rm -f nfsmount.h
22853e4a 96 $(RPCGEN) -h -o nfsmount.h nfsmount.x
63cccae4
KZ
97
98nfsmount_xdr.c: nfsmount.x
99 rm -f nfsmount_xdr.c
22853e4a 100 $(RPCGEN) -c -o nfsmount_xdr.c nfsmount.x
63cccae4
KZ
101
102nfsmount_clnt.c: nfsmount.x
103 rm -f nfsmount_clnt.c
22853e4a
KZ
104 $(RPCGEN) -l -o nfsmount_clnt.c nfsmount.x
105else
63cccae4 106nfsmount.h:
22853e4a 107 cp $(RPCSVCDIR)/nfsmount.h .
63cccae4
KZ
108
109nfsmount_xdr.c:
22853e4a 110 cp $(RPCSVCDIR)/nfsmount_xdr.c .
63cccae4
KZ
111
112nfsmount_clnt.c:
22853e4a
KZ
113 cp $(RPCSVCDIR)/nfsmount_clnt.c .
114endif
115
116nfsmount.o: nfs_mount4.h
fd6b7a7f 117
fd6b7a7f
KZ
118swapargs.h:
119 sh swap.configure
120
121loop.h:
2b6fc908 122 sh mk_loop_h
6dbe3af9
KZ
123
124clean:
66ee8158 125 rm -f a.out core *~ *.o swapargs.h $(PROGS) $(MAYBE)
5c36a0eb 126 rm -f loop.h nfs_mountversion.h
6dbe3af9 127
2b6fc908 128clobber distclean realclean: clean
22853e4a 129 rm -f $(GEN_FILES)