366b58f084
mount_mfs(8); the mount_*(8) are hardlinked to mount (appropriate mount routine is called depending on program name) - this saves approx. 1.7MB of /sbin space mount.c: make all local symbols static
58 lines
2.0 KiB
Makefile
58 lines
2.0 KiB
Makefile
# $NetBSD: Makefile,v 1.15 2000/10/30 21:31:50 jdolecek Exp $
|
|
# @(#)Makefile 8.6 (Berkeley) 5/8/95
|
|
|
|
PROG= mount
|
|
MAN= mount.8
|
|
SRCS= mount.c vfslist.c
|
|
# We do NOT install the getmntopts.3 man page.
|
|
# getmntopts.c in this directory isn't used by mount anymore, but it
|
|
# is used by other mount programs which use .PATH directives to use
|
|
# the version here.
|
|
|
|
SRCS+= getmntopts.c fattr.c checkname.c
|
|
CPPFLAGS+= -I${.CURDIR} -DMOUNT_NOMAIN
|
|
|
|
# Note: mount_portal is excluded by purpose, mainly because it contains
|
|
# more stuff and hence cannot be made to export only mount_FOO() symbol
|
|
MOUNT_PROGS= mount_ados mount_cd9660 mount_ext2fs mount_fdesc mount_ffs \
|
|
mount_filecore mount_kernfs mount_lfs mount_msdos mount_nfs \
|
|
mount_ntfs mount_null mount_overlay mount_procfs mount_umap \
|
|
mount_union
|
|
|
|
# include individual source files and manpages to build process
|
|
.for p in ${MOUNT_PROGS}
|
|
.PATH: ${.CURDIR}/../${p}
|
|
SRCS+= ${p}.c
|
|
MAN+= ${p}.8
|
|
LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${p}
|
|
.endfor
|
|
|
|
# make mount_ufs alias for mount_ffs (this needs also support in checkname.c)
|
|
LINKS+= ${BINDIR}/mount_ffs ${BINDIR}/mount_ufs
|
|
|
|
# generate checkname.c - code which runs appropriate mount_FOO() routine
|
|
# according to program name
|
|
checkname.c: ${.CURDIR}/Makefile
|
|
@if true; then \
|
|
echo "/* File generated by make - DO NOT EDIT */"; \
|
|
echo "#include <sys/types.h>"; \
|
|
echo "#include <mntopts.h>"; \
|
|
for p in ${MOUNT_PROGS}; do \
|
|
echo "int $$p __P((int argc, char **argv));"; \
|
|
done; \
|
|
echo "void checkname(int, char **);"; \
|
|
echo; \
|
|
echo "void checkname(int argc, char **argv) {"; \
|
|
echo " extern const char *__progname;"; \
|
|
echo "if (strcmp(__progname, \"mount\") == 0) return;"; \
|
|
for p in ${MOUNT_PROGS}; do \
|
|
echo "if (strcmp(__progname, \"$$p\") == 0)"; \
|
|
echo " exit($$p(argc, argv));"; \
|
|
done; \
|
|
echo "if (strcmp(__progname, \"mount_ufs\") == 0)"; \
|
|
echo " exit(mount_ffs(argc, argv));"; \
|
|
echo "}"; \
|
|
fi > ${.TARGET}
|
|
|
|
.include <bsd.prog.mk>
|