Makefile.powerpc revision 1.31 1 # $NetBSD: Makefile.powerpc,v 1.31 2004/12/09 22:57:12 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= ${THISPPC}/${MACHINE}/genassym.cf
32 .else
33 GENASSYM= ${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 CFLAGS+= -msoft-float ${CCPUOPTS} -Wa,-maltivec
43 AFLAGS+= ${AOPTS}
44
45 ##
46 ## (3) libkern and compat
47 ##
48 .if !empty(IDENT:M-DLKM)
49 KERN_AS= obj
50 .endif
51
52 ##
53 ## (4) local objects, compile rules, and dependencies
54 ##
55 .if !defined(SYSTEM_FIRST_OBJ)
56 SYSTEM_FIRST_OBJ= locore.o
57 .endif
58 .if !defined(SYSTEM_FIRST_SFILE)
59 SYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
60 .endif
61 MD_OBJS= ${SYSTEM_FIRST_OBJ}
62 MD_CFILES=
63 MD_SFILES= ${SYSTEM_FIRST_SFILE}
64
65 ${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
66 ${NORMAL_S}
67
68 ##
69 ## (5) link settings
70 ##
71 TEXTADDR?= 0x100000
72 LINKFORMAT= -N
73 ENTRYPOINT= __start
74
75 .if defined(NEED_SYMTAB)
76 SYSTEM_LD_TAIL_EXTRA=; \
77 echo ${DBSYM} $@; \
78 ${DBSYM} $@
79 .endif
80
81 .if defined(NEED_SREC)
82 SYSTEM_LD_TAIL_EXTRA+=; \
83 ${OBJCOPY} -v -O srec $@ $@.srec
84 .endif
85
86 .if defined(NEED_BINARY)
87 SYSTEM_LD_TAIL_EXTRA+=; \
88 ${OBJCOPY} -v -O binary $@ $@.bin
89 .endif
90
91 ##
92 ## (6) port specific target dependencies
93 ##
94
95 # depend on CPU configuration
96 locore.o machdep.o: Makefile
97
98 setfault.o: assym.h
99
100 ##
101 ## (7) misc settings
102 ##
103
104 ##
105 ## (8) config(8) generated machinery
106 ##
107 %INCLUDES
108
109 %OBJS
110
111 %CFILES
112
113 %SFILES
114
115 %LOAD
116
117 %RULES
118
119 ##
120 ## (9) port independent kernel machinery
121 ##
122 .include "$S/conf/Makefile.kern.inc"
123
124 ##
125 ## (10) Appending make options.
126 ##
127 %MAKEOPTIONSAPPEND
128