Makefile revision 1.11
1#	$NetBSD: Makefile,v 1.11 2003/10/26 07:25:38 lukem Exp $
2#
3#	from: @(#)Makefile	8.2 (Berkeley) 3/21/94
4
5# Makefile for kernel tags files, init_sysent, etc.
6
7.include <bsd.sys.mk>		# for HOST_SH
8
9all:
10	@echo "make tags, links, init_sysent.c, or vnode_if.c only"
11	@false
12
13SYSCALLSRC = makesyscalls.sh syscalls.conf syscalls.master
14init_sysent.c syscalls.c ../sys/syscall.h ../sys/syscallargs.h: ${SYSCALLSRC}
15	-mv -f init_sysent.c init_sysent.c.bak
16	-mv -f syscalls.c syscalls.c.bak
17	-mv -f ../sys/syscall.h ../sys/syscall.h.bak
18	-mv -f ../sys/syscallargs.h ../sys/syscallargs.h.bak
19	${HOST_SH} makesyscalls.sh syscalls.conf syscalls.master
20
21VNODEIFSRC = vnode_if.sh vnode_if.src
22vnode_if.c ../sys/vnode_if.h: ${VNODEIFSRC}
23	-mv -f vnode_if.c vnode_if.c.bak
24	-mv -f ../sys/vnode_if.h ../sys/vnode_if.h.bak
25	${HOST_SH} vnode_if.sh vnode_if.src
26
27
28# Kernel tags:
29# Tags files are built in the top-level directory for each architecture,
30# with a makefile listing the architecture-dependent files, etc.  The list
31# of common files is in ./Make.tags.inc.  Links to the correct tags file
32# are placed in each source directory.  We need to have links to tags files
33# from the generic directories that are relative to the machine type, even
34# via remote mounts; therefore we use symlinks to $SYSTAGS, which points at
35# ${SYSDIR}/arch/${MACHINE}/tags.
36
37# Note: only a couple of architectures are currently working right. Add more
38# to ARCH as you fix them. Use the i386 as a model.
39
40ARCH=	i386 mac68k
41
42SYSTAGS=/var/db/sys_tags
43SYSDIR=..
44
45.ifmake links
46# Directories in which to place tags links (other than machine-dependent):
47# The invocation below returns every directory that contains sources, the idea
48# being, in the face of a constantly varying source tree, that this will be 
49# easier to maintain than a fixed list.
50DGEN!=	(cd ${SYSDIR};							\
51	    find -H . -name arch -prune -o -name "*.[chs]" -print |	\
52	    sed -e 's@^\./@@' -e 's@/[^/]*\..*@@' | sort -t / -u )
53.endif
54
55tags::
56	-for i in ${ARCH}; do \
57	    (cd ../arch/$$i && ${MAKE} ${MFLAGS} tags); done
58
59links::
60	rm -f ${SYSTAGS}
61	ln -s ${SYSDIR}/arch/${MACHINE}/tags ${SYSTAGS}
62	-for i in ${DGEN}; do \
63	    (cd ../$$i && { rm -f tags; ln -s ${SYSTAGS} tags; }); done
64	-for i in ${ARCH}; do \
65	    (cd ../arch/$$i && ${MAKE} ${MFLAGS} SYSTAGS=${SYSTAGS} links); done
66