xref: /minix/sys/arch/i386/stand/lib/Makefile.inc (revision 84d9c625)
1#	$NetBSD: Makefile.inc,v 1.14 2011/05/26 12:56:30 joerg Exp $
2#
3#	Configuration variables (default values are below):
4#
5#	S	must be set to the top of the 'sys' tree.
6#	I386DST	may be set to the location of the directory where library
7#		objects are to be built.  Defaults to ${.OBJDIR}/lib/i386.
8#	I386MISCCPPFLAGS
9#		Miscellaneous cpp flags to be passed to the library's Makefile
10#		when building.
11#	I386MISCMAKEFLAGS
12#		Miscellaneous flags to be passed to the library's Makefile when
13#		building.  See library's Makefile for more details about
14#		supported flags and their default values.
15
16.if defined(__MINIX)
17USE_BITCODE=no
18.endif # defined(__MINIX)
19
20# Default values:
21I386DST?=		${.OBJDIR}/lib/i386
22
23#I386DIR=		$S/arch/i386/stand/lib
24I386LIB=		${I386DST}/libi386.a
25
26CWARNFLAGS.clang+=	-Wno-tautological-compare
27
28I386MAKE= \
29	cd ${I386DIR} && MAKEOBJDIRPREFIX= && unset MAKEOBJDIRPREFIX && \
30	    MAKEOBJDIR=${I386DST} ${MAKE} \
31	    CC=${CC:Q} CFLAGS=${CFLAGS:Q} \
32	    AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
33	    LD=${LD:Q} STRIP=${STRIP:Q} \
34	    MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
35	    I386CPPFLAGS=${CPPFLAGS:S@^-I.@-I../../.@g:Q} \
36	    I386MISCCPPFLAGS=${I386MISCCPPFLAGS:Q} \
37	    ${I386MISCMAKEFLAGS}
38
39${I386LIB}:		.NOTMAIN __always_make_i386lib
40	@echo making sure the i386 library is up to date...
41	@${I386MAKE} libi386.a
42
43clean:			.NOTMAIN cleani386lib
44cleani386lib:		.NOTMAIN
45	@echo cleaning the i386 library objects
46	@if [ -d "${I386DST}" ]; then ${I386MAKE} clean; fi
47
48cleandir distclean:	.NOTMAIN cleandiri386lib
49cleandiri386lib:	.NOTMAIN
50	@echo cleandiring the i386 library objects
51	@if [ -d "${I386DST}" ]; then ${I386MAKE} cleandir; fi
52
53dependall depend:	.NOTMAIN dependi386lib
54dependi386lib:		.NOTMAIN __always_make_i386lib
55	@echo depending the i386 library objects
56	@${I386MAKE} depend
57
58__always_make_i386lib:	.NOTMAIN
59	@mkdir -p ${I386DST}
60