17 ifeq ($(GRUB_SUPPORTED_ARCH
),y
)
18 #############################################################
22 #############################################################
23 GRUB_SOURCE
:=grub_0.97.orig.
tar.gz
24 GRUB_PATCH
:=grub_0.97
-28.diff.gz
25 GRUB_SITE
=$(BR2_DEBIAN_MIRROR
)/debian
/pool
/main
/g
/grub
26 GRUB_PATCH_SITE
:=$(BR2_DEBIAN_MIRROR
)/debian
/pool
/main
/g
/grub
28 GRUB_DIR
:=$(BUILD_DIR
)/grub-0.97
29 GRUB_BINARY
:=grub
/grub
30 GRUB_TARGET_BINARY
:=sbin
/grub
31 GRUB_SPLASHIMAGE
=$(TOPDIR
)/target
/x86
/grub
/splash.xpm.gz
34 GRUB_CFLAGS
=-DSUPPORT_LOOPDEV
35 ifeq ($(BR2_LARGEFILE
),)
36 GRUB_CFLAGS
+=-U_FILE_OFFSET_BITS
40 GRUB_CONFIG-
$(BR2_TARGET_GRUB_SPLASH
) += --enable-graphics
41 GRUB_CONFIG-
$(BR2_TARGET_GRUB_DISKLESS
) += --enable-diskless
42 GRUB_CONFIG-
$(BR2_TARGET_GRUB_3c595
) += --enable-3c595
43 GRUB_CONFIG-
$(BR2_TARGET_GRUB_3c90x
) += --enable-3c90x
44 GRUB_CONFIG-
$(BR2_TARGET_GRUB_davicom
) += --enable-davicom
45 GRUB_CONFIG-
$(BR2_TARGET_GRUB_e1000
) += --enable-e1000
46 GRUB_CONFIG-
$(BR2_TARGET_GRUB_eepro100
) += --enable-eepro100
47 GRUB_CONFIG-
$(BR2_TARGET_GRUB_epic100
) += --enable-epic100
48 GRUB_CONFIG-
$(BR2_TARGET_GRUB_forcedeth
) += --enable-forcedeth
49 GRUB_CONFIG-
$(BR2_TARGET_GRUB_natsemi
) += --enable-natsemi
50 GRUB_CONFIG-
$(BR2_TARGET_GRUB_ns83820
) += --enable-ns83820
51 GRUB_CONFIG-
$(BR2_TARGET_GRUB_ns8390
) += --enable-ns8390
52 GRUB_CONFIG-
$(BR2_TARGET_GRUB_pcnet32
) += --enable-pcnet32
53 GRUB_CONFIG-
$(BR2_TARGET_GRUB_pnic
) += --enable-pnic
54 GRUB_CONFIG-
$(BR2_TARGET_GRUB_rtl8139
) += --enable-rtl8139
55 GRUB_CONFIG-
$(BR2_TARGET_GRUB_r8169
) += --enable-r8169
56 GRUB_CONFIG-
$(BR2_TARGET_GRUB_sis900
) += --enable-sis900
57 GRUB_CONFIG-
$(BR2_TARGET_GRUB_tg3
) += --enable-tg3
58 GRUB_CONFIG-
$(BR2_TARGET_GRUB_tulip
) += --enable-tulip
59 GRUB_CONFIG-
$(BR2_TARGET_GRUB_tlan
) += --enable-tlan
60 GRUB_CONFIG-
$(BR2_TARGET_GRUB_undi
) += --enable-undi
61 GRUB_CONFIG-
$(BR2_TARGET_GRUB_via_rhine
) += --enable-via-rhine
62 GRUB_CONFIG-
$(BR2_TARGET_GRUB_w89c840
) += --enable-w89c840
64 $(DL_DIR
)/$(GRUB_SOURCE
):
65 $(WGET
) -P
$(DL_DIR
) $(GRUB_SITE
)/$(GRUB_SOURCE
)
67 $(DL_DIR
)/$(GRUB_PATCH
):
68 $(WGET
) -P
$(DL_DIR
) $(GRUB_PATCH_SITE
)/$(GRUB_PATCH
)
70 grub-source
: $(DL_DIR
)/$(GRUB_SOURCE
) $(DL_DIR
)/$(GRUB_PATCH
)
72 $(GRUB_DIR
)/.unpacked
: $(DL_DIR
)/$(GRUB_SOURCE
) $(DL_DIR
)/$(GRUB_PATCH
)
73 $(GRUB_CAT
) $(DL_DIR
)/$(GRUB_SOURCE
) |
tar -C
$(BUILD_DIR
) -xvf
-
74 toolchain
/patch-kernel.sh
$(GRUB_DIR
) $(DL_DIR
) $(GRUB_PATCH
)
75 for i in
`grep -v "^#" $(GRUB_DIR)/debian/patches/00list`; do \
76 cat
$(GRUB_DIR
)/debian
/patches
/$$i | patch
-p1
-d
$(GRUB_DIR
); \
78 toolchain
/patch-kernel.sh
$(GRUB_DIR
) target
/x86
/grub grub.\
*.patch
{,.bz2
}
81 $(GRUB_DIR
)/.configured
: $(GRUB_DIR
)/.unpacked
82 (cd
$(GRUB_DIR
); rm -rf config.cache
; \
83 $(TARGET_CONFIGURE_OPTS
) \
84 CFLAGS
="$(TARGET_CFLAGS)" \
85 CPPFLAGS
="$(GRUB_CFLAGS)" \
87 --target
=$(GNU_TARGET_NAME
) \
88 --host
=$(GNU_TARGET_NAME
) \
89 --build
=$(GNU_HOST_NAME
) \
93 --disable-auto-linux-mem-opt \
98 $(GRUB_DIR
)/$(GRUB_BINARY
): $(GRUB_DIR
)/.configured
99 $(MAKE
) CC
=$(TARGET_CC
) -C
$(GRUB_DIR
)
100 rm -f
$(GRUB_DIR
)/$(GRUB_BINARY
)
101 $(MAKE
) CC
=$(TARGET_CC
) CFLAGS
+=-static
-C
$(GRUB_DIR
)/grub grub
102 mkdir
-p
$(dir $(STAGING_DIR
)/$(GRUB_TARGET_BINARY
))
103 mv
$(GRUB_DIR
)/$(GRUB_BINARY
) $(STAGING_DIR
)/$(GRUB_TARGET_BINARY
).static
104 $(MAKE
) CC
=$(TARGET_CC
) -C
$(GRUB_DIR
)/grub
106 $(GRUB_DIR
)/.installed
: $(GRUB_DIR
)/$(GRUB_BINARY
)
107 cp
$(GRUB_DIR
)/$(GRUB_BINARY
) $(TARGET_DIR
)/$(GRUB_TARGET_BINARY
)
108 test -d
$(TARGET_DIR
)/boot
/grub || mkdir
-p
$(TARGET_DIR
)/boot
/grub
109 cp
$(GRUB_DIR
)/stage1
/stage1
$(GRUB_DIR
)/stage2
/*1_5
$(GRUB_DIR
)/stage2
/stage2
$(TARGET_DIR
)/boot
/grub
/
110 ifeq ($(BR2_TARGET_GRUB_SPLASH
),y
)
111 test -f
$(TARGET_DIR
)/boot
/grub
/$(GRUB_SPLASHIMAGE
) || \
112 cp
$(GRUB_SPLASHIMAGE
) $(TARGET_DIR
)/boot
/grub
/
116 grub
: uclibc
$(GRUB_DIR
)/.installed
119 $(MAKE
) DESTDIR
=$(TARGET_DIR
) CC
=$(TARGET_CC
) -C
$(GRUB_DIR
) uninstall
120 -$(MAKE
) -C
$(GRUB_DIR
) clean
121 rm -f
$(TARGET_DIR
)/boot
/grub
/$(GRUB_SPLASHIMAGE
) \
122 $(TARGET_DIR
)/sbin
/$(GRUB_BINARY
) \
123 $(TARGET_DIR
)/boot
/grub
/{stage
{1,2},*1_5
}
130 #############################################################
132 # Toplevel Makefile options
134 #############################################################
135 ifeq ($(BR2_TARGET_GRUB
),y
)