]> git.ipfire.org Git - thirdparty/util-linux.git/blame - mount/Makefile
Imported from util-linux-2.10s 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
6dbe3af9 27# comment these out if you are not compiling in NFS support
fd6b7a7f 28NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o
6dbe3af9 29# uncomment this if you don't have libc-4.2 but do have the rpclib
22853e4a 30GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
6dbe3af9
KZ
31
32# comment these out if you are not compiling in loop support
33LO_OBJS=lomount.o
34
35all: $(PROGS)
36
37install: $(PROGS)
38 $(INSTALLDIR) $(BINDIR) $(SBINDIR)
22853e4a
KZ
39 $(INSTALLSUID) $(SUID_PROGS) $(BINDIR)
40 $(INSTALLBIN) $(NOSUID_PROGS) $(SBINDIR)
6dbe3af9
KZ
41 (cd $(SBINDIR); ln -sf swapon swapoff)
42 $(INSTALLDIR) $(MAN5DIR) $(MAN8DIR)
43 $(INSTALLMAN) $(MAN5) $(MAN5DIR)
44 $(INSTALLMAN) $(MAN8) $(MAN8DIR)
45
726f69e2 46%.o: %.c
6dbe3af9
KZ
47 $(COMPILE) $<
48
5c36a0eb
KZ
49mount: mount.o fstab.o sundries.o realpath.o mntent.o version.o \
50 mount_guess_fstype.o mount_by_label.o getusername.o \
51 $(LIB)/setproctitle.o $(NFS_OBJS) $(LO_OBJS)
52 $(LINK) $^ -o $@
6dbe3af9 53
5c36a0eb
KZ
54umount: umount.o fstab.o sundries.o realpath.o mntent.o getusername.o \
55 version.o $(LO_OBJS)
56 $(LINK) $^ -o $@
6dbe3af9 57
fd6b7a7f 58swapon: swapon.o version.o
5c36a0eb 59 $(LINK) $^ -o $@
6dbe3af9 60
22853e4a 61losetup.o: lomount.c
66ee8158 62 $(COMPILE) -DMAIN lomount.c -o $@
22853e4a 63
fd6b7a7f 64losetup: losetup.o
5c36a0eb 65 $(LINK) $^ -o $@
2b6fc908 66
eb63b9b8 67mount.o umount.o nfsmount.o losetup.o fstab.o realpath.o sundries.o: sundries.h
fd6b7a7f
KZ
68
69mount.o umount.o fstab.o sundries.o: fstab.h
70
5c36a0eb
KZ
71mount.o fstab.o mntent.o: mntent.h
72
73mount.o mount_guess_fstype.o: mount_guess_fstype.h
74
75mount.o: $(LIB)/setproctitle.h
76
77mount.o umount.o getusername.o: getusername.h
78
2b6fc908 79mount.o umount.o losetup.o lomount.o: lomount.h loop.h
fd6b7a7f 80
5c36a0eb 81swapon.o: swap_constants.h swapargs.h
6dbe3af9 82
fd6b7a7f 83sundries.o nfsmount.o nfsmount_xdr.o nfsmount_clnt.o: nfsmount.h
6dbe3af9 84
2b6fc908
KZ
85umount.o: mount_constants.h
86
5c36a0eb
KZ
87mount.o mount_by_label.o mount_guess_fstype.o: linux_fs.h
88
eb63b9b8
KZ
89sundries.o realpath.o: realpath.h
90
fd6b7a7f
KZ
91nfsmount_clnt.o: nfsmount_clnt.c
92 $(COMPILE) $(RPC_CFLAGS) nfsmount_clnt.c
6dbe3af9 93
fd6b7a7f
KZ
94nfsmount_xdr.o: nfsmount_xdr.c
95 $(COMPILE) $(RPC_CFLAGS) nfsmount_xdr.c
6dbe3af9 96
22853e4a
KZ
97ifeq "$(HAVE_GOOD_RPC)" "yes"
98nfsmount.h nfsmount_xdr.c nfsmount_clnt.c: nfsmount.x
99 rm -f nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
100 $(RPCGEN) -h -o nfsmount.h nfsmount.x
101 $(RPCGEN) -c -o nfsmount_xdr.c nfsmount.x
102 $(RPCGEN) -l -o nfsmount_clnt.c nfsmount.x
103else
104nfsmount.h nfsmount_xdr.c nfsmount_clnt.c:
105 cp $(RPCSVCDIR)/nfsmount.h .
106 cp $(RPCSVCDIR)/nfsmount_xdr.c .
107 cp $(RPCSVCDIR)/nfsmount_clnt.c .
108endif
109
110nfsmount.o: nfs_mount4.h
fd6b7a7f 111
fd6b7a7f
KZ
112swapargs.h:
113 sh swap.configure
114
115loop.h:
2b6fc908 116 sh mk_loop_h
6dbe3af9
KZ
117
118clean:
66ee8158 119 rm -f a.out core *~ *.o swapargs.h $(PROGS) $(MAYBE)
5c36a0eb 120 rm -f loop.h nfs_mountversion.h
6dbe3af9 121
2b6fc908 122clobber distclean realclean: clean
22853e4a 123 rm -f $(GEN_FILES)