a1c42cca00
Since the git:// protocol is unencrypted and unauthenticated, there's a security risk associated with using it: A man-in-the-middle attacker could replace e.g. the master branch with malicious code. Mitigate this risk somewhat by cloning GRUB2 via HTTPS. Change-Id: Ice8f8d108e7dfa1a1ecd58d9735944fa9570ace8 Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-on: https://review.coreboot.org/21344 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
52 lines
1.4 KiB
Makefile
52 lines
1.4 KiB
Makefile
TAG-$(CONFIG_GRUB2_MASTER)=
|
|
TAG-$(CONFIG_GRUB2_REVISION)=$(CONFIG_GRUB2_REVISION_ID)
|
|
NAME-$(CONFIG_GRUB2_MASTER)=HEAD
|
|
NAME-$(CONFIG_GRUB2_REVISION)=$(CONFIG_GRUB2_REVISION_ID)
|
|
|
|
project_git_repo=https://git.savannah.gnu.org/git/grub.git/
|
|
project_dir=grub2
|
|
|
|
unexport HOSTCC CC LD OBJCOPY STRIP
|
|
MAKEOVERRIDES :=
|
|
|
|
all: grub2
|
|
|
|
checkout:
|
|
echo " GIT GRUB2 $(NAME-y)"
|
|
test -d grub2 || \
|
|
git clone $(project_git_repo) $(project_dir)
|
|
cd grub2 && \
|
|
git checkout master && \
|
|
git pull; \
|
|
test -n "$(TAG-y)" && \
|
|
git branch -f $(NAME-y) $(TAG-y) && \
|
|
git checkout $(NAME-y) || true
|
|
|
|
grub2/build/config.h: $(CONFIG_DEP) | checkout
|
|
echo " CONFIG GRUB2 $(NAME-y)"
|
|
rm -rf grub2/build
|
|
mkdir grub2/build
|
|
cd grub2 && ./autogen.sh
|
|
cd grub2/build && ../configure CC="$(HOSTCC)" LD="$(LD)" \
|
|
TARGET_CC="$(CC)" TARGET_OBJCOPY="$(OBJCOPY)" TARGET_STRIP="$(STRIP)" \
|
|
CFLAGS=-O2 TARGET_CFLAGS=-Os \
|
|
--with-platform=coreboot --enable-boot-time --disable-werror
|
|
|
|
config: grub2/build/config.h checkout
|
|
|
|
grub2: config
|
|
echo " MAKE GRUB2 $(NAME-y)"
|
|
$(MAKE) -C grub2/build
|
|
$(MAKE) -C grub2/build default_payload.elf \
|
|
EXTRA_PAYLOAD_MODULES="$(CONFIG_GRUB2_EXTRA_MODULES)"
|
|
|
|
clean:
|
|
test -f grub2/build/Makefile && $(MAKE) -C grub2/build clean || exit 0
|
|
|
|
distclean:
|
|
rm -rf grub2
|
|
|
|
print-repo-info:
|
|
echo "$(project_git_repo) $(project_dir)"
|
|
|
|
.PHONY: checkout config grub2 clean distclean print-repo-info
|