nb/intel/sandybridge: Use SA devid to identify PC type
[coreboot2.git] / payloads / external / GRUB2 / Makefile
blob1691e9b23ebf7a04cda907faa46b82fae510e569
1 TAG-$(CONFIG_GRUB2_MASTER)=origin/HEAD
2 TAG-$(CONFIG_GRUB2_REVISION)=$(CONFIG_GRUB2_REVISION_ID)
3 TAG-$(CONFIG_GRUB2_STABLE)=grub-2.06
4 NAME-$(CONFIG_GRUB2_MASTER)=HEAD
5 NAME-$(CONFIG_GRUB2_REVISION)=$(CONFIG_GRUB2_REVISION_ID)
6 NAME-$(CONFIG_GRUB2_STABLE)=2.06
8 project_git_repo=https://git.savannah.gnu.org/git/grub.git/
9 project_dir=grub2
11 unexport HOSTCC CC LD OBJCOPY STRIP
12 MAKEOVERRIDES :=
14 all: grub2
16 checkout:
17 echo " GIT GRUB2 $(NAME-y)"
18 test -d $(project_dir) || git clone $(project_git_repo) $(project_dir)
19 git -C $(project_dir) fetch
20 ifeq ($(shell test -d $(project_dir) && \
21 (git -C $(project_dir) status --ignored=no --untracked-files=no --porcelain)),)
22 git -C $(project_dir) checkout -f $(TAG-y)
23 else
24 echo "WARNING: index/tree not clean, skipping update / force checkout."
25 echo " Checkout manually with "\
26 "\`git -C payloads/external/GRUB2/$(project_dir) checkout -f\`."
27 endif
29 grub2/build/config.h: $(CONFIG_DEP) | checkout
30 echo " CONFIG GRUB2 $(NAME-y)"
31 rm -rf grub2/build
32 mkdir grub2/build
33 cd grub2 && ./bootstrap ; ./autogen.sh
34 cd grub2/build && ../configure CC="$(HOSTCC)" LD="$(LD)" \
35 FREETYPE="pkg-config freetype2" BUILD_FREETYPE="pkg-config freetype2" \
36 TARGET_CC="$(CC)" TARGET_OBJCOPY="$(OBJCOPY)" TARGET_STRIP="$(STRIP)" \
37 CFLAGS=-O2 TARGET_CFLAGS="-Os -fno-reorder-functions" \
38 --with-platform=coreboot --enable-boot-time --disable-werror
40 config: grub2/build/config.h checkout
42 grub2: config
43 echo " MAKE GRUB2 $(NAME-y)"
44 $(MAKE) -C grub2/build
45 $(MAKE) -C grub2/build default_payload.elf \
46 EXTRA_PAYLOAD_MODULES="$(CONFIG_GRUB2_EXTRA_MODULES)"
48 clean:
49 test -f grub2/build/Makefile && $(MAKE) -C grub2/build clean || exit 0
51 distclean:
52 rm -rf grub2
54 print-repo-info:
55 echo "$(project_git_repo) $(project_dir)"
57 .PHONY: checkout config grub2 clean distclean print-repo-info