1 1.44.10.1 martin # $NetBSD: Makefile.inc,v 1.44.10.1 2018/06/09 15:35:38 martin 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.25 cgd # KERNMISCCPPFLAGS 12 1.25 cgd # Miscellaneous cpp flags to be passed to the library's Makefile 13 1.25 cgd # when building. 14 1.24 cgd # KERNMISCMAKEFLAGS 15 1.24 cgd # Miscellaneous flags to be passed to the library's Makefile when 16 1.24 cgd # building. See library's Makefile for more details about 17 1.24 cgd # supported flags and their default values. 18 1.1 cgd 19 1.24 cgd # Default values: 20 1.16 mycroft KERNDST?= ${.OBJDIR}/lib/kern 21 1.30 drochner KERN_AS?= library 22 1.31 drochner KERNDOTDIR?= ../../. 23 1.22 ws 24 1.44.10.1 martin KERNDIR= ${S:S@^.@${KERNDOTDIR}@:q}/lib/libkern 25 1.24 cgd .if (${KERN_AS} == "obj") 26 1.24 cgd KERNLIB= ${KERNDST}/libkern.o 27 1.24 cgd KERNLIB_PROF= ${KERNDST}/libkern.po 28 1.24 cgd .else 29 1.22 ws KERNLIB= ${KERNDST}/libkern.a 30 1.22 ws KERNLIB_PROF= ${KERNDST}/libkern_p.a 31 1.22 ws .endif 32 1.1 cgd 33 1.36 perry LIBKERNLNBN= llib-lkern.ln 34 1.36 perry KERNLIBLN= ${KERNDST}/${LIBKERNLNBN} 35 1.36 perry 36 1.13 mycroft KERNMAKE= \ 37 1.44.10.1 martin cd ${KERNDST} && ${MAKE} -f ${KERNDIR:q}/Makefile \ 38 1.44.10.1 martin KERNDIR=${KERNDIR:q} \ 39 1.44.10.1 martin CC=${CC:q} CFLAGS=${CFLAGS:q} CPUFLAGS= \ 40 1.44.10.1 martin AS=${AS:q} AFLAGS=${AFLAGS:q} \ 41 1.44.10.1 martin LORDER=${LORDER:q} \ 42 1.44.10.1 martin TSORT=${TSORT:q} \ 43 1.44.10.1 martin LD=${LD:q} STRIP=${STRIP:q} \ 44 1.44.10.1 martin AR=${AR:q} NM=${NM:q} \ 45 1.44.10.1 martin RANLIB=${RANLIB:q} SIZE=${SIZE:q} \ 46 1.44.10.1 martin MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:q} \ 47 1.44.10.1 martin KERNCPPFLAGS=${CPPFLAGS:S@^-I.@-I${KERNDOTDIR}@g:q} \ 48 1.44.10.1 martin KERNMISCCPPFLAGS=${KERNMISCCPPFLAGS:q} \ 49 1.44.10.1 martin LINTFLAGS=${KERNLINTFLAGS:q} \ 50 1.44.10.1 martin LIBKERN_ARCH=${LIBKERN_ARCH:q} \ 51 1.44.10.1 martin COMMON_MACHINE_ARCH=${COMMON_MACHINE_ARCH:q} \ 52 1.24 cgd ${KERNMISCMAKEFLAGS} 53 1.13 mycroft 54 1.34 sommerfe ${KERNLIB}: .NOTMAIN .MAKE __always_make_kernlib 55 1.1 cgd @echo making sure the kern library is up to date... 56 1.22 ws .if (${KERN_AS} == "library") 57 1.22 ws @${KERNMAKE} libkern.a 58 1.22 ws .else 59 1.13 mycroft @${KERNMAKE} libkern.o 60 1.22 ws .endif 61 1.1 cgd 62 1.34 sommerfe ${KERNLIB_PROF}: .NOTMAIN .MAKE __always_make_kernlib 63 1.1 cgd @echo making sure the profiled kern library is up to date... 64 1.22 ws .if (${KERN_AS} == "library") 65 1.22 ws @${KERNMAKE} libkern_p.a 66 1.22 ws .else 67 1.13 mycroft @${KERNMAKE} libkern.po 68 1.22 ws .endif 69 1.36 perry 70 1.36 perry ${KERNLIBLN}: .NOTMAIN .MAKE __always_make_kernlib 71 1.36 perry @echo making sure the kern lint library is up to date... 72 1.36 perry @${KERNMAKE} ${LIBKERNLNBN} 73 1.10 christos 74 1.24 cgd clean: .NOTMAIN cleankernlib 75 1.38 perry cleankernlib: .NOTMAIN 76 1.10 christos @echo cleaning the kern library objects 77 1.35 jmc @if [ -d "${KERNDST}" ]; then ${KERNMAKE} clean; fi 78 1.14 mycroft 79 1.29 lukem cleandir distclean: .NOTMAIN cleandirkernlib 80 1.38 perry cleandirkernlib: .NOTMAIN 81 1.24 cgd @echo cleandiring the kern library objects 82 1.35 jmc @if [ -d "${KERNDST}" ]; then ${KERNMAKE} cleandir; fi 83 1.24 cgd 84 1.37 dsl dependall depend: .NOTMAIN dependkernlib 85 1.34 sommerfe dependkernlib: .NOTMAIN .MAKE __always_make_kernlib 86 1.14 mycroft @echo depending the kern library objects 87 1.14 mycroft @${KERNMAKE} depend 88 1.1 cgd 89 1.2 cgd __always_make_kernlib: .NOTMAIN 90 1.26 thorpej @(mkdir -p ${KERNDST}) 91 1.31 drochner 92 1.31 drochner .PHONY: __always_make_kernlib 93 1.31 drochner .PHONY: cleankernlib cleandirkernlib dependkernlib 94 1.40 christos 95 1.40 christos .include "${.PARSEDIR}/../../../common/lib/libc/Makefile.inc" 96