]>
Commit | Line | Data |
---|---|---|
7eda085c | 1 | include ../make_include |
6dbe3af9 | 2 | include ../MCONFIG |
fd6b7a7f | 3 | |
fd6b7a7f | 4 | DEFINES = -DHAVE_NFS |
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 | ||
23 | PROGS = $(SUID_PROGS) $(NOSUID_PROGS) | |
24 | ||
66ee8158 KZ |
25 | MAYBE = pivot_root swapoff |
26 | ||
c07ebfa1 | 27 | LO_OBJS = lomount.o $(LIB)/xstrncpy.o |
fd6b7a7f | 28 | NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o |
22853e4a | 29 | GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c |
6dbe3af9 | 30 | |
6dbe3af9 KZ |
31 | all: $(PROGS) |
32 | ||
33 | install: $(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 |
45 | mount: 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 | 50 | umount: 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 | 54 | swapon: swapon.o version.o |
5c36a0eb | 55 | $(LINK) $^ -o $@ |
6dbe3af9 | 56 | |
c07ebfa1 | 57 | main_losetup.o: lomount.c |
66ee8158 | 58 | $(COMPILE) -DMAIN lomount.c -o $@ |
22853e4a | 59 | |
c07ebfa1 | 60 | losetup: main_losetup.o $(LIB)/xstrncpy.o |
5c36a0eb | 61 | $(LINK) $^ -o $@ |
2b6fc908 | 62 | |
eb63b9b8 | 63 | mount.o umount.o nfsmount.o losetup.o fstab.o realpath.o sundries.o: sundries.h |
fd6b7a7f KZ |
64 | |
65 | mount.o umount.o fstab.o sundries.o: fstab.h | |
66 | ||
5c36a0eb KZ |
67 | mount.o fstab.o mntent.o: mntent.h |
68 | ||
69 | mount.o mount_guess_fstype.o: mount_guess_fstype.h | |
70 | ||
71 | mount.o: $(LIB)/setproctitle.h | |
72 | ||
73 | mount.o umount.o getusername.o: getusername.h | |
74 | ||
2b6fc908 | 75 | mount.o umount.o losetup.o lomount.o: lomount.h loop.h |
fd6b7a7f | 76 | |
5c36a0eb | 77 | swapon.o: swap_constants.h swapargs.h |
6dbe3af9 | 78 | |
fd6b7a7f | 79 | sundries.o nfsmount.o nfsmount_xdr.o nfsmount_clnt.o: nfsmount.h |
6dbe3af9 | 80 | |
2b6fc908 KZ |
81 | umount.o: mount_constants.h |
82 | ||
5c36a0eb KZ |
83 | mount.o mount_by_label.o mount_guess_fstype.o: linux_fs.h |
84 | ||
eb63b9b8 KZ |
85 | sundries.o realpath.o: realpath.h |
86 | ||
fd6b7a7f KZ |
87 | nfsmount_clnt.o: nfsmount_clnt.c |
88 | $(COMPILE) $(RPC_CFLAGS) nfsmount_clnt.c | |
6dbe3af9 | 89 | |
fd6b7a7f KZ |
90 | nfsmount_xdr.o: nfsmount_xdr.c |
91 | $(COMPILE) $(RPC_CFLAGS) nfsmount_xdr.c | |
6dbe3af9 | 92 | |
22853e4a | 93 | ifeq "$(HAVE_GOOD_RPC)" "yes" |
63cccae4 KZ |
94 | nfsmount.h: nfsmount.x |
95 | rm -f nfsmount.h | |
22853e4a | 96 | $(RPCGEN) -h -o nfsmount.h nfsmount.x |
63cccae4 KZ |
97 | |
98 | nfsmount_xdr.c: nfsmount.x | |
99 | rm -f nfsmount_xdr.c | |
22853e4a | 100 | $(RPCGEN) -c -o nfsmount_xdr.c nfsmount.x |
63cccae4 KZ |
101 | |
102 | nfsmount_clnt.c: nfsmount.x | |
103 | rm -f nfsmount_clnt.c | |
22853e4a KZ |
104 | $(RPCGEN) -l -o nfsmount_clnt.c nfsmount.x |
105 | else | |
63cccae4 | 106 | nfsmount.h: |
22853e4a | 107 | cp $(RPCSVCDIR)/nfsmount.h . |
63cccae4 KZ |
108 | |
109 | nfsmount_xdr.c: | |
22853e4a | 110 | cp $(RPCSVCDIR)/nfsmount_xdr.c . |
63cccae4 KZ |
111 | |
112 | nfsmount_clnt.c: | |
22853e4a KZ |
113 | cp $(RPCSVCDIR)/nfsmount_clnt.c . |
114 | endif | |
115 | ||
116 | nfsmount.o: nfs_mount4.h | |
fd6b7a7f | 117 | |
fd6b7a7f KZ |
118 | swapargs.h: |
119 | sh swap.configure | |
120 | ||
121 | loop.h: | |
2b6fc908 | 122 | sh mk_loop_h |
6dbe3af9 KZ |
123 | |
124 | clean: | |
66ee8158 | 125 | rm -f a.out core *~ *.o swapargs.h $(PROGS) $(MAYBE) |
5c36a0eb | 126 | rm -f loop.h nfs_mountversion.h |
6dbe3af9 | 127 | |
2b6fc908 | 128 | clobber distclean realclean: clean |
22853e4a | 129 | rm -f $(GEN_FILES) |