Makefile.powerpc revision 1.31
11.31Smatt#	$NetBSD: Makefile.powerpc,v 1.31 2004/12/09 22:57:12 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.20SatatatGENASSYM=	${THISPPC}/${MACHINE}/genassym.cf
321.22Smatt.else
331.22SmattGENASSYM=	${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.31SmattCFLAGS+=	-msoft-float ${CCPUOPTS} -Wa,-maltivec
431.20SatatatAFLAGS+=	${AOPTS}
441.20Satatat
451.20Satatat##
461.20Satatat## (3) libkern and compat
471.20Satatat##
481.27Smatt.if !empty(IDENT:M-DLKM)
491.26SmattKERN_AS=	obj
501.27Smatt.endif
511.20Satatat
521.20Satatat##
531.20Satatat## (4) local objects, compile rules, and dependencies
541.20Satatat##
551.24Sscw.if !defined(SYSTEM_FIRST_OBJ)
561.24SscwSYSTEM_FIRST_OBJ= locore.o
571.24Sscw.endif
581.24Sscw.if !defined(SYSTEM_FIRST_SFILE)
591.24SscwSYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
601.24Sscw.endif
611.24SscwMD_OBJS=	${SYSTEM_FIRST_OBJ}
621.20SatatatMD_CFILES=
631.24SscwMD_SFILES=	${SYSTEM_FIRST_SFILE}
641.15Ssimonb
651.24Sscw${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
661.20Satatat	${NORMAL_S}
671.1Sws
681.20Satatat##
691.20Satatat## (5) link settings
701.20Satatat##
711.20SatatatTEXTADDR?=	0x100000
721.20SatatatLINKFORMAT=	-N
731.20SatatatENTRYPOINT=	__start
741.14Smatt
751.25Saugustss.if defined(NEED_SYMTAB)
761.25SaugustssSYSTEM_LD_TAIL_EXTRA=; \
771.25Saugustss		echo ${DBSYM} $@; \
781.25Saugustss		${DBSYM} $@
791.25Saugustss.endif
801.25Saugustss
811.20Satatat.if defined(NEED_SREC)
821.25SaugustssSYSTEM_LD_TAIL_EXTRA+=; \
831.20Satatat		${OBJCOPY} -v -O srec $@ $@.srec
841.23Saugustss.endif
851.23Saugustss
861.23Saugustss.if defined(NEED_BINARY)
871.25SaugustssSYSTEM_LD_TAIL_EXTRA+=; \
881.23Saugustss		${OBJCOPY} -v -O binary $@ $@.bin
891.1Sws.endif
901.1Sws
911.20Satatat##
921.20Satatat## (6) port specific target dependencies
931.20Satatat##
941.1Sws
951.20Satatat# depend on CPU configuration
961.20Satatatlocore.o machdep.o: Makefile
971.28Ssimonb
981.28Ssimonbsetfault.o: assym.h
991.1Sws
1001.20Satatat##
1011.20Satatat## (7) misc settings
1021.20Satatat##
1031.20Satatat
1041.20Satatat##
1051.20Satatat## (8) config(8) generated machinery
1061.20Satatat##
1071.20Satatat%INCLUDES
1081.1Sws
1091.1Sws%OBJS
1101.1Sws
1111.1Sws%CFILES
1121.1Sws
1131.1Sws%SFILES
1141.1Sws
1151.1Sws%LOAD
1161.1Sws
1171.20Satatat%RULES
1181.1Sws
1191.20Satatat##
1201.20Satatat## (9) port independent kernel machinery
1211.20Satatat##
1221.20Satatat.include "$S/conf/Makefile.kern.inc"
1231.30Sthorpej
1241.30Sthorpej##
1251.30Sthorpej## (10) Appending make options.
1261.30Sthorpej##
1271.30Sthorpej%MAKEOPTIONSAPPEND
128