1# $NetBSD: Makefile.arm,v 1.32 2008/04/27 03:23:13 tsutsui 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/<arch>/conf/``machineid'' 9# after which you should do 10# config machineid 11# Machine generic makefile changes should be made in 12# /sys/arch/arm/conf/Makefile.arm 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 20USETOOLS?= no 21NEED_OWN_INSTALL_TARGET?=no 22.include <bsd.own.mk> 23 24## 25## (1) port identification 26## 27THISARM= $S/arch/${MACHINE} 28ARM= $S/arch/arm 29GENASSYM_CONF= ${ARM}/arm32/genassym.cf 30.-include "$S/arch/${MACHINE}/conf/Makefile.${MACHINE}.inc" 31 32## 33## (2) compile settings 34## 35# CPPFLAGS set by platform-specific Makefile fragment. 36AFLAGS+= -x assembler-with-cpp 37 38## 39## (3) libkern and compat 40## 41KERN_AS= obj 42 43## 44## (4) local objects, compile rules, and dependencies 45## 46MD_OBJS+= ${SYSTEM_FIRST_OBJ} locore.o 47MD_CFILES+= 48MD_SFILES+= ${SYSTEM_FIRST_SFILE} ${ARM}/arm32/locore.S 49 50.if defined(SYSTEM_FIRST_OBJ) 51${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h 52 ${NORMAL_S} 53.endif 54 55locore.o: ${ARM}/arm32/locore.S assym.h 56 ${NORMAL_S} 57 58## 59## (5) link settings 60## 61LOADADDRESS?= 0xF0000000 62LINKFLAGS_NORMAL= -X 63# Strip ARM mapping symbols from the kernel image, as they interfere 64# with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified. 65.if !defined(DEBUG) || empty(DEBUG:M-g*) 66SYSTEM_LD_TAIL?= @${OBJCOPY} --strip-symbol='$$a' \ 67 --strip-symbol='$$t' \ 68 --strip-symbol='$$d' $@ ;\ 69 ${SIZE} $@; chmod 755 $@ 70.else 71STRIPFLAGS=-g --strip-symbol='$$a' --strip-symbol='$$t' --strip-symbol='$$d' 72.endif 73 74## 75## (6) port specific target dependencies 76## 77 78# depend on CPU configuration 79cpufunc.o cpufunc_asm.o: Makefile 80 81# depend on DIAGNOSTIC etc. 82cpuswitch.o fault.o machdep.o: Makefile 83 84# various assembly files that depend on assym.h 85atomic.o bcopy_page.o bcopyinout.o copystr.o cpuswitch.o cpu_in_cksum.o: assym.h 86exception.o fiq_subr.o fusu.o irq_dispatch.o isa_irq.o sigcode.o: assym.h 87spl.o vectors.o: assym.h 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 113## 114## (10) Appending make options. 115## 116%MAKEOPTIONSAPPEND 117