1# $MirOS: src/sys/kern/Makefile,v 1.4 2006/06/17 22:12:47 tg Exp $
2# $OpenBSD: Makefile,v 1.10 2002/12/31 16:22:26 miod Exp $
3
4# Makefile for kernel tags files, init_sysent, etc.
5
6ARCH=	i386 sparc
7
8all:	init_sysent.c vnode_if.c
9
10SYSCALLSRC = makesyscalls.sh syscalls.conf syscalls.master
11SYSCALLGEN = init_sysent.c syscalls.c ../sys/syscall.h ../sys/syscallargs.h
12${SYSCALLGEN}: ${SYSCALLSRC}
13	${SHELL} makesyscalls.sh syscalls.conf syscalls.master
14
15VNODEIFSRC = vnode_if.sh vnode_if.src
16VNODEIFGEN = vnode_if.c ../sys/vnode_if.h
17${VNODEIFGEN}: ${VNODEIFSRC}
18	${SHELL} vnode_if.sh vnode_if.src
19
20# Kernel tags:
21# Tags files are built in the top-level directory for each architecture,
22# with a makefile listing the architecture-dependent files, etc.  The list
23# of common files is in ./Make.tags.inc.  Links to the correct tags file
24# are placed in each source directory.  We need to have links to tags files
25# from the generic directories that are relative to the machine type, even
26# via remote mounts; therefore we use symlinks to $SYSTAGS, which points at
27# ${SYSDIR}/${MACHINE}/tags.
28
29SYSTAGS=/var/db/sys_tags
30SYSDIR=/sys
31
32# Directories in which to place tags links (other than machine-dependent)
33DGEN=	compat compat/common compat/openbsd compat/linux \
34	conf \
35	ddb \
36	dev dev/ic dev/isa dev/pci dev/pcmcia dev/cardbus dev/rcons \
37	dev/sun \
38	isofs isofs/cd9660 \
39	kern \
40	lib libkern \
41	miscfs miscfs/deadfs miscfs/fdesc miscfs/fifofs miscfs/kernfs \
42	miscfs/nullfs miscfs/portal miscfs/procfs \
43	miscfs/specfs miscfs/umapfs miscfs/union \
44	msdosfs \
45	net netisdn netinet netinet6 netipx \
46	nfs \
47	scsi \
48	sys \
49	ufs ufs/ffs ufs/mfs ufs/ufs
50
51tags::
52	-for i in ${ARCH}; do \
53	    (cd ../arch/$$i && make ${MFLAGS} tags); done
54
55links::
56	rm -f ${SYSTAGS}
57	ln -s ${SYSDIR}/arch/${MACHINE}/tags ${SYSTAGS}
58	-for i in ${DGEN}; do \
59	    (cd ../$$i && { rm -f tags; ln -s ${SYSTAGS} tags; }) done
60	-for i in ${ARCH}; do \
61	    (cd ../arch/$$i && make ${MFLAGS} SYSTAGS=${SYSTAGS} links); done
62
63cleangen::
64	-rm -f ${SYSCALLGEN} ${VNODEIFGEN}
65