Makefile revision 1.13
11.13Sperry#	$NetBSD: Makefile,v 1.13 2005/02/26 21:34:55 perry Exp $
21.6Sperry#
31.6Sperry#	from: @(#)Makefile	8.2 (Berkeley) 3/21/94
41.1Scgd
51.1Scgd# Makefile for kernel tags files, init_sysent, etc.
61.1Scgd
71.11Slukem.include <bsd.sys.mk>		# for HOST_SH
81.11Slukem
91.1Scgdall:
101.5Scgd	@echo "make tags, links, init_sysent.c, or vnode_if.c only"
111.5Scgd	@false
121.1Scgd
131.2ScgdSYSCALLSRC = makesyscalls.sh syscalls.conf syscalls.master
141.4Smycroftinit_sysent.c syscalls.c ../sys/syscall.h ../sys/syscallargs.h: ${SYSCALLSRC}
151.11Slukem	${HOST_SH} makesyscalls.sh syscalls.conf syscalls.master
161.5Scgd
171.5ScgdVNODEIFSRC = vnode_if.sh vnode_if.src
181.5Scgdvnode_if.c ../sys/vnode_if.h: ${VNODEIFSRC}
191.11Slukem	${HOST_SH} vnode_if.sh vnode_if.src
201.1Scgd
211.7Sperry
221.1Scgd# Kernel tags:
231.1Scgd# Tags files are built in the top-level directory for each architecture,
241.1Scgd# with a makefile listing the architecture-dependent files, etc.  The list
251.1Scgd# of common files is in ./Make.tags.inc.  Links to the correct tags file
261.1Scgd# are placed in each source directory.  We need to have links to tags files
271.1Scgd# from the generic directories that are relative to the machine type, even
281.1Scgd# via remote mounts; therefore we use symlinks to $SYSTAGS, which points at
291.8Sperry# ${SYSDIR}/arch/${MACHINE}/tags.
301.7Sperry
311.8Sperry# Note: only a couple of architectures are currently working right. Add more
321.8Sperry# to ARCH as you fix them. Use the i386 as a model.
331.8Sperry
341.8SperryARCH=	i386 mac68k
351.1Scgd
361.1ScgdSYSTAGS=/var/db/sys_tags
371.10SjhawkSYSDIR=..
381.1Scgd
391.8Sperry.ifmake links
401.8Sperry# Directories in which to place tags links (other than machine-dependent):
411.8Sperry# The invocation below returns every directory that contains sources, the idea
421.13Sperry# being, in the face of a constantly varying source tree, that this will be
431.8Sperry# easier to maintain than a fixed list.
441.10SjhawkDGEN!=	(cd ${SYSDIR};							\
451.10Sjhawk	    find -H . -name arch -prune -o -name "*.[chs]" -print |	\
461.10Sjhawk	    sed -e 's@^\./@@' -e 's@/[^/]*\..*@@' | sort -t / -u )
471.8Sperry.endif
481.1Scgd
491.1Scgdtags::
501.1Scgd	-for i in ${ARCH}; do \
511.9Sjhawk	    (cd ../arch/$$i && ${MAKE} ${MFLAGS} tags); done
521.1Scgd
531.1Scgdlinks::
541.1Scgd	rm -f ${SYSTAGS}
551.8Sperry	ln -s ${SYSDIR}/arch/${MACHINE}/tags ${SYSTAGS}
561.1Scgd	-for i in ${DGEN}; do \
571.8Sperry	    (cd ../$$i && { rm -f tags; ln -s ${SYSTAGS} tags; }); done
581.1Scgd	-for i in ${ARCH}; do \
591.9Sjhawk	    (cd ../arch/$$i && ${MAKE} ${MFLAGS} SYSTAGS=${SYSTAGS} links); done
60