Makefile.evbarm.inc revision 1.24.2.2 1 # $NetBSD: Makefile.evbarm.inc,v 1.24.2.2 2014/05/18 17:45:03 rmind 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 .if defined(KERNEL_BASE_PHYS) && defined(KERNEL_BASE_VIRT)
24 . if ${KERNEL_BASE_PHYS} == ${KERNEL_BASE_VIRT}
25 CPPFLAGS+=-DKERNEL_BASES_EQUAL -DKERNEL_BASE_VOFFSET=0
26 . else
27 CPPFLAGS+=-DKERNEL_BASE_VOFFSET="(${KERNEL_BASE_VIRT}-${KERNEL_BASE_PHYS})"
28 . endif
29 .endif
30
31 EXTRA_CLEAN+= ldscript tmp ${KERNELS:=.map}
32
33 .if defined(KERNEL_BASE_PHYS)
34 LINKTEXT=
35 KERNLDSCRIPT= ldscript
36 EXTRA_LINKFLAGS+= -T ldscript
37
38 # generate ldscript from common template
39 ldscript: ${THISARM}/conf/ldscript.evbarm ${THISARM}/conf/Makefile.evbarm.inc Makefile ${BOARDMKFRAG}
40 echo ${KERNELS}
41 ${TOOL_SED} -e 's/@KERNEL_BASE_PHYS@/${KERNEL_BASE_PHYS}/' \
42 -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' \
43 ${THISARM}/conf/ldscript.evbarm > tmp && mv tmp $@
44
45 .else
46 LINKTEXT= -Ttext ${LOADADDRESS}
47 .endif # KERNEL_BASE_PHYS
48