1 1.35 skrll # $NetBSD: Makefile.evbarm.inc,v 1.35 2021/03/21 09:00:55 skrll Exp $ 2 1.22 matt 3 1.22 matt # 4 1.22 matt # If this is a install kernel and the ramdisk image exists in the object 5 1.22 matt # tree, insert it into the kernel *before* we make the u-boot images. 6 1.22 matt # 7 1.24 matt RAMDISKNAME?= ramdisk 8 1.28 matt .if ${KERNEL_BUILD:T:M*INSTALL*} != "" 9 1.24 matt RAMDISKDIR!= cd ${NETBSDSRCDIR}/distrib/${THISARM:T}/instkernel/${RAMDISKNAME} && ${PRINTOBJDIR} 10 1.23 garbled 11 1.24 matt .if exists(${RAMDISKDIR}/${RAMDISKNAME}.fs) 12 1.25 matt SYSTEM_DEP+= ${RAMDISKDIR}/${RAMDISKNAME}.fs 13 1.23 garbled SYSTEM_LD_TAIL_EXTRA+=; \ 14 1.24 matt echo ${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/${RAMDISKNAME}.fs; \ 15 1.24 matt ${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/${RAMDISKNAME}.fs 16 1.22 matt .endif 17 1.22 matt .endif 18 1.1 rearnsha 19 1.16 thorpej .if defined(BOARDMKFRAG) # Must be a full pathname. 20 1.16 thorpej .include "${BOARDMKFRAG}" 21 1.15 thorpej .endif 22 1.15 thorpej 23 1.35 skrll # 24 1.35 skrll # All boards should use a runtime calculation of kern_vtopdiff, but 25 1.35 skrll # support the leagacy compile time method. 26 1.35 skrll # 27 1.35 skrll .if !defined(KERNEL_VOFFSET_RUNTIME) 28 1.30 matt .if defined(KERNEL_BASE_PHYS) && defined(KERNEL_BASE_VIRT) 29 1.30 matt . if ${KERNEL_BASE_PHYS} == ${KERNEL_BASE_VIRT} 30 1.30 matt CPPFLAGS+=-DKERNEL_BASES_EQUAL -DKERNEL_BASE_VOFFSET=0 31 1.30 matt . else 32 1.30 matt CPPFLAGS+=-DKERNEL_BASE_VOFFSET="(${KERNEL_BASE_VIRT}-${KERNEL_BASE_PHYS})" 33 1.30 matt . endif 34 1.29 matt .endif 35 1.35 skrll .endif 36 1.29 matt 37 1.32 uebayasi EXTRA_CLEAN+= ${KERNELS:=.map} 38 1.20 matt 39 1.15 thorpej .if defined(KERNEL_BASE_PHYS) 40 1.27 matt LINKTEXT= 41 1.26 matt KERNLDSCRIPT= ldscript 42 1.32 uebayasi 43 1.32 uebayasi EXTRA_CLEAN+= ${KERNLDSCRIPT} tmp 44 1.14 bsh 45 1.21 jakllsch # generate ldscript from common template 46 1.32 uebayasi ${KERNLDSCRIPT}: \ 47 1.32 uebayasi ${THISARM}/conf/ldscript.evbarm \ 48 1.32 uebayasi ${THISARM}/conf/Makefile.evbarm.inc \ 49 1.32 uebayasi Makefile \ 50 1.32 uebayasi ${BOARDMKFRAG} 51 1.34 uebayasi ${_MKTARGET_CREATE} 52 1.19 apb ${TOOL_SED} -e 's/@KERNEL_BASE_PHYS@/${KERNEL_BASE_PHYS}/' \ 53 1.14 bsh -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' \ 54 1.14 bsh ${THISARM}/conf/ldscript.evbarm > tmp && mv tmp $@ 55 1.15 thorpej 56 1.27 matt .else 57 1.27 matt LINKTEXT= -Ttext ${LOADADDRESS} 58 1.15 thorpej .endif # KERNEL_BASE_PHYS 59