1 # $NetBSD: Makefile.mips,v 1.44 2006/08/27 21:44:15 matt 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 CPPFLAGS+= -D${MACHINE} 45 DEFGP?= -G 0 46 GP?= ${DEFGP} 47 CFLAGS+= ${GP} -mno-abicalls -msoft-float 48 .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" 49 CFLAGS+= -msym32 50 .endif 51 AFLAGS+= -mno-abicalls -x assembler-with-cpp -traditional-cpp ${AOPTS} 52 53 ## 54 ## (3) libkern and compat 55 ## 56 .if !empty(IDENT:M-DLKM) 57 KERN_AS= obj 58 .endif 59 60 ## 61 ## (4) local objects, compile rules, and dependencies 62 ## 63 MD_OBJS= locore.o locore_machdep.o 64 MD_CFILES= 65 MD_SFILES= ${MIPS}/mips/locore.S ${THISMIPS}/${MACHINE}/locore_machdep.S 66 67 locore.o: ${MIPS}/mips/locore.S assym.h 68 ${NORMAL_S} 69 70 locore_machdep.o: ${THISMIPS}/${MACHINE}/locore_machdep.S assym.h 71 ${NORMAL_S} 72 73 ## 74 ## (5) link settings 75 ## 76 .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" 77 TEXTADDR?= ${DEFTEXTADDR:C/0x8/0xFFFFFFFF8/} 78 .else 79 TEXTADDR?= ${DEFTEXTADDR} 80 .endif 81 KERNLDSCRIPT?= ${MIPS}/conf/kern.ldscript 82 # some mips ports specify a "magic" format 83 LINKFORMAT+= -T ${KERNLDSCRIPT} 84 EXTRA_LINKFLAGS= ${GP} ${LDOPTS} 85 LINKFLAGS_NORMAL= -x 86 STRIPFLAGS= -g -X -x 87 88 ## 89 ## (6) port specific target dependencies 90 ## 91 92 # depend on CPU configuration 93 machdep.o mainbus.o trap.o: Makefile 94 95 # depend on System V IPC/shmem options 96 mips_machdep.o pmap.o: Makefile 97 98 # various assembly files that depend on assym.h 99 copy.o fp.o locore.o locore_mips1.o locore_mips3.o sigcode.o: assym.h 100 mips32_subr.o mips3_subr.o mips5900_subr.o mips64_subr.o mipsX_subr.o: assym.h 101 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 ## Include rules for Atheros WLAN 123 .include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc" 124 125 ## 126 ## (9) port independent kernel machinery 127 ## 128 .include "$S/conf/Makefile.kern.inc" 129 130 ## 131 ## (10) Appending make options. 132 ## 133 %MAKEOPTIONSAPPEND 134