]>
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 | ||
6dbe3af9 | 27 | # comment these out if you are not compiling in NFS support |
fd6b7a7f | 28 | NFS_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 | 30 | GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c |
6dbe3af9 KZ |
31 | |
32 | # comment these out if you are not compiling in loop support | |
33 | LO_OBJS=lomount.o | |
34 | ||
35 | all: $(PROGS) | |
36 | ||
37 | install: $(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 |
49 | mount: 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 |
54 | umount: umount.o fstab.o sundries.o realpath.o mntent.o getusername.o \ |
55 | version.o $(LO_OBJS) | |
56 | $(LINK) $^ -o $@ | |
6dbe3af9 | 57 | |
fd6b7a7f | 58 | swapon: swapon.o version.o |
5c36a0eb | 59 | $(LINK) $^ -o $@ |
6dbe3af9 | 60 | |
22853e4a | 61 | losetup.o: lomount.c |
66ee8158 | 62 | $(COMPILE) -DMAIN lomount.c -o $@ |
22853e4a | 63 | |
fd6b7a7f | 64 | losetup: losetup.o |
5c36a0eb | 65 | $(LINK) $^ -o $@ |
2b6fc908 | 66 | |
eb63b9b8 | 67 | mount.o umount.o nfsmount.o losetup.o fstab.o realpath.o sundries.o: sundries.h |
fd6b7a7f KZ |
68 | |
69 | mount.o umount.o fstab.o sundries.o: fstab.h | |
70 | ||
5c36a0eb KZ |
71 | mount.o fstab.o mntent.o: mntent.h |
72 | ||
73 | mount.o mount_guess_fstype.o: mount_guess_fstype.h | |
74 | ||
75 | mount.o: $(LIB)/setproctitle.h | |
76 | ||
77 | mount.o umount.o getusername.o: getusername.h | |
78 | ||
2b6fc908 | 79 | mount.o umount.o losetup.o lomount.o: lomount.h loop.h |
fd6b7a7f | 80 | |
5c36a0eb | 81 | swapon.o: swap_constants.h swapargs.h |
6dbe3af9 | 82 | |
fd6b7a7f | 83 | sundries.o nfsmount.o nfsmount_xdr.o nfsmount_clnt.o: nfsmount.h |
6dbe3af9 | 84 | |
2b6fc908 KZ |
85 | umount.o: mount_constants.h |
86 | ||
5c36a0eb KZ |
87 | mount.o mount_by_label.o mount_guess_fstype.o: linux_fs.h |
88 | ||
eb63b9b8 KZ |
89 | sundries.o realpath.o: realpath.h |
90 | ||
fd6b7a7f KZ |
91 | nfsmount_clnt.o: nfsmount_clnt.c |
92 | $(COMPILE) $(RPC_CFLAGS) nfsmount_clnt.c | |
6dbe3af9 | 93 | |
fd6b7a7f KZ |
94 | nfsmount_xdr.o: nfsmount_xdr.c |
95 | $(COMPILE) $(RPC_CFLAGS) nfsmount_xdr.c | |
6dbe3af9 | 96 | |
22853e4a KZ |
97 | ifeq "$(HAVE_GOOD_RPC)" "yes" |
98 | nfsmount.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 | |
103 | else | |
104 | nfsmount.h nfsmount_xdr.c nfsmount_clnt.c: | |
105 | cp $(RPCSVCDIR)/nfsmount.h . | |
106 | cp $(RPCSVCDIR)/nfsmount_xdr.c . | |
107 | cp $(RPCSVCDIR)/nfsmount_clnt.c . | |
108 | endif | |
109 | ||
110 | nfsmount.o: nfs_mount4.h | |
fd6b7a7f | 111 | |
fd6b7a7f KZ |
112 | swapargs.h: |
113 | sh swap.configure | |
114 | ||
115 | loop.h: | |
2b6fc908 | 116 | sh mk_loop_h |
6dbe3af9 KZ |
117 | |
118 | clean: | |
66ee8158 | 119 | rm -f a.out core *~ *.o swapargs.h $(PROGS) $(MAYBE) |
5c36a0eb | 120 | rm -f loop.h nfs_mountversion.h |
6dbe3af9 | 121 | |
2b6fc908 | 122 | clobber distclean realclean: clean |
22853e4a | 123 | rm -f $(GEN_FILES) |