Home | History | Annotate | Line # | Download | only in conf
Makefile.powerpc revision 1.43.4.1
      1 #	$NetBSD: Makefile.powerpc,v 1.43.4.1 2011/03/05 20:51:35 rmind Exp $
      2 #
      3 # Makefile for NetBSD
      4 #
      5 # This makefile is constructed from a machine description:
      6 #	config machineid
      7 # Most changes should be made in the machine description
      8 #	/sys/arch/powerpc/conf/``machineid''
      9 # after which you should do
     10 #	config machineid
     11 # Machine generic makefile changes should be made in
     12 #	/sys/arch/powerpc/conf/Makefile.powerpc
     13 # after which config should be rerun for all machines of that type.
     14 #
     15 # To specify debugging, add the config line: makeoptions DEBUG="-g"
     16 # A better way is to specify -g only for a few files.
     17 #
     18 #	makeoptions DEBUGLIST="uvm* trap if_*"
     19 
     20 MACHINE_ARCH=powerpc
     21 USETOOLS?=	no
     22 NEED_OWN_INSTALL_TARGET?=no
     23 .include <bsd.own.mk>
     24 
     25 ##
     26 ## (1) port identification
     27 ##
     28 THISPPC=	$S/arch/${MACHINE}
     29 POWERPC=	$S/arch/powerpc
     30 .if exists(${THISPPC}/${MACHINE}/genassym.cf)
     31 GENASSYM_CONF=	${THISPPC}/${MACHINE}/genassym.cf
     32 .else
     33 GENASSYM_CONF=	${POWERPC}/${PPCDIR}/genassym.cf
     34 .endif
     35 .-include "${THISPPC}/conf/Makefile.${MACHINE}.inc"
     36 
     37 ##
     38 ## (2) compile settings
     39 ##
     40 CPPFLAGS+=	-D${MACHINE}=${MACHINE}
     41 CWARNFLAGS+=	-Wreturn-type
     42 .if ${PPCDIR} == "oea"
     43 CFLAGS+=	-mno-strict-align
     44 CFLAGS+=	-Wa,-maltivec
     45 .endif
     46 CFLAGS+=	-msoft-float ${CCPUOPTS}
     47 AFLAGS+=	${AOPTS} -D_NOREGNAMES
     48 
     49 ##
     50 ## (3) libkern and compat
     51 ##
     52 OPT_MODULAR=	%MODULAR%
     53 .if !empty(OPT_MODULAR)
     54 KERN_AS=	obj
     55 .endif
     56 
     57 ##
     58 ## (4) local objects, compile rules, and dependencies
     59 ##
     60 .if !defined(SYSTEM_FIRST_OBJ)
     61 SYSTEM_FIRST_OBJ= locore.o
     62 .endif
     63 .if !defined(SYSTEM_FIRST_SFILE)
     64 SYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
     65 .endif
     66 MD_OBJS=	${SYSTEM_FIRST_OBJ}
     67 MD_CFILES=
     68 MD_SFILES=	${SYSTEM_FIRST_SFILE}
     69 
     70 ${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
     71 	${NORMAL_S}
     72 
     73 ##
     74 ## (5) link settings
     75 ##
     76 KERNLDSCRIPT?=	${POWERPC}/conf/kern.ldscript
     77 TEXTADDR?=	0x100000
     78 LINKFORMAT=	-N -T ${KERNLDSCRIPT}
     79 
     80 ENTRYPOINT=	__start
     81 
     82 .if defined(NEED_SREC)
     83 SYSTEM_LD_TAIL_EXTRA+=; \
     84 		echo ${OBJCOPY} -O srec $@ $@.srec; \
     85 		${OBJCOPY} -O srec $@ $@.srec
     86 .endif
     87 
     88 .if defined(NEED_BINARY)
     89 SYSTEM_LD_TAIL_EXTRA+=; \
     90 		echo ${OBJCOPY} -O binary $@ $@.bin; \
     91 		${OBJCOPY} -O binary $@ $@.bin
     92 .endif
     93 
     94 ##
     95 ## (6) port specific target dependencies
     96 ##
     97 
     98 # depend on CPU configuration
     99 locore.o machdep.o: Makefile
    100 
    101 lock_stubs.o setfault.o: assym.h
    102 
    103 ##
    104 ## (7) misc settings
    105 ##
    106 
    107 ##
    108 ## (8) config(8) generated machinery
    109 ##
    110 %INCLUDES
    111 
    112 %OBJS
    113 
    114 %CFILES
    115 
    116 %SFILES
    117 
    118 %LOAD
    119 
    120 %RULES
    121 
    122 ##
    123 ## (9) port independent kernel machinery
    124 ##
    125 .include "$S/conf/Makefile.kern.inc"
    126 ${KERNLIB} ${KERNLIB_PROF} ${KERNLIBLN}: assym.h
    127 
    128 ##
    129 ## (10) Appending make options.
    130 ##
    131 %MAKEOPTIONSAPPEND
    132