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