Makefile.mips revision 1.35
1#	$NetBSD: Makefile.mips,v 1.35 2004/06/04 04:45:50 thorpej 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=	${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
49
50##
51## (3) libkern and compat
52##
53
54##
55## (4) local objects, compile rules, and dependencies
56##
57MD_OBJS=	locore.o locore_machdep.o
58MD_CFILES=
59MD_SFILES=	${MIPS}/mips/locore.S ${THISMIPS}/${MACHINE}/locore_machdep.S	
60
61locore.o: ${MIPS}/mips/locore.S assym.h
62	${NORMAL_S}
63
64locore_machdep.o: ${THISMIPS}/${MACHINE}/locore_machdep.S assym.h
65	${NORMAL_S}
66
67##
68## (5) link settings
69##
70TEXTADDR?=		${DEFTEXTADDR}
71KERNLDSCRIPT?=		${MIPS}/conf/kern.ldscript
72# some mips ports specify a "magic" format
73LINKFORMAT+=		-T ${KERNLDSCRIPT}
74EXTRA_LINKFLAGS=	${GP}
75LINKFLAGS_NORMAL=	-x
76STRIPFLAGS=		-g -X -x
77
78##
79## (6) port specific target dependencies
80##
81
82# depend on CPU configuration
83machdep.o mainbus.o trap.o: Makefile
84
85# depend on System V IPC/shmem options
86mips_machdep.o pmap.o: Makefile
87
88# various assembly files that depend on assym.h
89copy.o fp.o locore.o locore_mips1.o locore_mips3.o sigcode.o: assym.h
90mips32_subr.o mips3_subr.o mips5900_subr.o mips64_subr.o mipsX_subr.o: assym.h
91
92
93##
94## (7) misc settings
95##
96
97##
98## (8) config(8) generated machinery
99##
100%INCLUDES
101
102%OBJS
103
104%CFILES
105
106%SFILES
107
108%LOAD
109
110%RULES
111
112##
113## (9) port independent kernel machinery
114##
115.include "$S/conf/Makefile.kern.inc"
116
117##
118## (10) Appending make options.
119##
120%MAKEOPTIONSAPPEND
121