Makefile.powerpc revision 1.51
11.51Schristos# $NetBSD: Makefile.powerpc,v 1.51 2013/03/10 07:18:20 christos 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.46SmattGENASSYM_CONF= ${POWERPC}/powerpc/genassym.cf 311.46SmattGENASSYM_CONF+= ${POWERPC}/${PPCDIR}/genassym.cf 321.22Smatt.if exists(${THISPPC}/${MACHINE}/genassym.cf) 331.46SmattGENASSYM_CONF+= ${THISPPC}/${MACHINE}/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.50Smatt.if ${PPCDIR} == "booke" 471.50SmattDEFCOPTS= -O2 481.50SmattCFLAGS+= -fstack-protector 491.50SmattCFLAGS+= -mmultiple -misel 501.50Smatt.endif 511.45SmattCFLAGS+= -msdata=none 521.44SmattCFLAGS+= -msoft-float ${CCPUOPTS} 531.44SmattAFLAGS+= ${AOPTS} -D_NOREGNAMES 541.20Satatat 551.20Satatat## 561.20Satatat## (3) libkern and compat 571.20Satatat## 581.43ScubeOPT_MODULAR= %MODULAR% 591.42Sapb.if !empty(OPT_MODULAR) 601.26SmattKERN_AS= obj 611.51Schristos.else 621.51SchristosKERN_AS= library 631.27Smatt.endif 641.20Satatat 651.20Satatat## 661.20Satatat## (4) local objects, compile rules, and dependencies 671.20Satatat## 681.24Sscw.if !defined(SYSTEM_FIRST_OBJ) 691.24SscwSYSTEM_FIRST_OBJ= locore.o 701.24Sscw.endif 711.24Sscw.if !defined(SYSTEM_FIRST_SFILE) 721.24SscwSYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S 731.24Sscw.endif 741.24SscwMD_OBJS= ${SYSTEM_FIRST_OBJ} 751.20SatatatMD_CFILES= 761.24SscwMD_SFILES= ${SYSTEM_FIRST_SFILE} 771.15Ssimonb 781.24Sscw${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h 791.20Satatat ${NORMAL_S} 801.1Sws 811.20Satatat## 821.20Satatat## (5) link settings 831.20Satatat## 841.44SmattKERNLDSCRIPT?= ${POWERPC}/conf/kern.ldscript 851.20SatatatTEXTADDR?= 0x100000 861.44SmattLINKFORMAT= -N -T ${KERNLDSCRIPT} 871.44Smatt 881.20SatatatENTRYPOINT= __start 891.14Smatt 901.47Smatt.if defined(NEED_MDSETIMAGE) && $(NEED_MDSETIMAGE) != "no" \ 911.47Smatt && defined(RAMDISKDIR) && exists(${RAMDISKDIR}/ramdisk.fs) 921.25SaugustssSYSTEM_LD_TAIL_EXTRA+=; \ 931.47Smatt echo ${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/ramdisk.fs; \ 941.47Smatt ${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/ramdisk.fs 951.23Saugustss.endif 961.23Saugustss 971.47Smatt.if defined(NEED_SREC) && ${NEED_SREC} != "no" 981.25SaugustssSYSTEM_LD_TAIL_EXTRA+=; \ 991.47Smatt echo ${OBJCOPY} -O srec $@ $@.srec; \ 1001.47Smatt ${OBJCOPY} -O srec $@ $@.srec 1011.47Smatt.endif 1021.47Smatt 1031.47Smatt.if defined(NEED_BINARY) && ${NEED_BINARY} != "no" 1041.47SmattSYSTEM_LD_TAIL_EXTRA+=; \ 1051.47Smatt echo ${OBJCOPY} -S -O binary $@ $@.bin; \ 1061.47Smatt ${OBJCOPY} -S -O binary $@ $@.bin 1071.47Smatt 1081.47SmattEXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin@} 1091.47Smatt 1101.47Smatt.if defined(NEED_UBOOTIMAGE) && ${NEED_UBOOTIMAGE} != "no" 1111.47Smatt_OSRELEASE!= ${HOST_SH} $S/conf/osrelease.sh 1121.47SmattMKUBOOTIMAGEARGS= -A powerpc -T kernel -C gz 1131.47SmattMKUBOOTIMAGEARGS+= -a ${TEXTADDR:C/....$/0000/} -e $(TEXTADDR) 1141.47SmattMKUBOOTIMAGEARGS+= -n "NetBSD/$(MACHINE) ${_OSRELEASE} ($(KERNEL_BUILD:T))" 1151.47Smatt 1161.47SmattSYSTEM_LD_TAIL_EXTRA+=; \ 1171.47Smatt echo ${TOOL_GZIP} -9cn $@.bin '>' $@.bin.gz; \ 1181.47Smatt ${TOOL_GZIP} -9cn $@.bin > $@.bin.gz; \ 1191.47Smatt echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} $@.bin.gz $@.ub; \ 1201.47Smatt ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} $@.bin.gz $@.ub 1211.47Smatt 1221.47SmattEXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin.gz@} 1231.47SmattEXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.ub@} 1241.47Smatt.endif 1251.1Sws.endif 1261.1Sws 1271.49Smatt.if !empty(SYSTEM_LD_TAIL_EXTRA_EXTRA) 1281.49SmattSYSTEM_LD_TAIL_EXTRA+= ${SYSTEM_LD_TAIL_EXTRA_EXTRA} 1291.49Smatt.endif 1301.49Smatt 1311.20Satatat## 1321.20Satatat## (6) port specific target dependencies 1331.20Satatat## 1341.1Sws 1351.20Satatat# depend on CPU configuration 1361.20Satatatlocore.o machdep.o: Makefile 1371.28Ssimonb 1381.40Sphxlock_stubs.o setfault.o: assym.h 1391.1Sws 1401.20Satatat## 1411.20Satatat## (7) misc settings 1421.20Satatat## 1431.20Satatat 1441.20Satatat## 1451.20Satatat## (8) config(8) generated machinery 1461.20Satatat## 1471.20Satatat%INCLUDES 1481.1Sws 1491.1Sws%OBJS 1501.1Sws 1511.1Sws%CFILES 1521.1Sws 1531.1Sws%SFILES 1541.1Sws 1551.1Sws%LOAD 1561.1Sws 1571.20Satatat%RULES 1581.1Sws 1591.20Satatat## 1601.20Satatat## (9) port independent kernel machinery 1611.20Satatat## 1621.20Satatat.include "$S/conf/Makefile.kern.inc" 1631.39Smatt${KERNLIB} ${KERNLIB_PROF} ${KERNLIBLN}: assym.h 1641.30Sthorpej 1651.30Sthorpej## 1661.30Sthorpej## (10) Appending make options. 1671.30Sthorpej## 1681.30Sthorpej%MAKEOPTIONSAPPEND 169