Makefile.amd64 revision 1.13
1# $NetBSD: Makefile.amd64,v 1.13 2006/04/04 03:13:12 gdamore 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/amd64/conf/``machineid'' 9# after which you should do 10# config machineid 11# Machine generic makefile changes should be made in 12# /sys/arch/amd64/conf/Makefile.amd64 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 20MACHINE_ARCH=x86_64 21USETOOLS?= no 22NEED_OWN_INSTALL_TARGET?=no 23.include <bsd.own.mk> 24 25## 26## (1) port identification 27## 28AMD64= $S/arch/amd64 29GENASSYM_CONF= ${AMD64}/amd64/genassym.cf 30 31## 32## (2) compile settings 33## 34DEFCOPTS= -O2 35CPPFLAGS+= -Damd64 -Dx86_64 36CFLAGS+= -mcmodel=kernel 37CFLAGS+= -mno-red-zone 38AFLAGS+= -x assembler-with-cpp -traditional-cpp 39 40## 41## (3) libkern and compat 42## 43KERN_AS= obj 44 45## 46## (4) local objects, compile rules, and dependencies 47## 48MD_OBJS= locore.o vector.o copy.o microtime.o spl.o 49MD_CFILES= 50MD_SFILES= ${AMD64}/amd64/locore.S ${AMD64}/amd64/vector.S \ 51 ${AMD64}/amd64/copy.S ${AMD64}/amd64/microtime.S \ 52 ${AMD64}/amd64/spl.S 53 54locore.o: ${AMD64}/amd64/locore.S assym.h 55 ${NORMAL_S} 56 57vector.o: ${AMD64}/amd64/vector.S assym.h 58 ${NORMAL_S} 59 60copy.o: ${AMD64}/amd64/copy.S assym.h 61 ${NORMAL_S} 62 63microtime.o: ${AMD64}/amd64/microtime.S assym.h 64 ${NORMAL_S} 65 66spl.o: ${AMD64}/amd64/spl.S assym.h 67 ${NORMAL_S} 68 69## 70## (5) link settings 71## 72TEXTADDR?= 0xffffffff80100000 73LINKFLAGS_NORMAL= -X 74KERN_LDSCRIPT?= kern.ldscript 75LINKFORMAT= -T ${AMD64}/conf/${KERN_LDSCRIPT} 76 77## 78## (6) port specific target dependencies 79## 80 81# depend on CPU configuration 82locore.o machdep.o: Makefile 83 84mptramp.o netbsd32_sigcode.o: assym.h 85clock.o: config_time.h 86 87## 88## (7) misc settings 89## 90 91## 92## (8) config(8) generated machinery 93## 94%INCLUDES 95 96%OBJS 97 98%CFILES 99 100%SFILES 101 102%LOAD 103 104%RULES 105## Include rules for Atheros WLAN 106.include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc" 107 108 109 110# XXX - Ugly, but make doesn't easily handle .o.uu (assumes it's a suffix) 111# XXX - Also, config has no simple was to just add foo.o to the Makefile. 112# It needs a pathname of some sort for "object" 113.if !empty(OBJS:M\/athhal.o) 114OBJS:=${OBJS:C/\/athhal.o/athhal.o/} 115 116.PATH: $S/contrib/dev/ath/public 117ATH_UUDEC?= @${_MKSHMSG} "uudecode ${.CURDIR:T}/${.TARGET}"; \ 118 ${_MKSHECHO}\ 119 ${UUDECODE} -p $> \> ${.TARGET}; \ 120 rm -f ${.TARGET}; \ 121 ${UUDECODE} -p $> > ${.TARGET} 122 123athhal.o: x86_64-elf.hal.o.uu 124 ${ATH_UUDEC} 125.if defined(COPTS) && !empty(COPTS:M-fno-asynchronous-unwind-tables) 126 ${_MKSHECHO}\ 127 ${OBJCOPY} -R .eh_frame $@ 128 ${OBJCOPY} -R .eh_frame $@ 129.endif 130.endif 131 132## 133## (9) port independent kernel machinery 134## 135.include "$S/conf/Makefile.kern.inc" 136 137## 138## (10) Appending make options. 139## 140%MAKEOPTIONSAPPEND 141