1 # ifeq (../MCONFIG,$(wildcard ../MCONFIG))
5 # For now: a standalone version
10 #WARNFLAGS = -Wall -Wstrict-prototypes
12 WARNFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes
13 # but at the moment that yields
14 #<linux/socket.h>:72: warning: no previous prototype for `cmsg_nxthdr'
16 # you need rpcgen and libc-4.2 or rpclib to compile in the NFS support
17 # pregenerated files are included.
18 # Make sure nfsmount_clnt.c is newer than nfsmount.x to avoid gcc complaints.
22 RPC_CFLAGS = -Wno-unused
26 INSTALL_SUID = $(INSTALL) -m 4755 -o root
27 INSTALL_PROG = $(INSTALL) -m 755
28 INSTALL_DATA = $(INSTALL) -m 644
29 INSTALL_DIR = mkdir -p
30 INSTALL_MAN = $(INSTALL_DATA)
33 ## for suid progs (mount, umount)
35 ## for nosuid progs (swapon)
38 # End of configuration section.
40 COMPILE = $(CC) -c $(WARNFLAGS) $(CFLAGS) $(DEFINES)
41 LINK = $(CC) $(LDFLAGS)
43 SUID_PROGS = mount umount
44 NOSUID_PROGS = swapon losetup
45 PROGS = $(SUID_PROGS) $(NOSUID_PROGS)
47 MAN8 = mount.8 swapoff.8 swapon.8 umount.8 losetup.8
49 # comment these out if you are not compiling in NFS support
50 NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o
51 # uncomment this if you don't have libc-4.2 but do have the rpclib
52 GEN_FILES = nfsmount.x nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
54 # comment these out if you are not compiling in loop support
60 $(INSTALL_DIR) $(BINDIR) $(SBINDIR)
61 $(INSTALL_SUID) -s $(SUID_PROGS) $(BINDIR)
62 $(INSTALL_PROG) -s $(NOSUID_PROGS) $(SBINDIR)
63 (cd $(SBINDIR); ln -sf swapon swapoff)
64 $(INSTALL_DIR) $(MANDIR)/man5 $(MANDIR)/man8
65 $(INSTALL_MAN) $(MAN5) $(MANDIR)/man5
66 $(INSTALL_MAN) $(MAN8) $(MANDIR)/man8
71 mount: mount.o fstab.o sundries.o realpath.o version.o $(NFS_OBJS) $(LO_OBJS)
74 umount: umount.o fstab.o sundries.o realpath.o version.o $(LO_OBJS)
77 swapon: swapon.o version.o
83 mount.o umount.o nfsmount.o losetup.o fstab.o sundries.o: sundries.h
85 mount.o umount.o fstab.o sundries.o: fstab.h
87 mount.o umount.o losetup.o: lomount.h loop.h
89 swapon.o: swap.h swapargs.h
91 sundries.o nfsmount.o nfsmount_xdr.o nfsmount_clnt.o: nfsmount.h
93 umount.o: mount_constants.h
95 nfsmount_clnt.o: nfsmount_clnt.c
96 $(COMPILE) $(RPC_CFLAGS) nfsmount_clnt.c
98 nfsmount_xdr.o: nfsmount_xdr.c
99 $(COMPILE) $(RPC_CFLAGS) nfsmount_xdr.c
101 nfsmount.h nfsmount_xdr.c nfsmount_clnt.c: nfsmount.x
102 rm -f nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
103 $(RPCGEN) -h -o nfsmount.h nfsmount.x
104 $(RPCGEN) -c -o nfsmount_xdr.c nfsmount.x
105 $(RPCGEN) -l -o nfsmount_clnt.c nfsmount.x
108 cp $(RPCSVCDIR)/nfsmount.x .
110 nfsmount.o: nfs_mountversion.h nfs_mount3.h
112 NFSMOUNTH=/usr/include/linux/nfs_mount.h
113 SWAPH=/usr/include/linux/swap.h
114 LOOPH=/usr/include/linux/loop.h
117 rm -f nfs_mountversion.h
118 if [ -f $(NFSMOUNTH) ]; then \
119 grep NFS_MOUNT_VERSION $(NFSMOUNTH) \
120 | sed -e 's/NFS/KERNEL_NFS/'; \
122 echo '#define KERNEL_NFS_MOUNT_VERSION 0'; \
123 fi > nfs_mountversion.h
127 if [ -f $(SWAPH) ]; then cp $(SWAPH) .; else touch swap.h; fi
134 if [ -f $(LOOPH) ]; then cp $(LOOPH) .; else touch loop.h; fi
137 rm -f a.out core *~ *.o swapargs.h $(PROGS) swapoff
140 rm -f swap.h loop.h nfs_mountversion.h
142 clobber distclean realclean: cleaner