1 1.34.4.1 thorpej # $NetBSD: Makefile.inc,v 1.34.4.1 2002/01/10 20:00:26 thorpej 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.31 drochner 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.13 mycroft KERNMAKE= \ 34 1.31 drochner cd ${KERNDST} && ${MAKE} -f ${KERNDIR:Q}/Makefile \ 35 1.31 drochner KERNDIR=${KERNDIR:Q} \ 36 1.23 christos CC=${CC:Q} CFLAGS=${CFLAGS:Q} \ 37 1.23 christos AS=${AS:Q} AFLAGS=${AFLAGS:Q} \ 38 1.27 gwr LORDER=${LORDER:Q} \ 39 1.27 gwr TSORT=${TSORT:Q} \ 40 1.33 tsutsui LD=${LD:Q} STRIP=${STRIP:Q} \ 41 1.28 cgd AR=${AR:Q} NM=${NM:Q} \ 42 1.28 cgd RANLIB=${RANLIB:Q} SIZE=${SIZE:Q} \ 43 1.23 christos MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \ 44 1.31 drochner KERNCPPFLAGS=${CPPFLAGS:S@^-I.@-I${KERNDOTDIR}@g:Q} \ 45 1.25 cgd KERNMISCCPPFLAGS=${KERNMISCCPPFLAGS:Q} \ 46 1.24 cgd ${KERNMISCMAKEFLAGS} 47 1.13 mycroft 48 1.34 sommerfe ${KERNLIB}: .NOTMAIN .MAKE __always_make_kernlib 49 1.1 cgd @echo making sure the kern library is up to date... 50 1.22 ws .if (${KERN_AS} == "library") 51 1.22 ws @${KERNMAKE} libkern.a 52 1.22 ws .else 53 1.13 mycroft @${KERNMAKE} libkern.o 54 1.22 ws .endif 55 1.1 cgd 56 1.34 sommerfe ${KERNLIB_PROF}: .NOTMAIN .MAKE __always_make_kernlib 57 1.1 cgd @echo making sure the profiled kern library is up to date... 58 1.22 ws .if (${KERN_AS} == "library") 59 1.22 ws @${KERNMAKE} libkern_p.a 60 1.22 ws .else 61 1.13 mycroft @${KERNMAKE} libkern.po 62 1.22 ws .endif 63 1.10 christos 64 1.24 cgd clean: .NOTMAIN cleankernlib 65 1.34.4.1 thorpej cleankernlib: .NOTMAIN 66 1.10 christos @echo cleaning the kern library objects 67 1.34.4.1 thorpej @if [ -d "${KERNDST}" ]; then ${KERNMAKE} clean; fi 68 1.14 mycroft 69 1.29 lukem cleandir distclean: .NOTMAIN cleandirkernlib 70 1.34.4.1 thorpej cleandirkernlib: .NOTMAIN 71 1.24 cgd @echo cleandiring the kern library objects 72 1.34.4.1 thorpej @if [ -d "${KERNDST}" ]; then ${KERNMAKE} cleandir; fi 73 1.24 cgd 74 1.24 cgd depend: .NOTMAIN dependkernlib 75 1.34 sommerfe dependkernlib: .NOTMAIN .MAKE __always_make_kernlib 76 1.14 mycroft @echo depending the kern library objects 77 1.14 mycroft @${KERNMAKE} depend 78 1.1 cgd 79 1.2 cgd __always_make_kernlib: .NOTMAIN 80 1.26 thorpej @(mkdir -p ${KERNDST}) 81 1.31 drochner 82 1.31 drochner .PHONY: __always_make_kernlib 83 1.31 drochner .PHONY: cleankernlib cleandirkernlib dependkernlib 84