Makefile.i386 revision 1.163
11.163Sapb#	$NetBSD: Makefile.i386,v 1.163 2009/02/14 16:53:55 apb Exp $
21.62Smycroft
31.8Scgd# Makefile for NetBSD
41.1Scgd#
51.1Scgd# This makefile is constructed from a machine description:
61.1Scgd#	config machineid
71.1Scgd# Most changes should be made in the machine description
81.36Sderaadt#	/sys/arch/i386/conf/``machineid''
91.1Scgd# after which you should do
101.62Smycroft#	config machineid
111.62Smycroft# Machine generic makefile changes should be made in
121.36Sderaadt#	/sys/arch/i386/conf/Makefile.i386
131.42Smycroft# after which config should be rerun for all machines of that type.
141.119Satatat#
151.120Slukem# To specify debugging, add the config line: makeoptions DEBUG="-g"
161.119Satatat# A better way is to specify -g only for a few files.
171.119Satatat#
181.119Satatat#	makeoptions DEBUGLIST="uvm* trap if_*"
191.117Sthorpej
201.119SatatatMACHINE_ARCH=	i386
211.118SjmcUSETOOLS?=	no
221.119SatatatNEED_OWN_INSTALL_TARGET?=no
231.119Satatat.include <bsd.own.mk>
241.42Smycroft
251.119Satatat##
261.119Satatat## (1) port identification
271.119Satatat##
281.119SatatatI386=		$S/arch/i386
291.138SchristosGENASSYM_CONF=	${I386}/i386/genassym.cf
301.119Satatat
311.119Satatat##
321.119Satatat## (2) compile settings
331.119Satatat##
341.121SatatatCPPFLAGS+=	-Di386
351.121SatatatAFLAGS+=	-x assembler-with-cpp -traditional-cpp
361.97Schristos
371.119Satatat##
381.120Slukem## (3) libkern and compat
391.119Satatat##
401.163SapbOPT_MODULAR != ${TOOL_AWK} '/^\#define[ \t]MODULAR/ {x=$$3} END {print x}' \
411.163Sapb	opt_modular.h
421.163Sapb.if !empty(OPT_MODULAR)
431.119SatatatKERN_AS=	obj
441.137Sdsl.else
451.137SdslKERN_AS=	library
461.137Sdsl.endif
471.62Smycroft
481.119Satatat##
491.119Satatat## (4) local objects, compile rules, and dependencies
501.119Satatat##
511.150SchristosMD_OBJS=	locore.o copy.o spl.o vector.o lock_stubs.o
521.119SatatatMD_CFILES=
531.141SyamtMD_SFILES=	${I386}/i386/locore.S ${I386}/i386/copy.S ${I386}/i386/spl.S \
541.150Schristos		${I386}/i386/vector.S ${I386}/i386/lock_stubs.S
551.1Scgd
561.125Sfvdllocore.o: ${I386}/i386/locore.S assym.h
571.125Sfvdl	${NORMAL_S}
581.125Sfvdl
591.141Syamtcopy.o: ${I386}/i386/copy.S assym.h
601.141Syamt	${NORMAL_S}
611.141Syamt
621.125Sfvdlspl.o: ${I386}/i386/spl.S assym.h
631.125Sfvdl	${NORMAL_S}
641.125Sfvdl
651.125Sfvdlvector.o: ${I386}/i386/vector.S assym.h
661.129Schristos	${NORMAL_S}
671.129Schristos
681.150Schristoslock_stubs.o: ${I386}/i386/lock_stubs.S assym.h
691.150Schristos	${NORMAL_S}
701.150Schristos
711.119Satatat##
721.119Satatat## (5) link settings
731.119Satatat##
741.116SthorpejTEXTADDR?=	c0100000
751.122SatatatLINKFLAGS_NORMAL=	-X
761.97Schristos.if (${OBJECT_FMT} == "ELF")
771.111SthorpejKERN_LDSCRIPT?=	kern.ldscript
781.119SatatatLINKFORMAT=	-T ${I386}/conf/${KERN_LDSCRIPT}
791.97Schristos.else
801.119SatatatLINKFORMAT=	-z
811.107Sthorpej.endif
821.107Sthorpej
831.119Satatat##
841.119Satatat## (6) port specific target dependencies
851.119Satatat##
861.98Smrg
871.161Sjoergfreebsd_sigcode.o i386func.o ibcs2_sigcode.o linux_support.o: assym.h
881.161Sjoerglinux_sigcode.o lock_stubs.o svr4_sigcode.o mach_sigcode.o: assym.h
891.158Sjoergapmcall.o cpufunc.o cpu_in_cksum.o pnpbioscall.o bioscall.o: assym.h
901.132Ssimonbmptramp.o: assym.h
911.154Sjmcneillacpi_wakeup_low.o busfunc.o kvm86call.o: assym.h
921.119Satatat
931.119Satatat##
941.119Satatat## (7) misc settings
951.119Satatat##
961.119Satatat
971.159Smrg# define .MAIN _before_ the make() check, so that implicit target
981.159Smrg# would be defined
991.159Smrg.MAIN: all
1001.159Smrg
1011.159Smrg.if make(depend) || make(all) || make(dependall)
1021.159Smrg.BEGIN:
1031.159Smrg	@rm -f i386 && \
1041.159Smrg		ln -s $S/arch/i386/include i386
1051.159Smrg.endif
1061.159Smrg
1071.119Satatat##
1081.119Satatat## (8) config(8) generated machinery
1091.119Satatat##
1101.98Smrg%INCLUDES
1111.74Smycroft
1121.1Scgd%OBJS
1131.1Scgd
1141.1Scgd%CFILES
1151.1Scgd
1161.62Smycroft%SFILES
1171.62Smycroft
1181.1Scgd%LOAD
1191.50Smycroft
1201.119Satatat%RULES
1211.1Scgd
1221.162Salc## Include rules for ACPI wakecode
1231.154Sjmcneill.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
1241.133Sjmc
1251.119Satatat##
1261.119Satatat## (9) port independent kernel machinery
1271.119Satatat##
1281.119Satatat.include "$S/conf/Makefile.kern.inc"
1291.135Sthorpej
1301.135Sthorpej##
1311.135Sthorpej## (10) Appending make options.
1321.135Sthorpej##
1331.135Sthorpej%MAKEOPTIONSAPPEND
134