Makefile.powerpc revision 1.39 1 # $NetBSD: Makefile.powerpc,v 1.39 2008/03/03 18:48:26 matt 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
20 MACHINE_ARCH=powerpc
21 USETOOLS?= no
22 NEED_OWN_INSTALL_TARGET?=no
23 .include <bsd.own.mk>
24
25 ##
26 ## (1) port identification
27 ##
28 THISPPC= $S/arch/${MACHINE}
29 POWERPC= $S/arch/powerpc
30 .if exists(${THISPPC}/${MACHINE}/genassym.cf)
31 GENASSYM_CONF= ${THISPPC}/${MACHINE}/genassym.cf
32 .else
33 GENASSYM_CONF= ${POWERPC}/${PPCDIR}/genassym.cf
34 .endif
35 .-include "${THISPPC}/conf/Makefile.${MACHINE}.inc"
36
37 ##
38 ## (2) compile settings
39 ##
40 CPPFLAGS+= -D${MACHINE}=${MACHINE}
41 CWARNFLAGS+= -Wreturn-type
42 .if ${PPCDIR} == "oea"
43 CFLAGS+= -mno-strict-align
44 .endif
45 CFLAGS+= -msoft-float ${CCPUOPTS} -Wa,-maltivec
46 AFLAGS+= ${AOPTS}
47
48 ##
49 ## (3) libkern and compat
50 ##
51 .if !empty(IDENT:M-DLKM)
52 KERN_AS= obj
53 .endif
54
55 ##
56 ## (4) local objects, compile rules, and dependencies
57 ##
58 .if !defined(SYSTEM_FIRST_OBJ)
59 SYSTEM_FIRST_OBJ= locore.o
60 .endif
61 .if !defined(SYSTEM_FIRST_SFILE)
62 SYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
63 .endif
64 MD_OBJS= ${SYSTEM_FIRST_OBJ}
65 MD_CFILES=
66 MD_SFILES= ${SYSTEM_FIRST_SFILE}
67
68 ${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
69 ${NORMAL_S}
70
71 ##
72 ## (5) link settings
73 ##
74 TEXTADDR?= 0x100000
75 LINKFORMAT= -N
76 ENTRYPOINT= __start
77
78 .if defined(NEED_SREC)
79 SYSTEM_LD_TAIL_EXTRA+=; \
80 ${OBJCOPY} -v -O srec $@ $@.srec
81 .endif
82
83 .if defined(NEED_BINARY)
84 SYSTEM_LD_TAIL_EXTRA+=; \
85 ${OBJCOPY} -v -O binary $@ $@.bin
86 .endif
87
88 ##
89 ## (6) port specific target dependencies
90 ##
91
92 # depend on CPU configuration
93 locore.o machdep.o: Makefile
94
95 lock_stubs.o memcmp.o memcpy.o memmove.o setfault.o: assym.h
96
97 ##
98 ## (7) misc settings
99 ##
100
101 ##
102 ## (8) config(8) generated machinery
103 ##
104 %INCLUDES
105
106 %OBJS
107
108 %CFILES
109
110 %SFILES
111
112 %LOAD
113
114 %RULES
115
116 ##
117 ## (9) port independent kernel machinery
118 ##
119 .include "$S/conf/Makefile.kern.inc"
120 ${KERNLIB} ${KERNLIB_PROF} ${KERNLIBLN}: assym.h
121
122 ##
123 ## (10) Appending make options.
124 ##
125 %MAKEOPTIONSAPPEND
126