b43: More non-PCI fixes
[openwrt/svn-archive/archive.git] / package / grub / Makefile
1 #
2 # Copyright (C) 2006-2008 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
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=grub
13 PKG_VERSION:=0.97
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=ftp://alpha.gnu.org/gnu/grub
18 PKG_MD5SUM:=cd3f3eb54446be6003156158d51f4884
19
20 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/grub-$(PKG_VERSION)
21 PKG_TARGETS:=bin
22
23 include $(INCLUDE_DIR)/package.mk
24
25 export grub_cv_prog_objcopy_absolute=yes
26
27 define Package/grub
28 SECTION:=boot
29 DEPENDS:=@TARGET_x86
30 CATEGORY:=Boot Loaders
31 TITLE:=GRand Unified Bootloader
32 URL:=http://www.gnu.org/software/grub/
33 endef
34
35 ifeq ($(HOST_OS),Linux)
36 NATIVEGRUB-i386:=1
37 NATIVEGRUB-i686:=1
38 NATIVEGRUB:=$(NATIVEGRUB-$(HOST_ARCH))
39 endif
40
41 ifeq ($(NATIVEGRUB),)
42 CONFIGURE_FLAGS:= \
43 --target=$(GNU_TARGET_NAME) \
44 --host=$(GNU_TARGET_NAME) \
45 --build=$(GNU_HOST_NAME)
46 else
47 CONFIGURE_FLAGS:=
48 endif
49
50 ifneq ($(HOST_OS),Darwin)
51 define Build/Configure
52 (cd $(PKG_BUILD_DIR); \
53 LDFLAGS="-static" \
54 ./configure \
55 $(CONFIGURE_FLAGS) \
56 --program-prefix="" \
57 --program-suffix="" \
58 --prefix=/usr \
59 --exec-prefix=/usr \
60 --bindir=/usr/bin \
61 --sbindir=/usr/sbin \
62 --libexecdir=/usr/lib \
63 --sysconfdir=/etc \
64 --datadir=/usr/share \
65 --localstatedir=/var \
66 --mandir=/usr/man \
67 --infodir=/usr/info \
68 $(DISABLE_NLS) \
69 --disable-auto-linux-mem-opt \
70 )
71 endef
72
73 #
74 # ./configure detects whether the host compiler supports
75 # -fno-stack-protector but only sets STAGE2_CFLAGS accordingly
76 #
77 define Build/Compile
78 $(MAKE) -C $(PKG_BUILD_DIR) \
79 GRUB_CFLAGS="\$$$$(STAGE2_CFLAGS)" \
80 STAGE1_CFLAGS="\$$$$(STAGE2_CFLAGS)"
81 endef
82
83 define Build/InstallDev
84 $(MAKE) -C $(PKG_BUILD_DIR) \
85 DESTDIR="$(STAGING_DIR_HOST)" \
86 install
87 mv $(STAGING_DIR_HOST)/usr/sbin/grub $(STAGING_DIR_HOST)/bin
88 endef
89 endif
90
91 $(eval $(call BuildPackage,grub))