1 # $NetBSD: Makefile.sparc64,v 1.67 2008/08/30 13:23:55 martin Exp $
3 #=========================================================================
7 # ANYONE WHO CHANGES THIS MAKEFILE AND DOES NOT TEST BOTH A 32-BIT
8 # AND 64-BIT KERNEL WILL BE SHOT.
10 #=========================================================================
15 # This makefile is constructed from a machine description:
17 # Most changes should be made in the machine description
18 # /sys/arch/sparc64/conf/``machineid''
19 # after which you should do
21 # Machine generic makefile changes should be made in
22 # /sys/arch/sparc64/conf/Makefile.sparc64
23 # after which config should be rerun for all machines of that type.
25 # To specify debugging, add the config line: makeoptions DEBUG="-g"
26 # A better way is to specify -g only for a few files.
28 # makeoptions DEBUGLIST="uvm* trap if_*"
30 # Default to 32-bit. Set the MACHINE_ARCH accordingly.
32 # You must also be using the correct toolchain or the kernel build
43 NEED_OWN_INSTALL_TARGET?=no
47 ## (1) port identification
49 SPARC64= $S/arch/sparc64
50 GENASSYM_CONF= ${SPARC64}/sparc64/genassym.cf
53 ## (2) compile settings
55 CPPFLAGS+= -Dsparc64 -D__sparc64__
58 CPPFLAGS+= -D_LP64 -Wa,-Av9a
62 # Profiling is only supported in the medium low memory model.
63 CFLAGS+= -mcmodel=medlow
65 # Since the kernel resides in the lower 32 bits, use medium low for now anyway.
66 CFLAGS+= -mcmodel=medlow
70 CPPFLAGS+= -m32 -Wa,-Av8plusa -mcpu=ultrasparc
71 AFLAGS+= -Wa,-Av8plusa
73 # The sparc gcc version 3.3.3 (NetBSD nb1 20040301) does not compile this
74 # file properly with higher optimizations
75 CC_NOOPT= ${NORMAL_C:C/-O./-O0/}
78 AFLAGS+= -x assembler-with-cpp -traditional-cpp
81 ## (3) libkern and compat
83 # KERN_AS= obj # memcpy, memset, etc. are in locore.s
86 ## (4) local objects, compile rules, and dependencies
90 MD_SFILES= ${SPARC64}/sparc64/locore.s
92 locore.o: ${SPARC64}/sparc64/locore.s assym.h
99 LINKFORMAT= -T ${SPARC64}/conf/${KERN_LDSCRIPT}
101 KERN_LDSCRIPT?= kern.ldscript
103 KERN_LDSCRIPT?= kern32.ldscript
107 ## (6) port specific target dependencies
110 # depend on CPU configuration
111 bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
112 ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile
113 machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile
115 cpu_in_cksum.o lock_stubs.o: assym.h
121 # define .MAIN _before_ the make() check, so that implicit target
125 .if make(depend) || make(all) || make(dependall)
128 ln -s $S/arch/sparc/include sparc
132 ## (8) config(8) generated machinery
147 ## (9) port independent kernel machinery
149 .include "$S/conf/Makefile.kern.inc"
152 ## (10) Appending make options.