2013-11-14 12:10:08 +01:00
|
|
|
TAG-$(CONFIG_GRUB2_MASTER)=
|
|
|
|
NAME-$(CONFIG_GRUB2_MASTER)=HEAD
|
|
|
|
|
2016-03-16 19:42:05 +01:00
|
|
|
project_git_repo=git://git.sv.gnu.org/grub.git
|
|
|
|
project_dir=grub2
|
|
|
|
|
2013-11-14 12:10:08 +01:00
|
|
|
unexport KCONFIG_AUTOCONFIG
|
2013-12-03 18:22:44 +01:00
|
|
|
unexport CFLAGS
|
|
|
|
unexport CPPFLAGS
|
|
|
|
unexport CCASFLAGS
|
|
|
|
unexport CC
|
|
|
|
unexport BUILD_CC
|
|
|
|
unexport TARGET_CC
|
|
|
|
unexport TARGET_CFLAGS
|
|
|
|
unexport TARGET_CPPFLAGS
|
|
|
|
unexport TARGET_STRIP
|
|
|
|
unexport TARGET_OBJCOPY
|
|
|
|
unexport HOST_CFLAGS
|
|
|
|
unexport HOST_CPPFLAGS
|
|
|
|
unexport HOST_CC
|
|
|
|
|
2013-11-14 12:10:08 +01:00
|
|
|
|
|
|
|
all: grub2
|
|
|
|
|
|
|
|
checkout:
|
|
|
|
echo " GIT GRUB2 $(NAME-y)"
|
|
|
|
test -d grub2 || \
|
2016-03-16 19:42:05 +01:00
|
|
|
git clone $(project_git_repo) $(project_dir)
|
2013-11-14 12:10:08 +01:00
|
|
|
cd grub2 && \
|
|
|
|
git checkout master && \
|
|
|
|
git pull; \
|
|
|
|
test -n "$(TAG-y)" && \
|
|
|
|
git branch -f $(NAME-y) $(TAG-y) && \
|
|
|
|
git checkout $(NAME-y) || true
|
|
|
|
|
|
|
|
config: checkout
|
|
|
|
echo " CONFIG GRUB2 $(NAME-y)"
|
|
|
|
rm -rf grub2/build
|
|
|
|
mkdir grub2/build
|
|
|
|
cd grub2 && ./autogen.sh
|
|
|
|
cd grub2/build && ../configure BUILD_CC="$(HOSTCC)" CC="$(HOSTCC)" \
|
|
|
|
TARGET_CC="$(CC)" \
|
2017-01-20 17:30:00 +01:00
|
|
|
TARGET_OBJCOPY="$(OBJCOPY)" TARGET_STRIP="$(STRIP)" CFLAGS=-O2 TARGET_CFLAGS=-Os --with-platform=coreboot \
|
|
|
|
--enable-boot-time
|
2013-11-14 12:10:08 +01:00
|
|
|
|
|
|
|
grub2: config
|
|
|
|
echo " MAKE GRUB2 $(NAME-y)"
|
2013-12-03 18:22:44 +01:00
|
|
|
$(MAKE) -C grub2/build CC="$(HOSTCC)"
|
2016-06-15 21:08:06 +02:00
|
|
|
$(MAKE) -C grub2/build default_payload.elf \
|
|
|
|
EXTRA_PAYLOAD_MODULES="$(CONFIG_GRUB2_EXTRA_MODULES)"
|
2013-11-14 12:10:08 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
test -d grub2 && $(MAKE) -C grub2 clean || exit 0
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
rm -rf grub2
|
|
|
|
|
2016-03-16 19:42:05 +01:00
|
|
|
print-repo-info:
|
|
|
|
echo "$(project_git_repo) $(project_dir)"
|
|
|
|
|
|
|
|
.PHONY: checkout config grub2 clean distclean print-repo-info
|