2019-10-26 00:06:42 +02:00
|
|
|
TAG-$(CONFIG_GRUB2_MASTER)=origin/HEAD
|
2016-09-14 14:41:36 +02:00
|
|
|
TAG-$(CONFIG_GRUB2_REVISION)=$(CONFIG_GRUB2_REVISION_ID)
|
2019-07-06 09:53:01 +02:00
|
|
|
TAG-$(CONFIG_GRUB2_STABLE)=grub-2.04
|
2013-11-14 12:10:08 +01:00
|
|
|
NAME-$(CONFIG_GRUB2_MASTER)=HEAD
|
2016-09-14 14:41:36 +02:00
|
|
|
NAME-$(CONFIG_GRUB2_REVISION)=$(CONFIG_GRUB2_REVISION_ID)
|
2019-07-06 09:53:01 +02:00
|
|
|
NAME-$(CONFIG_GRUB2_STABLE)=2.04
|
2013-11-14 12:10:08 +01:00
|
|
|
|
2017-09-02 20:34:53 +02:00
|
|
|
project_git_repo=https://git.savannah.gnu.org/git/grub.git/
|
2016-03-16 19:42:05 +01:00
|
|
|
project_dir=grub2
|
|
|
|
|
2017-08-14 01:38:24 +02:00
|
|
|
unexport HOSTCC CC LD OBJCOPY STRIP
|
|
|
|
MAKEOVERRIDES :=
|
2013-11-14 12:10:08 +01:00
|
|
|
|
|
|
|
all: grub2
|
|
|
|
|
|
|
|
checkout:
|
|
|
|
echo " GIT GRUB2 $(NAME-y)"
|
2019-10-26 00:06:42 +02:00
|
|
|
test -d $(project_dir) || git clone $(project_git_repo) $(project_dir)
|
|
|
|
git -C $(project_dir) fetch
|
2019-11-11 15:52:55 +01:00
|
|
|
ifeq ("$(shell test -d $(project_dir) && \
|
|
|
|
(git -C $(project_dir) status --ignored=no --untracked-files=no --porcelain))",)
|
2019-10-26 00:06:42 +02:00
|
|
|
git -C $(project_dir) checkout -f $(TAG-y)
|
|
|
|
else
|
|
|
|
echo "WARNING: index/tree not clean, skipping update / force checkout."
|
|
|
|
echo " Checkout manually with `git -C $(project_dir) checkout -f`."
|
|
|
|
endif
|
2013-11-14 12:10:08 +01:00
|
|
|
|
2017-08-14 01:58:28 +02:00
|
|
|
grub2/build/config.h: $(CONFIG_DEP) | checkout
|
2013-11-14 12:10:08 +01:00
|
|
|
echo " CONFIG GRUB2 $(NAME-y)"
|
|
|
|
rm -rf grub2/build
|
|
|
|
mkdir grub2/build
|
2019-07-16 13:44:48 +02:00
|
|
|
cd grub2 && ./bootstrap ; ./autogen.sh
|
2017-08-14 01:38:24 +02:00
|
|
|
cd grub2/build && ../configure CC="$(HOSTCC)" LD="$(LD)" \
|
2018-06-04 11:42:39 +02:00
|
|
|
FREETYPE="pkg-config freetype2" BUILD_FREETYPE="pkg-config freetype2" \
|
2017-08-14 01:38:24 +02:00
|
|
|
TARGET_CC="$(CC)" TARGET_OBJCOPY="$(OBJCOPY)" TARGET_STRIP="$(STRIP)" \
|
|
|
|
CFLAGS=-O2 TARGET_CFLAGS=-Os \
|
|
|
|
--with-platform=coreboot --enable-boot-time --disable-werror
|
2013-11-14 12:10:08 +01:00
|
|
|
|
2017-08-14 01:58:28 +02:00
|
|
|
config: grub2/build/config.h checkout
|
|
|
|
|
2013-11-14 12:10:08 +01:00
|
|
|
grub2: config
|
|
|
|
echo " MAKE GRUB2 $(NAME-y)"
|
2017-08-14 01:38:24 +02:00
|
|
|
$(MAKE) -C grub2/build
|
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:
|
2017-08-14 01:38:24 +02:00
|
|
|
test -f grub2/build/Makefile && $(MAKE) -C grub2/build clean || exit 0
|
2013-11-14 12:10:08 +01:00
|
|
|
|
|
|
|
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
|