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