Makefile.mips revision 1.40
1#	$NetBSD: Makefile.mips,v 1.40 2005/11/11 06:22:04 simonb 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
20USETOOLS?=	no
21NEED_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##
28ELF2ECOFF?=	elf2ecoff
29
30##
31## (1) port identification
32##
33.ifndef S
34S=		../../../..
35.endif
36THISMIPS=	$S/arch/${MACHINE}
37MIPS=		$S/arch/mips
38GENASSYM_CONF=	${MIPS}/mips/genassym.cf
39.-include "${THISMIPS}/conf/Makefile.${MACHINE}.inc"
40
41##
42## (2) compile settings
43##
44CPPFLAGS+=	-D${MACHINE}
45DEFGP?=		-G 0
46GP?=		${DEFGP}
47CFLAGS+=	${GP} -mno-abicalls -msoft-float
48AFLAGS+=	-mno-abicalls -x assembler-with-cpp -traditional-cpp ${AOPTS}
49
50LP64?=no
51.if ${LP64} == "yes"
52# 64-bit kernels
53CPPFLAGS+=	-D_LP64 -mabi=64
54AFLAGS+=	-mabi=64
55RANLIB=		true
56LD+=		-m elf64bmip
57.endif
58
59##
60## (3) libkern and compat
61##
62.if !empty(IDENT:M-DLKM)
63KERN_AS=	obj
64.endif
65
66##
67## (4) local objects, compile rules, and dependencies
68##
69MD_OBJS=	locore.o locore_machdep.o
70MD_CFILES=
71MD_SFILES=	${MIPS}/mips/locore.S ${THISMIPS}/${MACHINE}/locore_machdep.S	
72
73locore.o: ${MIPS}/mips/locore.S assym.h
74	${NORMAL_S}
75
76locore_machdep.o: ${THISMIPS}/${MACHINE}/locore_machdep.S assym.h
77	${NORMAL_S}
78
79##
80## (5) link settings
81##
82TEXTADDR?=		${DEFTEXTADDR}
83KERNLDSCRIPT?=		${MIPS}/conf/kern.ldscript
84# some mips ports specify a "magic" format
85LINKFORMAT+=		-T ${KERNLDSCRIPT}
86EXTRA_LINKFLAGS=	${GP} ${LDOPTS}
87LINKFLAGS_NORMAL=	-x
88STRIPFLAGS=		-g -X -x
89
90##
91## (6) port specific target dependencies
92##
93
94# depend on CPU configuration
95machdep.o mainbus.o trap.o: Makefile
96
97# depend on System V IPC/shmem options
98mips_machdep.o pmap.o: Makefile
99
100# various assembly files that depend on assym.h
101copy.o fp.o locore.o locore_mips1.o locore_mips3.o sigcode.o: assym.h
102mips32_subr.o mips3_subr.o mips5900_subr.o mips64_subr.o mipsX_subr.o: assym.h
103
104
105##
106## (7) misc settings
107##
108
109##
110## (8) config(8) generated machinery
111##
112%INCLUDES
113
114%OBJS
115
116%CFILES
117
118%SFILES
119
120%LOAD
121
122%RULES
123
124##
125## (9) port independent kernel machinery
126##
127.include "$S/conf/Makefile.kern.inc"
128
129##
130## (10) Appending make options.
131##
132%MAKEOPTIONSAPPEND
133