1 1.25 atatat # $NetBSD: Makefile.mips,v 1.25 2001/12/09 05:00:46 atatat 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.22 thorpej 24 1.8 matt AR?= ${CROSSDIR}ar 25 1.8 matt AS?= ${CROSSDIR}as 26 1.8 matt CC?= ${CROSSDIR}cc 27 1.8 matt LD?= ${CROSSDIR}ld 28 1.8 matt NM?= ${CROSSDIR}nm 29 1.8 matt RANLIB?= ${CROSSDIR}ranlib 30 1.8 matt SIZE?= ${CROSSDIR}size 31 1.8 matt STRIP?= ${CROSSDIR}strip 32 1.8 matt TSORT?= ${CROSSDIR}tsort -q 33 1.12 tsutsui OBJCOPY?= ${CROSSDIR}objcopy 34 1.1 matt 35 1.25 atatat ## 36 1.25 atatat ## (1) port identification 37 1.25 atatat ## 38 1.25 atatat .if ${MACHINE_ARCH} == "mipsel" 39 1.25 atatat ENDIAN=-EL 40 1.25 atatat .elif ${MACHINE_ARCH} == "mipseb" 41 1.25 atatat ENDIAN=-EB 42 1.25 atatat .else 43 1.25 atatat .BEGIN: 44 1.25 atatat @echo "MACHINE_ARCH ${MACHINE_ARCH} is invalid" 45 1.25 atatat @false 46 1.25 atatat .endif 47 1.1 matt .ifndef S 48 1.25 atatat S= ../../../.. 49 1.1 matt .endif 50 1.21 thorpej THISMIPS= $S/arch/${MACHINE} 51 1.1 matt MIPS= $S/arch/mips 52 1.25 atatat GENASSYM= ${MIPS}/mips/genassym.cf 53 1.25 atatat .-include "${THISMIPS}/conf/Makefile.${MACHINE}.inc" 54 1.1 matt 55 1.25 atatat ## 56 1.25 atatat ## (2) compile settings 57 1.25 atatat ## 58 1.25 atatat CPPFLAGS+= -D${MACHINE} 59 1.25 atatat DEFGP?= -G 0 60 1.8 matt GP?= ${DEFGP} 61 1.25 atatat CFLAGS+= ${ENDIAN} ${GP} -mno-abicalls -mno-half-pic 62 1.25 atatat AFLAGS+= ${ENDIAN} -x assembler-with-cpp -traditional-cpp 63 1.1 matt 64 1.25 atatat ## 65 1.25 atatat ## (3) libkern and compat 66 1.25 atatat ## 67 1.25 atatat 68 1.25 atatat ## 69 1.25 atatat ## (4) local objects, compile rules, and dependencies 70 1.25 atatat ## 71 1.25 atatat MD_OBJS= locore.o locore_machdep.o 72 1.25 atatat MD_CFILES= 73 1.25 atatat MD_SFILES= ${MIPS}/mips/locore.S ${THISMIPS}/${MACHINE}/locore_machdep.S 74 1.1 matt 75 1.25 atatat locore.o: ${MIPS}/mips/locore.S assym.h 76 1.25 atatat ${NORMAL_S} 77 1.1 matt 78 1.25 atatat locore_machdep.o: ${THISMIPS}/${MACHINE}/locore_machdep.S assym.h 79 1.25 atatat ${NORMAL_S} 80 1.1 matt 81 1.25 atatat .if !empty(IDENT:M-DMIPS1) 82 1.25 atatat MD_OBJS+= locore_mips1.o 83 1.25 atatat MD_SFILES+= ${MIPS}/mips/locore_mips1.S 84 1.25 atatat locore_mips1.o: ${MIPS}/mips/locore_mips1.S assym.h 85 1.25 atatat ${NORMAL_S} 86 1.1 matt .endif 87 1.1 matt 88 1.1 matt .if !empty(IDENT:M-DMIPS3) 89 1.25 atatat MD_OBJS+= locore_mips3.o 90 1.25 atatat MD_SFILES+= ${MIPS}/mips/locore_mips3.S 91 1.25 atatat locore_mips3.o: ${MIPS}/mips/locore_mips3.S assym.h 92 1.25 atatat ${NORMAL_S} 93 1.1 matt .endif 94 1.25 atatat 95 1.20 uch .if !empty(IDENT:M-DMIPS3_5900) 96 1.25 atatat MD_OBJS+= locore_r5900.o 97 1.25 atatat MD_SFILES+= ${MIPS}/mips/r5900/locore_r5900.S 98 1.25 atatat locore_r5900.o: ${MIPS}/mips/r5900/locore_r5900.S assym.h 99 1.25 atatat ${NORMAL_S} 100 1.2 matt 101 1.25 atatat MD_OBJS+= r5900_machdep.o 102 1.25 atatat MD_CFILES+= ${MIPS}/mips/r5900/r5900_machdep.c 103 1.25 atatat r5900_machdep.o: ${MIPS}/mips/r5900/r5900_machdep.c 104 1.25 atatat ${NORMAL_C} 105 1.1 matt .endif 106 1.1 matt 107 1.6 matt .if empty(IDENT:M-DNOFPU) 108 1.25 atatat MD_OBJS+= fp.o 109 1.25 atatat MD_SFILES+= ${MIPS}/mips/fp.S 110 1.25 atatat fp.o: ${MIPS}/mips/fp.S assym.h 111 1.25 atatat ${NORMAL_S} 112 1.4 matt .endif 113 1.1 matt 114 1.25 atatat ## 115 1.25 atatat ## (5) link settings 116 1.25 atatat ## 117 1.25 atatat TEXTADDR?= ${DEFTEXTADDR} 118 1.25 atatat KERNLDSCRIPT?= ${MIPS}/conf/kern.ldscript 119 1.25 atatat # some mips ports specify a "magic" format 120 1.25 atatat LINKFORMAT+= -T ${KERNLDSCRIPT} 121 1.25 atatat EXTRA_LINKFLAGS= ${ENDIAN} ${GP} 122 1.25 atatat .if (${ENDIAN} == "-EB") 123 1.25 atatat EXTRA_LINKFLAGS+= --oformat elf32-bigmips 124 1.25 atatat .else 125 1.25 atatat EXTRA_LINKFLAGS+= --oformat elf32-littlemips 126 1.25 atatat .endif 127 1.25 atatat LINKFLAGS_NORMAL= -x 128 1.25 atatat STRIPFLAGS= -g -X -x 129 1.1 matt 130 1.25 atatat ## 131 1.25 atatat ## (6) port specific target dependencies 132 1.25 atatat ## 133 1.1 matt 134 1.1 matt # depend on CPU configuration 135 1.1 matt machdep.o mainbus.o trap.o: Makefile 136 1.1 matt 137 1.1 matt # depend on System V IPC/shmem options 138 1.1 matt mips_machdep.o pmap.o: Makefile 139 1.1 matt 140 1.25 atatat ## 141 1.25 atatat ## (7) misc settings 142 1.25 atatat ## 143 1.25 atatat 144 1.25 atatat ## 145 1.25 atatat ## (8) config(8) generated machinery 146 1.25 atatat ## 147 1.25 atatat %INCLUDES 148 1.1 matt 149 1.25 atatat %OBJS 150 1.1 matt 151 1.25 atatat %CFILES 152 1.20 uch 153 1.25 atatat %SFILES 154 1.20 uch 155 1.25 atatat %LOAD 156 1.1 matt 157 1.25 atatat %RULES 158 1.1 matt 159 1.25 atatat ## 160 1.25 atatat ## (9) port independent kernel machinery 161 1.25 atatat ## 162 1.25 atatat .include "$S/conf/Makefile.kern.inc" 163