# BSDI Makefile,v 2.10 1998/03/24 22:47:52 jch Exp

MAN4=	fd.0 ktr.0 localdomain.0 pty.0 termios.0 tty.0 update.0
MLINKS+=fd.4 stderr.4 fd.4 stdin.4 fd.4 stdout.4
MLINKS+=localdomain.4 local.4 localdomain.4 unix.4

all: ${MAN4}

clean depend lint:

cleandir:
	rm -f ${MAN4}

install: maninstall

ARCH=	hp300 i386 luna68k news3400 pmax powerpc sparc

# Kernel tags:
# Tags files are built in the top-level directory for each architecture,
# with a makefile listing the architecture-dependent files, etc.  The list
# of common files is in ./Make.tags.inc.  Links to the correct tags file
# are placed in each source directory.  We need to have links to tags files
# from the generic directories that are relative to the machine type, even
# via remote mounts; therefore we use symlinks to $SYSTAGS, which points at
# ${SYSDIR}/${MACHINE}/tags.

SYSTAGS=/var/db/sys_tags
SYSDIR=${.CURDIR:H}
MFLAGS=SYS=${SYSDIR}

# Directories in which to place tags links (other than machine-dependent)
DGEN=	common conf \
	dev dev/pci dev/scsi \
	kern \
	isofs/cd9660 \
	miscfs miscfs/deadfs miscfs/fdesc miscfs/fifofs miscfs/kernfs \
	miscfs/nullfs miscfs/portal miscfs/procfs miscfs/specfs \
	miscfs/umapfs miscfs/union \
	msdosfs \
	net netccitt netinet netiso netns nfs scripts sys \
	ufs ufs/ffs ufs/lfs ufs/mfs ufs/ufs \
	vm

tags::
	-for i in ${ARCH}; do \
	    ([ -d ${SYSDIR}/$$i ] && \
	    echo "=== $$i" && cd ${SYSDIR}/$$i && make ${MFLAGS} tags); \
	done

links::
	rm -f ${SYSTAGS}
	ln -s ${SYSDIR}/${MACHINE}/tags ${SYSTAGS}
	-for i in ${DGEN}; do \
	    (cd ${SYSDIR}/$$i && { rm -f tags; ln -s ${SYSTAGS} tags; }); \
	done
	-for i in ${ARCH}; do \
	    ([ -d ${SYSDIR}/$$i ] && \
	    cd ${SYSDIR}/$$i && make ${MFLAGS} SYSTAGS=${SYSTAGS} links); \
	done

.include <bsd.prog.mk>
