Makefile.i386 revision 1.139
11.139Sdyoung#	$NetBSD: Makefile.i386,v 1.139 2005/06/22 06:14:51 dyoung 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.137Sdsl.if !empty(IDENT:M-DLKM)
411.119SatatatKERN_AS=	obj
421.137Sdsl.else
431.137SdslKERN_AS=	library
441.137Sdsl.endif
451.62Smycroft
461.119Satatat##
471.119Satatat## (4) local objects, compile rules, and dependencies
481.119Satatat##
491.129SchristosMD_OBJS=	locore.o spl.o vector.o microtime.o
501.119SatatatMD_CFILES=
511.131SyamtMD_SFILES=	${I386}/i386/locore.S ${I386}/i386/spl.S \
521.131Syamt		${I386}/i386/vector.S ${I386}/i386/microtime.S
531.1Scgd
541.125Sfvdllocore.o: ${I386}/i386/locore.S assym.h
551.125Sfvdl	${NORMAL_S}
561.125Sfvdl
571.125Sfvdlspl.o: ${I386}/i386/spl.S assym.h
581.125Sfvdl	${NORMAL_S}
591.125Sfvdl
601.125Sfvdlvector.o: ${I386}/i386/vector.S assym.h
611.129Schristos	${NORMAL_S}
621.129Schristos
631.129Schristosmicrotime.o: ${I386}/i386/microtime.S assym.h
641.119Satatat	${NORMAL_S}
651.116Sthorpej
661.119Satatat##
671.119Satatat## (5) link settings
681.119Satatat##
691.116SthorpejTEXTADDR?=	c0100000
701.122SatatatLINKFLAGS_NORMAL=	-X
711.97Schristos.if (${OBJECT_FMT} == "ELF")
721.111SthorpejKERN_LDSCRIPT?=	kern.ldscript
731.119SatatatLINKFORMAT=	-T ${I386}/conf/${KERN_LDSCRIPT}
741.97Schristos.else
751.119SatatatLINKFORMAT=	-z
761.107Sthorpej.endif
771.107Sthorpej
781.119Satatat##
791.119Satatat## (6) port specific target dependencies
801.119Satatat##
811.98Smrg
821.126Schristosfreebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h
831.126Schristossvr4_sigcode.o mach_sigcode.o: assym.h
841.130Schristosapmcall.o in_cksum.o pnpbioscall.o bioscall.o: assym.h
851.132Ssimonbmptramp.o: assym.h
861.128Schristosclock.o: config_time.h
871.119Satatat
881.119Satatat##
891.119Satatat## (7) misc settings
901.119Satatat##
911.119Satatat
921.119Satatat##
931.119Satatat## (8) config(8) generated machinery
941.119Satatat##
951.98Smrg%INCLUDES
961.74Smycroft
971.1Scgd%OBJS
981.1Scgd
991.1Scgd%CFILES
1001.1Scgd
1011.62Smycroft%SFILES
1021.62Smycroft
1031.1Scgd%LOAD
1041.50Smycroft
1051.119Satatat%RULES
1061.1Scgd
1071.133Sjmc# XXX - Ugly, but make doesn't easily handle .o.uue (assumes it's a suffix)
1081.133Sjmc# XXX - Also, config has no simple was to just add foo.o to the Makefile. 
1091.133Sjmc#       It needs a pathname of some sort for "object"        
1101.139Sdyoung.if !empty(OBJS:M\/athhal-i386-elf.hal.o)
1111.139SdyoungOBJS:=${OBJS:C/\/athhal-i386-elf.hal.o/athhal-i386-elf.hal.o/}
1121.133Sjmc 
1131.139Sdyoung.PATH: $S/contrib/arch/i386/dev
1141.136SatatatATH_UUDEC?=	@${_MKSHMSG} "uudecode ${.CURDIR:T}/${.TARGET}"; \
1151.136Satatat		${_MKSHECHO}\
1161.136Satatat		${UUDECODE} -p $> \> ${.TARGET}; \
1171.136Satatat		rm -f ${.TARGET}; \
1181.136Satatat		${UUDECODE} -p $> > ${.TARGET}
1191.139Sdyoungathhal-i386-elf.hal.o: athhal-i386-elf.hal.o.uue
1201.136Satatat	${ATH_UUDEC}
1211.139Sdyoungall depend:	opt_ah.h
1221.139Sdyoungopt_ah.h:	athhal-i386-elf.opt_ah.h
1231.139Sdyoung	ln -s ${.ALLSRC} ${.TARGET}
1241.133Sjmc.endif
1251.133Sjmc
1261.119Satatat##
1271.119Satatat## (9) port independent kernel machinery
1281.119Satatat##
1291.119Satatat.include "$S/conf/Makefile.kern.inc"
1301.135Sthorpej
1311.135Sthorpej##
1321.135Sthorpej## (10) Appending make options.
1331.135Sthorpej##
1341.135Sthorpej%MAKEOPTIONSAPPEND
135