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