Makefile revision 1.11
11.11Slukem#	$NetBSD: Makefile,v 1.11 2003/10/26 07:25:38 lukem 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.1Scgd	-mv -f init_sysent.c init_sysent.c.bak
161.1Scgd	-mv -f syscalls.c syscalls.c.bak
171.1Scgd	-mv -f ../sys/syscall.h ../sys/syscall.h.bak
181.3Scgd	-mv -f ../sys/syscallargs.h ../sys/syscallargs.h.bak
191.11Slukem	${HOST_SH} makesyscalls.sh syscalls.conf syscalls.master
201.5Scgd
211.5ScgdVNODEIFSRC = vnode_if.sh vnode_if.src
221.5Scgdvnode_if.c ../sys/vnode_if.h: ${VNODEIFSRC}
231.5Scgd	-mv -f vnode_if.c vnode_if.c.bak
241.5Scgd	-mv -f ../sys/vnode_if.h ../sys/vnode_if.h.bak
251.11Slukem	${HOST_SH} vnode_if.sh vnode_if.src
261.1Scgd
271.7Sperry
281.1Scgd# Kernel tags:
291.1Scgd# Tags files are built in the top-level directory for each architecture,
301.1Scgd# with a makefile listing the architecture-dependent files, etc.  The list
311.1Scgd# of common files is in ./Make.tags.inc.  Links to the correct tags file
321.1Scgd# are placed in each source directory.  We need to have links to tags files
331.1Scgd# from the generic directories that are relative to the machine type, even
341.1Scgd# via remote mounts; therefore we use symlinks to $SYSTAGS, which points at
351.8Sperry# ${SYSDIR}/arch/${MACHINE}/tags.
361.7Sperry
371.8Sperry# Note: only a couple of architectures are currently working right. Add more
381.8Sperry# to ARCH as you fix them. Use the i386 as a model.
391.8Sperry
401.8SperryARCH=	i386 mac68k
411.1Scgd
421.1ScgdSYSTAGS=/var/db/sys_tags
431.10SjhawkSYSDIR=..
441.1Scgd
451.8Sperry.ifmake links
461.8Sperry# Directories in which to place tags links (other than machine-dependent):
471.8Sperry# The invocation below returns every directory that contains sources, the idea
481.8Sperry# being, in the face of a constantly varying source tree, that this will be 
491.8Sperry# easier to maintain than a fixed list.
501.10SjhawkDGEN!=	(cd ${SYSDIR};							\
511.10Sjhawk	    find -H . -name arch -prune -o -name "*.[chs]" -print |	\
521.10Sjhawk	    sed -e 's@^\./@@' -e 's@/[^/]*\..*@@' | sort -t / -u )
531.8Sperry.endif
541.1Scgd
551.1Scgdtags::
561.1Scgd	-for i in ${ARCH}; do \
571.9Sjhawk	    (cd ../arch/$$i && ${MAKE} ${MFLAGS} tags); done
581.1Scgd
591.1Scgdlinks::
601.1Scgd	rm -f ${SYSTAGS}
611.8Sperry	ln -s ${SYSDIR}/arch/${MACHINE}/tags ${SYSTAGS}
621.1Scgd	-for i in ${DGEN}; do \
631.8Sperry	    (cd ../$$i && { rm -f tags; ln -s ${SYSTAGS} tags; }); done
641.1Scgd	-for i in ${ARCH}; do \
651.9Sjhawk	    (cd ../arch/$$i && ${MAKE} ${MFLAGS} SYSTAGS=${SYSTAGS} links); done
66