Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #
  2. # Copyright (C) 2006 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # $Id: Makefile 4855 2006-09-24 20:49:31Z nico $
  8. include $(TOPDIR)/rules.mk
  9. include $(INCLUDE_DIR)/kernel.mk
  10. PKG_NAME:=grub
  11. PKG_VERSION:=0.97
  12. PKG_RELEASE:=1
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=ftp://alpha.gnu.org/gnu/grub
  15. PKG_MD5SUM:=cd3f3eb54446be6003156158d51f4884
  16. PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/grub-$(PKG_VERSION)
  17. PKG_TARGETS:=bin
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/grub
  20. SECTION:=boot
  21. DEPENDS:=@TARGET_x86
  22. CATEGORY:=Boot Loaders
  23. TITLE:=GRand Unified Bootloader
  24. URL:=http://www.gnu.org/software/grub/
  25. endef
  26. ifeq ($(HOST_ARCH),x86_64)
  27. CONFIGURE_FLAGS:= \
  28. --target=$(GNU_TARGET_NAME) \
  29. --host=$(GNU_TARGET_NAME) \
  30. --build=$(GNU_HOST_NAME)
  31. else
  32. CONFIGURE_FLAGS:=
  33. endif
  34. define Build/Configure
  35. (cd $(PKG_BUILD_DIR); \
  36. LDFLAGS="-static" \
  37. ./configure \
  38. $(CONFIGURE_FLAGS) \
  39. --program-prefix="" \
  40. --program-suffix="" \
  41. --prefix=/usr \
  42. --exec-prefix=/usr \
  43. --bindir=/usr/bin \
  44. --sbindir=/usr/sbin \
  45. --libexecdir=/usr/lib \
  46. --sysconfdir=/etc \
  47. --datadir=/usr/share \
  48. --localstatedir=/var \
  49. --mandir=/usr/man \
  50. --infodir=/usr/info \
  51. $(DISABLE_NLS) \
  52. --disable-auto-linux-mem-opt \
  53. )
  54. endef
  55. #
  56. # ./configure detects whether the host compiler supports
  57. # -fno-stack-protector but only sets STAGE2_CFLAGS accordingly
  58. #
  59. define Build/Compile
  60. $(MAKE) -C $(PKG_BUILD_DIR) \
  61. GRUB_CFLAGS="\$$$$(STAGE2_CFLAGS)" \
  62. STAGE1_CFLAGS="\$$$$(STAGE2_CFLAGS)"
  63. endef
  64. define Build/InstallDev
  65. $(MAKE) -C $(PKG_BUILD_DIR) \
  66. DESTDIR="$(STAGING_DIR_HOST)" \
  67. install
  68. mv $(STAGING_DIR_HOST)/usr/sbin/grub $(STAGING_DIR_HOST)/bin
  69. endef
  70. $(eval $(call BuildPackage,grub))