]>
Commit | Line | Data |
---|---|---|
7eda085c | 1 | include ../make_include |
6dbe3af9 | 2 | include ../MCONFIG |
fd6b7a7f | 3 | |
c129767e | 4 | DEFINES = -DHAVE_NFS $(BLKID_DEFINE) |
fd6b7a7f | 5 | |
6dbe3af9 KZ |
6 | RPCSVCDIR = rpcsvc |
7 | RPC_CFLAGS = -Wno-unused | |
8 | RPCGEN = rpcgen | |
6dbe3af9 | 9 | |
66ee8158 | 10 | COMPILE = $(CC) -c $(CFLAGS) $(DEFINES) |
6dbe3af9 KZ |
11 | LINK = $(CC) $(LDFLAGS) |
12 | ||
13 | SUID_PROGS = mount umount | |
fd6b7a7f | 14 | NOSUID_PROGS = swapon losetup |
6dbe3af9 | 15 | MAN5 = fstab.5 nfs.5 |
fd6b7a7f | 16 | MAN8 = mount.8 swapoff.8 swapon.8 umount.8 losetup.8 |
6dbe3af9 | 17 | |
22853e4a KZ |
18 | ifeq "$(HAVE_PIVOT_ROOT)" "yes" |
19 | NOSUID_PROGS := $(NOSUID_PROGS) pivot_root | |
20 | MAN8 := $(MAN8) pivot_root.8 | |
21 | endif | |
22 | ||
c129767e KZ |
23 | ifeq "$(HAVE_BLKID)" "yes" |
24 | BLKID_DEFINE = -DHAVE_BLKID | |
25 | BLKID_LIB = -lblkid -luuid | |
26 | endif | |
27 | ||
22853e4a KZ |
28 | PROGS = $(SUID_PROGS) $(NOSUID_PROGS) |
29 | ||
66ee8158 KZ |
30 | MAYBE = pivot_root swapoff |
31 | ||
c07ebfa1 | 32 | LO_OBJS = lomount.o $(LIB)/xstrncpy.o |
fd6b7a7f | 33 | NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o |
22853e4a | 34 | GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c |
6dbe3af9 | 35 | |
6dbe3af9 KZ |
36 | all: $(PROGS) |
37 | ||
38 | install: $(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 | 50 | mount: 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 |
55 | umount: 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 |
60 | swapon: 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 | 64 | main_losetup.o: lomount.c |
66ee8158 | 65 | $(COMPILE) -DMAIN lomount.c -o $@ |
22853e4a | 66 | |
c07ebfa1 | 67 | losetup: main_losetup.o $(LIB)/xstrncpy.o |
5c36a0eb | 68 | $(LINK) $^ -o $@ |
2b6fc908 | 69 | |
eb63b9b8 | 70 | mount.o umount.o nfsmount.o losetup.o fstab.o realpath.o sundries.o: sundries.h |
fd6b7a7f KZ |
71 | |
72 | mount.o umount.o fstab.o sundries.o: fstab.h | |
73 | ||
5c36a0eb KZ |
74 | mount.o fstab.o mntent.o: mntent.h |
75 | ||
76 | mount.o mount_guess_fstype.o: mount_guess_fstype.h | |
77 | ||
78 | mount.o: $(LIB)/setproctitle.h | |
79 | ||
80 | mount.o umount.o getusername.o: getusername.h | |
81 | ||
d03dd608 | 82 | mount.o umount.o losetup.o lomount.o: lomount.h loop.h my_dev_t.h |
fd6b7a7f | 83 | |
5c36a0eb | 84 | swapon.o: swap_constants.h swapargs.h |
6dbe3af9 | 85 | |
fd6b7a7f | 86 | sundries.o nfsmount.o nfsmount_xdr.o nfsmount_clnt.o: nfsmount.h |
6dbe3af9 | 87 | |
2b6fc908 KZ |
88 | umount.o: mount_constants.h |
89 | ||
c129767e KZ |
90 | mount.o mount_blkid.o: mount_blkid.h |
91 | ||
5c36a0eb KZ |
92 | mount.o mount_by_label.o mount_guess_fstype.o: linux_fs.h |
93 | ||
eb63b9b8 KZ |
94 | sundries.o realpath.o: realpath.h |
95 | ||
fd6b7a7f KZ |
96 | nfsmount_clnt.o: nfsmount_clnt.c |
97 | $(COMPILE) $(RPC_CFLAGS) nfsmount_clnt.c | |
6dbe3af9 | 98 | |
fd6b7a7f KZ |
99 | nfsmount_xdr.o: nfsmount_xdr.c |
100 | $(COMPILE) $(RPC_CFLAGS) nfsmount_xdr.c | |
6dbe3af9 | 101 | |
22853e4a | 102 | ifeq "$(HAVE_GOOD_RPC)" "yes" |
63cccae4 KZ |
103 | nfsmount.h: nfsmount.x |
104 | rm -f nfsmount.h | |
22853e4a | 105 | $(RPCGEN) -h -o nfsmount.h nfsmount.x |
63cccae4 KZ |
106 | |
107 | nfsmount_xdr.c: nfsmount.x | |
108 | rm -f nfsmount_xdr.c | |
22853e4a | 109 | $(RPCGEN) -c -o nfsmount_xdr.c nfsmount.x |
63cccae4 KZ |
110 | |
111 | nfsmount_clnt.c: nfsmount.x | |
112 | rm -f nfsmount_clnt.c | |
22853e4a KZ |
113 | $(RPCGEN) -l -o nfsmount_clnt.c nfsmount.x |
114 | else | |
63cccae4 | 115 | nfsmount.h: |
22853e4a | 116 | cp $(RPCSVCDIR)/nfsmount.h . |
63cccae4 KZ |
117 | |
118 | nfsmount_xdr.c: | |
22853e4a | 119 | cp $(RPCSVCDIR)/nfsmount_xdr.c . |
63cccae4 KZ |
120 | |
121 | nfsmount_clnt.c: | |
22853e4a KZ |
122 | cp $(RPCSVCDIR)/nfsmount_clnt.c . |
123 | endif | |
124 | ||
125 | nfsmount.o: nfs_mount4.h | |
fd6b7a7f | 126 | |
fd6b7a7f KZ |
127 | swapargs.h: |
128 | sh swap.configure | |
129 | ||
6dbe3af9 | 130 | clean: |
66ee8158 | 131 | rm -f a.out core *~ *.o swapargs.h $(PROGS) $(MAYBE) |
d03dd608 | 132 | rm -f nfs_mountversion.h |
6dbe3af9 | 133 | |
2b6fc908 | 134 | clobber distclean realclean: clean |
22853e4a | 135 | rm -f $(GEN_FILES) |