Makefile.powerpc revision 1.24 1 # $NetBSD: Makefile.powerpc,v 1.24 2002/08/23 12:01:58 scw 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}
41 CWARNFLAGS+= -Wreturn-type
42 CFLAGS+= -msoft-float ${CCPUOPTS}
43 AFLAGS+= ${AOPTS}
44
45 ##
46 ## (3) libkern and compat
47 ##
48
49 ##
50 ## (4) local objects, compile rules, and dependencies
51 ##
52 .if !defined(SYSTEM_FIRST_OBJ)
53 SYSTEM_FIRST_OBJ= locore.o
54 .endif
55 .if !defined(SYSTEM_FIRST_SFILE)
56 SYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
57 .endif
58 MD_OBJS= ${SYSTEM_FIRST_OBJ}
59 MD_CFILES=
60 MD_SFILES= ${SYSTEM_FIRST_SFILE}
61
62 ${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
63 ${NORMAL_S}
64
65 ##
66 ## (5) link settings
67 ##
68 TEXTADDR?= 0x100000
69 LINKFORMAT= -N
70 ENTRYPOINT= __start
71
72 .if defined(NEED_SREC)
73 SYSTEM_LD_TAIL_EXTRA=; \
74 ${OBJCOPY} -v -O srec $@ $@.srec
75 .endif
76
77 .if defined(NEED_BINARY)
78 SYSTEM_LD_TAIL_EXTRA=; \
79 ${OBJCOPY} -v -O binary $@ $@.bin
80 .endif
81
82 ##
83 ## (6) port specific target dependencies
84 ##
85
86 # depend on CPU configuration
87 locore.o machdep.o: Makefile
88
89 ##
90 ## (7) misc settings
91 ##
92
93 ##
94 ## (8) config(8) generated machinery
95 ##
96 %INCLUDES
97
98 %OBJS
99
100 %CFILES
101
102 %SFILES
103
104 %LOAD
105
106 %RULES
107
108 ##
109 ## (9) port independent kernel machinery
110 ##
111 .include "$S/conf/Makefile.kern.inc"
112