Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(ADK_TOPDIR)/rules.mk
  4. PKG_NAME:= grub
  5. PKG_VERSION:= 2.00
  6. PKG_RELEASE:= 6
  7. PKG_HASH:= 784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458
  8. PKG_DESCR:= multiboot boot loader
  9. PKG_SECTION:= base/boot
  10. PKG_BUILDDEP:= bison-host
  11. PKG_URL:= http://www.gnu.org/software/grub
  12. PKG_SITES:= ftp://ftp.gnu.org/gnu/grub/
  13. PKG_ARCH_DEPENDS:= x86 x86_64 mips
  14. PKG_SYSTEM_DEPENDS:= !mikrotik-rb532
  15. PKG_NOPARALLEL:= 1
  16. PKG_SUBPKGS:= GRUB GRUB_TOOLS
  17. PKGSD_GRUB_TOOLS:= grub2 tools
  18. PKG_CHOICES_GRUB:= PC EFI
  19. PKGCD_PC:= build for PC BIOS
  20. PKGCD_EFI:= build for EFI
  21. include $(ADK_TOPDIR)/mk/package.mk
  22. $(eval $(call PKG_template,GRUB,grub,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  23. $(eval $(call PKG_template,GRUB_TOOLS,grub-tools,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  24. TARGET_CFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_CFLAGS))
  25. # core.img is generated via
  26. # grub-mkimage -O ${GRUB_ARCH} -o core.img -c embed.cfg ${GRUB_MODULES}
  27. GRUB_MODULES:= ext2 part_msdos biosdisk
  28. ifeq ($(ADK_PACKAGE_GRUB_PC),y)
  29. GRUB_ARCH:= i386-pc
  30. CONFIGURE_ARGS+= --with-platform=pc
  31. endif
  32. ifeq ($(ADK_PACKAGE_GRUB_EFI),y)
  33. GRUB_ARCH:= x86_64-efi
  34. CONFIGURE_ARGS+= --with-platform=efi
  35. endif
  36. CONFIGURE_ARGS+= --disable-grub-mkfont \
  37. --enable-efiemu=no \
  38. --enable-device-mapper=no \
  39. --enable-libzfs=no \
  40. --disable-werror
  41. XAKE_FLAGS+= GCC_HONOUR_COPTS=s
  42. grub-install:
  43. ${INSTALL_DIR} $(IDIR_GRUB)/boot/grub/${GRUB_ARCH}
  44. ${CP} ${WRKINST}/usr/lib/grub/${GRUB_ARCH}/*{mod,lst,img} \
  45. $(IDIR_GRUB)/boot/grub/${GRUB_ARCH}/
  46. -${CP} ./files/core.img.${GRUB_ARCH} \
  47. $(IDIR_GRUB)/boot/grub/core.img
  48. grub-tools-install:
  49. ${INSTALL_DIR} $(IDIR_GRUB_TOOLS)/usr/{sbin,bin,share,lib}
  50. ${INSTALL_BIN} ${WRKINST}/usr/sbin/grub-install \
  51. $(IDIR_GRUB_TOOLS)/usr/sbin
  52. ${INSTALL_BIN} ${WRKINST}/usr/sbin/grub-probe \
  53. $(IDIR_GRUB_TOOLS)/usr/sbin
  54. ${INSTALL_BIN} ${WRKINST}/usr/sbin/grub-bios-setup \
  55. $(IDIR_GRUB_TOOLS)/usr/sbin
  56. ${INSTALL_BIN} ${WRKINST}/usr/bin/grub-editenv \
  57. $(IDIR_GRUB_TOOLS)/usr/bin
  58. ${INSTALL_BIN} ${WRKINST}/usr/bin/grub-mkrelpath \
  59. $(IDIR_GRUB_TOOLS)/usr/bin
  60. ${INSTALL_BIN} ${WRKINST}/usr/bin/grub-mkimage \
  61. $(IDIR_GRUB_TOOLS)/usr/bin
  62. ${CP} ${WRKINST}/usr/lib/grub \
  63. $(IDIR_GRUB_TOOLS)/usr/lib
  64. ${CP} ${WRKINST}/usr/share/grub \
  65. $(IDIR_GRUB_TOOLS)/usr/share
  66. include ${ADK_TOPDIR}/mk/pkg-bottom.mk