70 lines
2.1 KiB
Makefile
70 lines
2.1 KiB
Makefile
# $NetBSD: Makefile,v 1.25 2002/10/01 08:56:40 jdolecek Exp $
|
|
# @(#)Makefile 8.6 (Berkeley) 5/8/95
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
PROG= mount
|
|
MAN= mount.8
|
|
SRCS= mount.c vfslist.c
|
|
# We do NOT install the getmntopts.3 man page.
|
|
# getmntopts.c in this directory is used by different mount programs which
|
|
# use .PATH directives to get it.
|
|
|
|
SRCS+= getmntopts.c fattr.c checkname.c
|
|
CPPFLAGS+= -I${.CURDIR} -DMOUNT_NOMAIN
|
|
|
|
.if defined(RESCUEDIR)
|
|
CPPFLAGS+= -D_PATH_RESCUE=\"${RESCUEDIR}\"
|
|
.endif
|
|
|
|
# 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: ${NETBSDSRCDIR}/sbin/${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
|
|
MLINKS+= mount_ffs.8 mount_ufs.8
|
|
|
|
CLEANFILES+= checkname.c
|
|
|
|
DPADD+=${LIBUTIL}
|
|
LDADD+=-lutil
|
|
|
|
# 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 <stdlib.h>"; \
|
|
echo "#include <string.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 "if (strcmp(getprogname(), \"mount\") == 0) return;"; \
|
|
for p in ${MOUNT_PROGS}; do \
|
|
echo "if (strcmp(getprogname(), \"$$p\") == 0)"; \
|
|
echo " exit($$p(argc, argv));"; \
|
|
done; \
|
|
echo "if (strcmp(getprogname(), \"mount_ufs\") == 0)"; \
|
|
echo " exit(mount_ffs(argc, argv));"; \
|
|
echo "}"; \
|
|
fi > ${.TARGET}
|
|
|
|
.include <bsd.prog.mk>
|