1 1.24 cgd # $NetBSD: Makefile.inc,v 1.24 1997/01/23 22:29:07 cgd Exp $ 2 1.1 cgd # 3 1.24 cgd # Configuration variables (default values are below): 4 1.24 cgd # 5 1.24 cgd # S must be set to the top of the 'sys' tree. 6 1.24 cgd # KERNDST may be set to the location of the directory where library 7 1.24 cgd # objects are to be built. Defaults to ${.OBJDIR}/lib/kern. 8 1.24 cgd # KERN_AS may be set to 'obj' to build a object from the library's 9 1.24 cgd # object files. (Otherwise, a library will be built.) 10 1.24 cgd # Defaults to 'library'. 11 1.24 cgd # KERNMISCMAKEFLAGS 12 1.24 cgd # Miscellaneous flags to be passed to the library's Makefile when 13 1.24 cgd # building. See library's Makefile for more details about 14 1.24 cgd # supported flags and their default values. 15 1.1 cgd 16 1.24 cgd # Default values: 17 1.16 mycroft KERNDST?= ${.OBJDIR}/lib/kern 18 1.22 ws KERN_AS?= obj 19 1.22 ws 20 1.24 cgd KERNDIR= $S/lib/libkern 21 1.24 cgd .if (${KERN_AS} == "obj") 22 1.24 cgd KERNLIB= ${KERNDST}/libkern.o 23 1.24 cgd KERNLIB_PROF= ${KERNDST}/libkern.po 24 1.24 cgd .else 25 1.22 ws KERNLIB= ${KERNDST}/libkern.a 26 1.22 ws KERNLIB_PROF= ${KERNDST}/libkern_p.a 27 1.22 ws .endif 28 1.1 cgd 29 1.13 mycroft KERNMAKE= \ 30 1.16 mycroft cd ${KERNDIR} && MAKEOBJDIR=${KERNDST} ${MAKE} \ 31 1.23 christos CC=${CC:Q} CFLAGS=${CFLAGS:Q} \ 32 1.23 christos AS=${AS:Q} AFLAGS=${AFLAGS:Q} \ 33 1.23 christos LD=${LD:Q} STRIP=${STRIP:Q} \ 34 1.23 christos MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \ 35 1.24 cgd KERNCPPFLAGS=${CPPFLAGS:S@^-I.@-I../../.@g:Q} \ 36 1.24 cgd ${KERNMISCMAKEFLAGS} 37 1.13 mycroft 38 1.10 christos ${KERNLIB}: .NOTMAIN __always_make_kernlib 39 1.1 cgd @echo making sure the kern library is up to date... 40 1.22 ws .if (${KERN_AS} == "library") 41 1.22 ws @${KERNMAKE} libkern.a 42 1.22 ws .else 43 1.13 mycroft @${KERNMAKE} libkern.o 44 1.22 ws .endif 45 1.1 cgd 46 1.10 christos ${KERNLIB_PROF}: .NOTMAIN __always_make_kernlib 47 1.1 cgd @echo making sure the profiled kern library is up to date... 48 1.22 ws .if (${KERN_AS} == "library") 49 1.22 ws @${KERNMAKE} libkern_p.a 50 1.22 ws .else 51 1.13 mycroft @${KERNMAKE} libkern.po 52 1.22 ws .endif 53 1.10 christos 54 1.24 cgd clean: .NOTMAIN cleankernlib 55 1.24 cgd cleankernlib: .NOTMAIN __always_make_kernlib 56 1.10 christos @echo cleaning the kern library objects 57 1.13 mycroft @${KERNMAKE} clean 58 1.14 mycroft 59 1.24 cgd cleandir: .NOTMAIN cleandirkernlib 60 1.24 cgd cleandirkernlib: .NOTMAIN __always_make_kernlib 61 1.24 cgd @echo cleandiring the kern library objects 62 1.24 cgd @${KERNMAKE} cleandir 63 1.24 cgd 64 1.24 cgd depend: .NOTMAIN dependkernlib 65 1.24 cgd dependkernlib: .NOTMAIN __always_make_kernlib 66 1.14 mycroft @echo depending the kern library objects 67 1.14 mycroft @${KERNMAKE} depend 68 1.1 cgd 69 1.2 cgd __always_make_kernlib: .NOTMAIN 70 1.13 mycroft @mkdir -p ${KERNDST} 71