]> git.ipfire.org Git - thirdparty/util-linux.git/blob - mount/Makefile
Imported from util-linux-2.11y tarball.
[thirdparty/util-linux.git] / mount / Makefile
1 include ../make_include
2 include ../MCONFIG
3
4 DEFINES = -DHAVE_NFS
5
6 RPCSVCDIR = rpcsvc
7 RPC_CFLAGS = -Wno-unused
8 RPCGEN = rpcgen
9
10 COMPILE = $(CC) -c $(CFLAGS) $(DEFINES)
11 LINK = $(CC) $(LDFLAGS)
12
13 SUID_PROGS = mount umount
14 NOSUID_PROGS = swapon losetup
15 MAN5 = fstab.5 nfs.5
16 MAN8 = mount.8 swapoff.8 swapon.8 umount.8 losetup.8
17
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
25 MAYBE = pivot_root swapoff
26
27 LO_OBJS = lomount.o $(LIB)/xstrncpy.o
28 NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o
29 GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
30
31 all: $(PROGS)
32
33 install: $(PROGS)
34 $(INSTALLDIR) $(BINDIR) $(SBINDIR)
35 $(INSTALLSUID) $(SUID_PROGS) $(BINDIR)
36 $(INSTALLBIN) $(NOSUID_PROGS) $(SBINDIR)
37 (cd $(SBINDIR); ln -sf swapon swapoff)
38 $(INSTALLDIR) $(MAN5DIR) $(MAN8DIR)
39 $(INSTALLMAN) $(MAN5) $(MAN5DIR)
40 $(INSTALLMAN) $(MAN8) $(MAN8DIR)
41
42 %.o: %.c
43 $(COMPILE) $<
44
45 mount: mount.o fstab.o sundries.o realpath.o mntent.o version.o \
46 mount_guess_fstype.o get_label_uuid.o mount_by_label.o getusername.o \
47 $(LIB)/setproctitle.o $(LIB)/env.o $(NFS_OBJS) $(LO_OBJS)
48 $(LINK) $^ -o $@
49
50 umount: umount.o fstab.o sundries.o realpath.o mntent.o getusername.o \
51 get_label_uuid.o version.o $(LIB)/env.o $(LO_OBJS)
52 $(LINK) $^ -o $@
53
54 swapon: swapon.o version.o
55 $(LINK) $^ -o $@
56
57 main_losetup.o: lomount.c
58 $(COMPILE) -DMAIN lomount.c -o $@
59
60 losetup: main_losetup.o $(LIB)/xstrncpy.o
61 $(LINK) $^ -o $@
62
63 mount.o umount.o nfsmount.o losetup.o fstab.o realpath.o sundries.o: sundries.h
64
65 mount.o umount.o fstab.o sundries.o: fstab.h
66
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
75 mount.o umount.o losetup.o lomount.o: lomount.h loop.h
76
77 swapon.o: swap_constants.h swapargs.h
78
79 sundries.o nfsmount.o nfsmount_xdr.o nfsmount_clnt.o: nfsmount.h
80
81 umount.o: mount_constants.h
82
83 mount.o mount_by_label.o mount_guess_fstype.o: linux_fs.h
84
85 sundries.o realpath.o: realpath.h
86
87 nfsmount_clnt.o: nfsmount_clnt.c
88 $(COMPILE) $(RPC_CFLAGS) nfsmount_clnt.c
89
90 nfsmount_xdr.o: nfsmount_xdr.c
91 $(COMPILE) $(RPC_CFLAGS) nfsmount_xdr.c
92
93 ifeq "$(HAVE_GOOD_RPC)" "yes"
94 nfsmount.h: nfsmount.x
95 rm -f nfsmount.h
96 $(RPCGEN) -h -o nfsmount.h nfsmount.x
97
98 nfsmount_xdr.c: nfsmount.x
99 rm -f nfsmount_xdr.c
100 $(RPCGEN) -c -o nfsmount_xdr.c nfsmount.x
101
102 nfsmount_clnt.c: nfsmount.x
103 rm -f nfsmount_clnt.c
104 $(RPCGEN) -l -o nfsmount_clnt.c nfsmount.x
105 else
106 nfsmount.h:
107 cp $(RPCSVCDIR)/nfsmount.h .
108
109 nfsmount_xdr.c:
110 cp $(RPCSVCDIR)/nfsmount_xdr.c .
111
112 nfsmount_clnt.c:
113 cp $(RPCSVCDIR)/nfsmount_clnt.c .
114 endif
115
116 nfsmount.o: nfs_mount4.h
117
118 swapargs.h:
119 sh swap.configure
120
121 loop.h:
122 sh mk_loop_h
123
124 clean:
125 rm -f a.out core *~ *.o swapargs.h $(PROGS) $(MAYBE)
126 rm -f loop.h nfs_mountversion.h
127
128 clobber distclean realclean: clean
129 rm -f $(GEN_FILES)