]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/powerpc/boot1.chrp/Makefile
MFV r361937:
[FreeBSD/FreeBSD.git] / stand / powerpc / boot1.chrp / Makefile
1 # $FreeBSD$
2
3 .include <bsd.init.mk>
4
5 PROG=           boot1.elf
6 NEWVERSWHAT=    "Open Firmware boot block" ${MACHINE_ARCH}
7 INSTALLFLAGS=   -b
8
9 FILES=          boot1.hfs
10 SRCS=           boot1.c ashldi3.c syncicache.c
11
12 CFLAGS+=-I${LDRSRC}
13 # Load boot1.elf below kernel.
14 #
15 # Due to limitiations in the way we load stuff, we have to avoid reusing
16 # memory until the kernel MMU code has taken over.
17 #
18 # 0x38000 is high enough to not interfere with the trap area, but low
19 # enough that it doesn't bump into the kernel area starting at 0x100000,
20 # even if the entire partition gets used as the load size by a buggy OFW.
21 #
22 # In theory 0xf0000 would work too under the current 64k size limit for
23 # boot1.elf defined in the HFS template, but sometimes boot1.elf is written
24 # directly to the PReP partition.
25 #
26 LDFLAGS=-nostdlib -static -Wl,-N -Wl,-Ttext=0x38000
27
28 .PATH:  ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR}
29
30 # The following inserts out objects into a template HFS 
31 # created by generate-hfs.sh
32
33 .include "${.CURDIR}/Makefile.hfs"
34
35 boot1.hfs: boot1.elf bootinfo.txt
36         echo ${.OBJDIR}
37         uudecode ${.CURDIR}/hfs.tmpl.bz2.uu
38         mv hfs.tmpl.bz2 ${.TARGET}.bz2
39         bzip2 -f -d ${.TARGET}.bz2
40         ${DD} if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc
41         ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \
42             conv=notrunc
43
44 CLEANFILES+= boot1.hfs
45
46 .include <bsd.prog.mk>
47