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