Makefile.powerpc revision 1.34
1#	$NetBSD: Makefile.powerpc,v 1.34 2005/06/02 10:22:20 he 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/powerpc/conf/``machineid''
9# after which you should do
10#	config machineid
11# Machine generic makefile changes should be made in
12#	/sys/arch/powerpc/conf/Makefile.powerpc
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
20MACHINE_ARCH=powerpc
21USETOOLS?=	no
22NEED_OWN_INSTALL_TARGET?=no
23.include <bsd.own.mk>
24
25##
26## (1) port identification
27##
28THISPPC=	$S/arch/${MACHINE}
29POWERPC=	$S/arch/powerpc
30.if exists(${THISPPC}/${MACHINE}/genassym.cf)
31GENASSYM_CONF=	${THISPPC}/${MACHINE}/genassym.cf
32.else
33GENASSYM_CONF=	${POWERPC}/${PPCDIR}/genassym.cf
34.endif
35.-include "${THISPPC}/conf/Makefile.${MACHINE}.inc"
36
37##
38## (2) compile settings
39##
40CPPFLAGS+=	-D${MACHINE}=${MACHINE}
41CWARNFLAGS+=	-Wreturn-type
42.if ${PPCDIR} == "oea"
43CFLAGS+=	-mno-strict-align
44.endif
45CFLAGS+=	-msoft-float ${CCPUOPTS} -Wa,-maltivec
46AFLAGS+=	${AOPTS}
47
48CC_NO_CAST_QUAL= CFLAGS="${CFLAGS} -Wno-cast-qual" ${NORMAL_C}
49
50##
51## (3) libkern and compat
52##
53.if !empty(IDENT:M-DLKM)
54KERN_AS=	obj
55.endif
56
57##
58## (4) local objects, compile rules, and dependencies
59##
60.if !defined(SYSTEM_FIRST_OBJ)
61SYSTEM_FIRST_OBJ= locore.o
62.endif
63.if !defined(SYSTEM_FIRST_SFILE)
64SYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
65.endif
66MD_OBJS=	${SYSTEM_FIRST_OBJ}
67MD_CFILES=
68MD_SFILES=	${SYSTEM_FIRST_SFILE}
69
70${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
71	${NORMAL_S}
72
73##
74## (5) link settings
75##
76TEXTADDR?=	0x100000
77LINKFORMAT=	-N
78ENTRYPOINT=	__start
79
80.if defined(NEED_SYMTAB)
81SYSTEM_LD_TAIL_EXTRA=; \
82		echo ${DBSYM} $@; \
83		${DBSYM} $@
84.endif
85
86.if defined(NEED_SREC)
87SYSTEM_LD_TAIL_EXTRA+=; \
88		${OBJCOPY} -v -O srec $@ $@.srec
89.endif
90
91.if defined(NEED_BINARY)
92SYSTEM_LD_TAIL_EXTRA+=; \
93		${OBJCOPY} -v -O binary $@ $@.bin
94.endif
95
96##
97## (6) port specific target dependencies
98##
99
100# depend on CPU configuration
101locore.o machdep.o: Makefile
102
103setfault.o: assym.h
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