Makefile 1.4 KB

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