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