Makefile.powerpc revision 1.45
11.45Smatt#	$NetBSD: Makefile.powerpc,v 1.45 2011/06/04 17:51:09 matt Exp $
21.1Sws#
31.1Sws# Makefile for NetBSD
41.1Sws#
51.1Sws# This makefile is constructed from a machine description:
61.1Sws#	config machineid
71.1Sws# Most changes should be made in the machine description
81.1Sws#	/sys/arch/powerpc/conf/``machineid''
91.1Sws# after which you should do
101.1Sws#	config machineid
111.1Sws# Machine generic makefile changes should be made in
121.1Sws#	/sys/arch/powerpc/conf/Makefile.powerpc
131.1Sws# after which config should be rerun for all machines of that type.
141.1Sws#
151.20Satatat# To specify debugging, add the config line: makeoptions DEBUG="-g"
161.20Satatat# A better way is to specify -g only for a few files.
171.1Sws#
181.20Satatat#	makeoptions DEBUGLIST="uvm* trap if_*"
191.18Sthorpej
201.18SthorpejMACHINE_ARCH=powerpc
211.19SjmcUSETOOLS?=	no
221.20SatatatNEED_OWN_INSTALL_TARGET?=no
231.16Sthorpej.include <bsd.own.mk>
241.1Sws
251.20Satatat##
261.20Satatat## (1) port identification
271.20Satatat##
281.17SthorpejTHISPPC=	$S/arch/${MACHINE}
291.14SmattPOWERPC=	$S/arch/powerpc
301.22Smatt.if exists(${THISPPC}/${MACHINE}/genassym.cf)
311.33SchristosGENASSYM_CONF=	${THISPPC}/${MACHINE}/genassym.cf
321.22Smatt.else
331.33SchristosGENASSYM_CONF=	${POWERPC}/${PPCDIR}/genassym.cf
341.22Smatt.endif
351.20Satatat.-include "${THISPPC}/conf/Makefile.${MACHINE}.inc"
361.1Sws
371.20Satatat##
381.20Satatat## (2) compile settings
391.20Satatat##
401.29SbriggsCPPFLAGS+=	-D${MACHINE}=${MACHINE}
411.20SatatatCWARNFLAGS+=	-Wreturn-type
421.32Smatt.if ${PPCDIR} == "oea"
431.32SmattCFLAGS+=	-mno-strict-align
441.44SmattCFLAGS+=	-Wa,-maltivec
451.32Smatt.endif
461.45SmattCFLAGS+=	-msdata=none
471.44SmattCFLAGS+=	-msoft-float ${CCPUOPTS}
481.44SmattAFLAGS+=	${AOPTS} -D_NOREGNAMES
491.20Satatat
501.20Satatat##
511.20Satatat## (3) libkern and compat
521.20Satatat##
531.43ScubeOPT_MODULAR=	%MODULAR%
541.42Sapb.if !empty(OPT_MODULAR)
551.26SmattKERN_AS=	obj
561.27Smatt.endif
571.20Satatat
581.20Satatat##
591.20Satatat## (4) local objects, compile rules, and dependencies
601.20Satatat##
611.24Sscw.if !defined(SYSTEM_FIRST_OBJ)
621.24SscwSYSTEM_FIRST_OBJ= locore.o
631.24Sscw.endif
641.24Sscw.if !defined(SYSTEM_FIRST_SFILE)
651.24SscwSYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
661.24Sscw.endif
671.24SscwMD_OBJS=	${SYSTEM_FIRST_OBJ}
681.20SatatatMD_CFILES=
691.24SscwMD_SFILES=	${SYSTEM_FIRST_SFILE}
701.15Ssimonb
711.24Sscw${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
721.20Satatat	${NORMAL_S}
731.1Sws
741.20Satatat##
751.20Satatat## (5) link settings
761.20Satatat##
771.44SmattKERNLDSCRIPT?=	${POWERPC}/conf/kern.ldscript
781.20SatatatTEXTADDR?=	0x100000
791.44SmattLINKFORMAT=	-N -T ${KERNLDSCRIPT}
801.44Smatt
811.20SatatatENTRYPOINT=	__start
821.14Smatt
831.20Satatat.if defined(NEED_SREC)
841.25SaugustssSYSTEM_LD_TAIL_EXTRA+=; \
851.44Smatt		echo ${OBJCOPY} -O srec $@ $@.srec; \
861.44Smatt		${OBJCOPY} -O srec $@ $@.srec
871.23Saugustss.endif
881.23Saugustss
891.23Saugustss.if defined(NEED_BINARY)
901.25SaugustssSYSTEM_LD_TAIL_EXTRA+=; \
911.44Smatt		echo ${OBJCOPY} -O binary $@ $@.bin; \
921.44Smatt		${OBJCOPY} -O binary $@ $@.bin
931.1Sws.endif
941.1Sws
951.20Satatat##
961.20Satatat## (6) port specific target dependencies
971.20Satatat##
981.1Sws
991.20Satatat# depend on CPU configuration
1001.20Satatatlocore.o machdep.o: Makefile
1011.28Ssimonb
1021.40Sphxlock_stubs.o setfault.o: assym.h
1031.1Sws
1041.20Satatat##
1051.20Satatat## (7) misc settings
1061.20Satatat##
1071.20Satatat
1081.20Satatat##
1091.20Satatat## (8) config(8) generated machinery
1101.20Satatat##
1111.20Satatat%INCLUDES
1121.1Sws
1131.1Sws%OBJS
1141.1Sws
1151.1Sws%CFILES
1161.1Sws
1171.1Sws%SFILES
1181.1Sws
1191.1Sws%LOAD
1201.1Sws
1211.20Satatat%RULES
1221.1Sws
1231.20Satatat##
1241.20Satatat## (9) port independent kernel machinery
1251.20Satatat##
1261.20Satatat.include "$S/conf/Makefile.kern.inc"
1271.39Smatt${KERNLIB} ${KERNLIB_PROF} ${KERNLIBLN}: assym.h
1281.30Sthorpej
1291.30Sthorpej##
1301.30Sthorpej## (10) Appending make options.
1311.30Sthorpej##
1321.30Sthorpej%MAKEOPTIONSAPPEND
133