Home | History | Annotate | Line # | Download | only in conf
Makefile.mips revision 1.48
      1 #	$NetBSD: Makefile.mips,v 1.48 2008/01/03 20:02:22 joerg 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/<machine>/conf/``machineid''
      9 # after which you should do
     10 #	config machineid
     11 # Machine generic makefile changes should be made in
     12 #	/sys/arch/mips/conf/Makefile.mips
     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 USETOOLS?=	no
     21 NEED_OWN_INSTALL_TARGET?=no
     22 .include <bsd.own.mk>
     23 
     24 ##
     25 ## (0) toolchain settings for things that aren't part of the standard
     26 ## toolchain
     27 ##
     28 ELF2ECOFF?=	elf2ecoff
     29 
     30 ##
     31 ## (1) port identification
     32 ##
     33 .ifndef S
     34 S=		../../../..
     35 .endif
     36 THISMIPS=	$S/arch/${MACHINE}
     37 MIPS=		$S/arch/mips
     38 GENASSYM_CONF=	${MIPS}/mips/genassym.cf
     39 .-include "${THISMIPS}/conf/Makefile.${MACHINE}.inc"
     40 
     41 ##
     42 ## (2) compile settings
     43 ##
     44 ## Note: -ffixed-?? must be kept in sync with cpu.h.
     45 ##
     46 CPPFLAGS+=	-D${MACHINE}
     47 DEFGP?=		-G 0
     48 GP?=		${DEFGP}
     49 CFLAGS+=	${GP} -mno-abicalls -msoft-float -ffixed-23
     50 .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
     51 CFLAGS+=	-msym32
     52 .endif
     53 AFLAGS+=	-mno-abicalls -x assembler-with-cpp -traditional-cpp ${AOPTS}
     54 
     55 ##
     56 ## (3) libkern and compat
     57 ##
     58 .if !empty(IDENT:M-DLKM)
     59 KERN_AS=	obj
     60 .endif
     61 
     62 ##
     63 ## (4) local objects, compile rules, and dependencies
     64 ##
     65 MD_OBJS=	locore.o locore_machdep.o
     66 MD_CFILES=
     67 MD_SFILES=	${MIPS}/mips/locore.S ${THISMIPS}/${MACHINE}/locore_machdep.S	
     68 
     69 locore.o: ${MIPS}/mips/locore.S assym.h
     70 	${NORMAL_S}
     71 
     72 locore_machdep.o: ${THISMIPS}/${MACHINE}/locore_machdep.S assym.h
     73 	${NORMAL_S}
     74 
     75 ##
     76 ## (5) link settings
     77 ##
     78 .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
     79 TEXTADDR?=              ${DEFTEXTADDR:C/0x8/0xFFFFFFFF8/}
     80 .else   
     81 TEXTADDR?=		${DEFTEXTADDR}
     82 .endif
     83 KERNLDSCRIPT?=		${MIPS}/conf/kern.ldscript
     84 # some mips ports specify a "magic" format
     85 LINKFORMAT+=		-T ${KERNLDSCRIPT}
     86 EXTRA_LINKFLAGS=	${GP} ${LDOPTS}
     87 LINKFLAGS_NORMAL=	-X
     88 STRIPFLAGS=		-g -X
     89 
     90 ##
     91 ## (6) port specific target dependencies
     92 ##
     93 
     94 # depend on CPU configuration
     95 machdep.o mainbus.o trap.o: Makefile
     96 
     97 # depend on System V IPC/shmem options
     98 mips_machdep.o pmap.o: Makefile
     99 
    100 # various assembly files that depend on assym.h
    101 copy.o fp.o locore.o locore_mips1.o locore_mips3.o: assym.h
    102 lock_stubs.o mips32_subr.o mips3_subr.o mips5900_subr.o: assym.h
    103 mips64_subr.o mipsX_subr.o sigcode.o: assym.h
    104 
    105 
    106 ##
    107 ## (7) misc settings
    108 ##
    109 
    110 ##
    111 ## (8) config(8) generated machinery
    112 ##
    113 %INCLUDES
    114 
    115 %OBJS
    116 
    117 %CFILES
    118 
    119 %SFILES
    120 
    121 %LOAD
    122 
    123 %RULES
    124 
    125 ## Include rules for Atheros WLAN
    126 .include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"
    127 
    128 ##
    129 ## (9) port independent kernel machinery
    130 ##
    131 .include "$S/conf/Makefile.kern.inc"
    132 
    133 ##
    134 ## (10) Appending make options.
    135 ##
    136 %MAKEOPTIONSAPPEND
    137