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