Home | History | Annotate | Line # | Download | only in conf
Makefile.powerpc revision 1.40.22.2
      1  1.40.22.2      matt #	$NetBSD: Makefile.powerpc,v 1.40.22.2 2011/07/26 03:41:27 matt Exp $
      2        1.1        ws #
      3        1.1        ws # Makefile for NetBSD
      4        1.1        ws #
      5        1.1        ws # This makefile is constructed from a machine description:
      6        1.1        ws #	config machineid
      7        1.1        ws # Most changes should be made in the machine description
      8        1.1        ws #	/sys/arch/powerpc/conf/``machineid''
      9        1.1        ws # after which you should do
     10        1.1        ws #	config machineid
     11        1.1        ws # Machine generic makefile changes should be made in
     12        1.1        ws #	/sys/arch/powerpc/conf/Makefile.powerpc
     13        1.1        ws # after which config should be rerun for all machines of that type.
     14        1.1        ws #
     15       1.20    atatat # To specify debugging, add the config line: makeoptions DEBUG="-g"
     16       1.20    atatat # A better way is to specify -g only for a few files.
     17        1.1        ws #
     18       1.20    atatat #	makeoptions DEBUGLIST="uvm* trap if_*"
     19       1.18   thorpej 
     20       1.18   thorpej MACHINE_ARCH=powerpc
     21       1.19       jmc USETOOLS?=	no
     22       1.20    atatat NEED_OWN_INSTALL_TARGET?=no
     23       1.16   thorpej .include <bsd.own.mk>
     24        1.1        ws 
     25       1.20    atatat ##
     26       1.20    atatat ## (1) port identification
     27       1.20    atatat ##
     28       1.17   thorpej THISPPC=	$S/arch/${MACHINE}
     29       1.14      matt POWERPC=	$S/arch/powerpc
     30       1.22      matt .if exists(${THISPPC}/${MACHINE}/genassym.cf)
     31       1.33  christos GENASSYM_CONF=	${THISPPC}/${MACHINE}/genassym.cf
     32       1.22      matt .else
     33       1.33  christos GENASSYM_CONF=	${POWERPC}/${PPCDIR}/genassym.cf
     34       1.22      matt .endif
     35       1.20    atatat .-include "${THISPPC}/conf/Makefile.${MACHINE}.inc"
     36        1.1        ws 
     37       1.20    atatat ##
     38       1.20    atatat ## (2) compile settings
     39       1.20    atatat ##
     40       1.29    briggs CPPFLAGS+=	-D${MACHINE}=${MACHINE}
     41       1.20    atatat CWARNFLAGS+=	-Wreturn-type
     42       1.32      matt .if ${PPCDIR} == "oea"
     43       1.32      matt CFLAGS+=	-mno-strict-align
     44  1.40.22.1      matt CFLAGS+=	-Wa,-maltivec
     45       1.32      matt .endif
     46  1.40.22.2      matt CFLAGS+=	-msdata=none
     47  1.40.22.1      matt CFLAGS+=	-msoft-float ${CCPUOPTS}
     48       1.20    atatat AFLAGS+=	${AOPTS}
     49       1.20    atatat 
     50       1.20    atatat ##
     51       1.20    atatat ## (3) libkern and compat
     52       1.20    atatat ##
     53  1.40.22.2      matt OPT_MODULAR=	%MODULAR%
     54  1.40.22.2      matt .if !empty(OPT_MODULAR)
     55       1.26      matt KERN_AS=	obj
     56       1.27      matt .endif
     57       1.20    atatat 
     58       1.20    atatat ##
     59       1.20    atatat ## (4) local objects, compile rules, and dependencies
     60       1.20    atatat ##
     61       1.24       scw .if !defined(SYSTEM_FIRST_OBJ)
     62       1.24       scw SYSTEM_FIRST_OBJ= locore.o
     63       1.24       scw .endif
     64       1.24       scw .if !defined(SYSTEM_FIRST_SFILE)
     65       1.24       scw SYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
     66       1.24       scw .endif
     67       1.24       scw MD_OBJS=	${SYSTEM_FIRST_OBJ}
     68       1.20    atatat MD_CFILES=
     69       1.24       scw MD_SFILES=	${SYSTEM_FIRST_SFILE}
     70       1.15    simonb 
     71       1.24       scw ${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
     72       1.20    atatat 	${NORMAL_S}
     73        1.1        ws 
     74       1.20    atatat ##
     75       1.20    atatat ## (5) link settings
     76       1.20    atatat ##
     77  1.40.22.1      matt KERNLDSCRIPT?=	${POWERPC}/conf/kern.ldscript
     78       1.20    atatat TEXTADDR?=	0x100000
     79  1.40.22.1      matt LINKFORMAT=	-N -T ${KERNLDSCRIPT}
     80  1.40.22.1      matt 
     81       1.20    atatat ENTRYPOINT=	__start
     82       1.14      matt 
     83  1.40.22.2      matt .if defined(NEED_MDSETIMAGE) && $(NEED_MDSETIMAGE) != "no" \
     84  1.40.22.2      matt     && defined(RAMDISKDIR) && exists(${RAMDISKDIR}/ramdisk.fs)
     85       1.25  augustss SYSTEM_LD_TAIL_EXTRA+=; \
     86  1.40.22.2      matt 	echo ${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/ramdisk.fs; \
     87  1.40.22.2      matt 	${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/ramdisk.fs
     88       1.23  augustss .endif
     89       1.23  augustss 
     90  1.40.22.2      matt .if defined(NEED_SREC) && ${NEED_SREC} != "no"
     91       1.25  augustss SYSTEM_LD_TAIL_EXTRA+=; \
     92  1.40.22.2      matt 	echo ${OBJCOPY} -O srec $@ $@.srec; \
     93  1.40.22.2      matt 	${OBJCOPY} -O srec $@ $@.srec
     94  1.40.22.2      matt .endif
     95  1.40.22.2      matt 
     96  1.40.22.2      matt .if defined(NEED_BINARY) && ${NEED_BINARY} != "no"
     97  1.40.22.2      matt SYSTEM_LD_TAIL_EXTRA+=; \
     98  1.40.22.2      matt 	echo ${OBJCOPY} -S -O binary $@ $@.bin; \
     99  1.40.22.2      matt 	${OBJCOPY} -S -O binary $@ $@.bin
    100  1.40.22.2      matt 
    101  1.40.22.2      matt EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin@}
    102  1.40.22.2      matt 
    103  1.40.22.2      matt .if defined(NEED_UBOOTIMAGE) && ${NEED_UBOOTIMAGE} != "no"
    104  1.40.22.2      matt _OSRELEASE!=		${HOST_SH} $S/conf/osrelease.sh
    105  1.40.22.2      matt MKUBOOTIMAGEARGS=       -A powerpc -T kernel -C gz
    106  1.40.22.2      matt MKUBOOTIMAGEARGS+=      -a ${TEXTADDR:C/....$/0000/} -e $(TEXTADDR)
    107  1.40.22.2      matt MKUBOOTIMAGEARGS+=      -n "NetBSD/$(MACHINE) ${_OSRELEASE} ($(KERNEL_BUILD:T))"
    108  1.40.22.2      matt TOOL_GZIP?=		gzip
    109  1.40.22.2      matt 
    110  1.40.22.2      matt SYSTEM_LD_TAIL_EXTRA+=; \
    111  1.40.22.2      matt 	echo ${TOOL_GZIP} -9cn $@.bin '>' $@.bin.gz; \
    112  1.40.22.2      matt 	${TOOL_GZIP} -9cn $@.bin > $@.bin.gz; \
    113  1.40.22.2      matt 	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} $@.bin.gz $@.ub; \
    114  1.40.22.2      matt 	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} $@.bin.gz $@.ub
    115  1.40.22.2      matt 
    116  1.40.22.2      matt EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin.gz@}
    117  1.40.22.2      matt EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.ub@}
    118  1.40.22.2      matt .endif
    119        1.1        ws .endif
    120        1.1        ws 
    121       1.20    atatat ##
    122       1.20    atatat ## (6) port specific target dependencies
    123       1.20    atatat ##
    124        1.1        ws 
    125       1.20    atatat # depend on CPU configuration
    126       1.20    atatat locore.o machdep.o: Makefile
    127       1.28    simonb 
    128       1.40       phx lock_stubs.o setfault.o: assym.h
    129        1.1        ws 
    130       1.20    atatat ##
    131       1.20    atatat ## (7) misc settings
    132       1.20    atatat ##
    133       1.20    atatat 
    134       1.20    atatat ##
    135       1.20    atatat ## (8) config(8) generated machinery
    136       1.20    atatat ##
    137       1.20    atatat %INCLUDES
    138        1.1        ws 
    139        1.1        ws %OBJS
    140        1.1        ws 
    141        1.1        ws %CFILES
    142        1.1        ws 
    143        1.1        ws %SFILES
    144        1.1        ws 
    145        1.1        ws %LOAD
    146        1.1        ws 
    147       1.20    atatat %RULES
    148        1.1        ws 
    149       1.20    atatat ##
    150       1.20    atatat ## (9) port independent kernel machinery
    151       1.20    atatat ##
    152       1.20    atatat .include "$S/conf/Makefile.kern.inc"
    153       1.39      matt ${KERNLIB} ${KERNLIB_PROF} ${KERNLIBLN}: assym.h
    154       1.30   thorpej 
    155       1.30   thorpej ##
    156       1.30   thorpej ## (10) Appending make options.
    157       1.30   thorpej ##
    158       1.30   thorpej %MAKEOPTIONSAPPEND
    159