2006-11-17 12:47:04 +01:00
|
|
|
GRUB_SUPPORTED_ARCH=n
|
2005-06-23 07:09:05 +02:00
|
|
|
ifeq ($(ARCH),i386)
|
2006-11-17 12:47:04 +01:00
|
|
|
GRUB_SUPPORTED_ARCH=y
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),i486)
|
|
|
|
GRUB_SUPPORTED_ARCH=y
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),i586)
|
|
|
|
GRUB_SUPPORTED_ARCH=y
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),i686)
|
|
|
|
GRUB_SUPPORTED_ARCH=y
|
|
|
|
endif
|
|
|
|
ifeq ($(ARCH),x86_64)
|
|
|
|
GRUB_SUPPORTED_ARCH=y
|
|
|
|
endif
|
|
|
|
ifeq ($(GRUB_SUPPORTED_ARCH),y)
|
2005-06-23 07:09:05 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# grub
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-03-10 09:06:27 +01:00
|
|
|
GRUB_SOURCE:=grub_0.97.orig.tar.gz
|
2007-05-15 13:39:44 +02:00
|
|
|
GRUB_PATCH:=grub_0.97-28.diff.gz
|
2005-06-23 07:09:05 +02:00
|
|
|
GRUB_SITE=http://ftp.debian.org/debian/pool/main/g/grub
|
2007-01-29 19:34:37 +01:00
|
|
|
GRUB_PATCH_SITE:=http://ftp.debian.org/debian/pool/main/g/grub
|
2006-10-01 17:17:52 +02:00
|
|
|
GRUB_CAT:=$(ZCAT)
|
2006-03-10 09:06:27 +01:00
|
|
|
GRUB_DIR:=$(BUILD_DIR)/grub-0.97
|
2005-06-23 07:09:05 +02:00
|
|
|
GRUB_BINARY:=grub/grub
|
2007-02-04 17:34:56 +01:00
|
|
|
GRUB_TARGET_BINARY:=sbin/grub
|
2006-11-17 12:47:04 +01:00
|
|
|
GRUB_SPLASHIMAGE=$(TOPDIR)/target/x86/grub/splash.xpm.gz
|
2006-03-18 14:07:29 +01:00
|
|
|
|
2007-01-29 19:34:37 +01:00
|
|
|
|
|
|
|
GRUB_CFLAGS=-DSUPPORT_LOOPDEV
|
2006-11-29 21:26:05 +01:00
|
|
|
ifeq ($(BR2_LARGEFILE),)
|
|
|
|
GRUB_CFLAGS+=-U_FILE_OFFSET_BITS
|
|
|
|
endif
|
|
|
|
|
2007-01-29 19:34:37 +01:00
|
|
|
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_SPLASH) += --enable-graphics
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_DISKLESS) += --enable-diskless
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_3c595) += --enable-3c595
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_3c90x) += --enable-3c90x
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_davicom) += --enable-davicom
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_e1000) += --enable-e1000
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_eepro100) += --enable-eepro100
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_epic100) += --enable-epic100
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_forcedeth) += --enable-forcedeth
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_natsemi) += --enable-natsemi
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_ns83820) += --enable-ns83820
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_ns8390) += --enable-ns8390
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_pcnet32) += --enable-pcnet32
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_pnic) += --enable-pnic
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_rtl8139) += --enable-rtl8139
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_r8169) += --enable-r8169
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_sis900) += --enable-sis900
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_tg3) += --enable-tg3
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_tulip) += --enable-tulip
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_tlan) += --enable-tlan
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_undi) += --enable-undi
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_via_rhine) += --enable-via-rhine
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_w89c840) += --enable-w89c840
|
|
|
|
|
2005-06-23 07:09:05 +02:00
|
|
|
$(DL_DIR)/$(GRUB_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(GRUB_SITE)/$(GRUB_SOURCE)
|
|
|
|
|
|
|
|
$(DL_DIR)/$(GRUB_PATCH):
|
2007-01-29 19:34:37 +01:00
|
|
|
$(WGET) -P $(DL_DIR) $(GRUB_PATCH_SITE)/$(GRUB_PATCH)
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
grub-source: $(DL_DIR)/$(GRUB_SOURCE) $(DL_DIR)/$(GRUB_PATCH)
|
|
|
|
|
|
|
|
$(GRUB_DIR)/.unpacked: $(DL_DIR)/$(GRUB_SOURCE) $(DL_DIR)/$(GRUB_PATCH)
|
|
|
|
$(GRUB_CAT) $(DL_DIR)/$(GRUB_SOURCE) | tar -C $(BUILD_DIR) -xvf -
|
2007-01-29 19:34:37 +01:00
|
|
|
toolchain/patch-kernel.sh $(GRUB_DIR) $(DL_DIR) $(GRUB_PATCH)
|
2006-03-18 14:07:29 +01:00
|
|
|
for i in `grep -v "^#" $(GRUB_DIR)/debian/patches/00list`; do \
|
2005-06-23 07:09:05 +02:00
|
|
|
cat $(GRUB_DIR)/debian/patches/$$i | patch -p1 -d $(GRUB_DIR); \
|
|
|
|
done
|
2007-01-29 19:34:37 +01:00
|
|
|
toolchain/patch-kernel.sh $(GRUB_DIR) target/x86/grub grub.\*.patch{,.bz2}
|
|
|
|
touch $@
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
$(GRUB_DIR)/.configured: $(GRUB_DIR)/.unpacked
|
|
|
|
(cd $(GRUB_DIR); rm -rf config.cache; \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
CPPFLAGS="$(GRUB_CFLAGS)" \
|
|
|
|
./configure \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--prefix=/ \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
|
|
|
--disable-auto-linux-mem-opt \
|
2007-01-29 19:34:37 +01:00
|
|
|
$(GRUB_CONFIG-y) \
|
2007-08-22 11:56:41 +02:00
|
|
|
)
|
2007-02-04 17:34:56 +01:00
|
|
|
touch $@
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
$(GRUB_DIR)/$(GRUB_BINARY): $(GRUB_DIR)/.configured
|
|
|
|
$(MAKE) CC=$(TARGET_CC) -C $(GRUB_DIR)
|
|
|
|
|
2007-02-04 17:34:56 +01:00
|
|
|
$(GRUB_DIR)/.installed: $(GRUB_DIR)/$(GRUB_BINARY)
|
|
|
|
cp $(GRUB_DIR)/$(GRUB_BINARY) $(TARGET_DIR)/$(GRUB_TARGET_BINARY)
|
2006-11-17 12:47:04 +01:00
|
|
|
test -d $(TARGET_DIR)/boot/grub || mkdir -p $(TARGET_DIR)/boot/grub
|
|
|
|
cp $(GRUB_DIR)/stage1/stage1 $(GRUB_DIR)/stage2/*1_5 $(GRUB_DIR)/stage2/stage2 $(TARGET_DIR)/boot/grub/
|
2007-01-29 19:34:37 +01:00
|
|
|
ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
|
|
|
|
test -f $(TARGET_DIR)/boot/grub/$(GRUB_SPLASHIMAGE) || \
|
|
|
|
cp $(GRUB_SPLASHIMAGE) $(TARGET_DIR)/boot/grub/
|
|
|
|
endif
|
2007-02-04 17:34:56 +01:00
|
|
|
touch $@
|
2005-06-23 07:09:05 +02:00
|
|
|
|
2007-02-04 17:34:56 +01:00
|
|
|
grub: uclibc $(GRUB_DIR)/.installed
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
grub-clean:
|
|
|
|
$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(GRUB_DIR) uninstall
|
2006-11-29 13:17:26 +01:00
|
|
|
-$(MAKE) -C $(GRUB_DIR) clean
|
2007-01-29 19:34:37 +01:00
|
|
|
rm -f $(TARGET_DIR)/boot/grub/$(GRUB_SPLASHIMAGE) \
|
|
|
|
$(TARGET_DIR)/sbin/$(GRUB_BINARY) \
|
|
|
|
$(TARGET_DIR)/boot/grub/{stage{1,2},*1_5}
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
grub-dirclean:
|
|
|
|
rm -rf $(GRUB_DIR)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_TARGET_GRUB)),y)
|
|
|
|
TARGETS+=grub
|
|
|
|
endif
|