1 # $NetBSD: Makefile.powerpc,v 1.42 2009/02/14 16:53:55 apb Exp $
5 # This makefile is constructed from a machine description:
7 # Most changes should be made in the machine description
8 # /sys/arch/powerpc/conf/``machineid''
9 # after which you should do
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.
15 # To specify debugging, add the config line: makeoptions DEBUG="-g"
16 # A better way is to specify -g only for a few files.
18 # makeoptions DEBUGLIST="uvm* trap if_*"
22 NEED_OWN_INSTALL_TARGET?=no
26 ## (1) port identification
28 THISPPC= $S/arch/${MACHINE}
29 POWERPC= $S/arch/powerpc
30 .if exists(${THISPPC}/${MACHINE}/genassym.cf)
31 GENASSYM_CONF= ${THISPPC}/${MACHINE}/genassym.cf
33 GENASSYM_CONF= ${POWERPC}/${PPCDIR}/genassym.cf
35 .-include "${THISPPC}/conf/Makefile.${MACHINE}.inc"
38 ## (2) compile settings
40 CPPFLAGS+= -D${MACHINE}=${MACHINE}
41 CWARNFLAGS+= -Wreturn-type
42 .if ${PPCDIR} == "oea"
43 CFLAGS+= -mno-strict-align
45 CFLAGS+= -msoft-float ${CCPUOPTS} -Wa,-maltivec
49 ## (3) libkern and compat
51 OPT_MODULAR= %MODULAR%
52 .if !empty(OPT_MODULAR)
57 ## (4) local objects, compile rules, and dependencies
59 .if !defined(SYSTEM_FIRST_OBJ)
60 SYSTEM_FIRST_OBJ= locore.o
62 .if !defined(SYSTEM_FIRST_SFILE)
63 SYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
65 MD_OBJS= ${SYSTEM_FIRST_OBJ}
67 MD_SFILES= ${SYSTEM_FIRST_SFILE}
69 ${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
79 .if defined(NEED_SREC)
80 SYSTEM_LD_TAIL_EXTRA+=; \
81 ${OBJCOPY} -v -O srec $@ $@.srec
84 .if defined(NEED_BINARY)
85 SYSTEM_LD_TAIL_EXTRA+=; \
86 ${OBJCOPY} -v -O binary $@ $@.bin
90 ## (6) port specific target dependencies
93 # depend on CPU configuration
94 locore.o machdep.o: Makefile
96 lock_stubs.o setfault.o: assym.h
103 ## (8) config(8) generated machinery
118 ## (9) port independent kernel machinery
120 .include "$S/conf/Makefile.kern.inc"
121 ${KERNLIB} ${KERNLIB_PROF} ${KERNLIBLN}: assym.h
124 ## (10) Appending make options.