nb/intel/sandybridge: Use SA devid to identify PC type
[coreboot2.git] / payloads / external / Memtest86Plus / Makefile
blob8f3205831c41a828a5f80d65f6f52a6421e42015
1 ## SPDX-License-Identifier: GPL-2.0-only
3 project_name=Memtest86+
5 ifeq ($(CONFIG_MEMTEST86PLUS_V6),y)
6 project_dir=$(CURDIR)/memtest86plus_v6
8 ifeq ($(MEMTEST86PLUS_ARCH_64),y)
9 build_dir=$(project_dir)/build64
10 else
11 build_dir=$(project_dir)/build32
12 endif
13 project_git_repo=https://github.com/memtest86plus/memtest86plus.git
14 TAG-$(CONFIG_MEMTEST_MAIN)=origin/main
15 NAME-$(CONFIG_MEMTEST_MAIN)=Main
16 TAG-$(CONFIG_MEMTEST_STABLE)=v6.20
17 NAME-$(CONFIG_MEMTEST_STABLE)=Stable
18 TAG-$(CONFIG_MEMTEST_REVISION)=$(CONFIG_MEMTEST_REVISION_ID)
19 else
20 project_dir=$(CURDIR)/memtest86plus_v5
22 build_dir=$(project_dir)
23 project_git_repo=https://review.coreboot.org/memtest86plus.git
24 TAG-$(CONFIG_MEMTEST_MAIN)=origin/main
25 NAME-$(CONFIG_MEMTEST_MAIN)=Main
26 TAG-$(CONFIG_MEMTEST_STABLE)=0bd34c22604660e4283316331f3e7bf8a3863753
27 NAME-$(CONFIG_MEMTEST_STABLE)=Stable
28 TAG-$(CONFIG_MEMTEST_REVISION)=$(CONFIG_MEMTEST_REVISION_ID)
29 endif
31 all: build
33 $(project_dir):
34 echo " Cloning $(project_name) from Git"
35 git clone $(project_git_repo) $(project_dir)
37 fetch: $(project_dir)
38 ifeq ($(TAG-y),)
39 echo "Error: The specified tag is invalid"
40 ifeq ($(CONFIG_MEMTEST_REVISION),y)
41 echo "Error: There is no revision specified for $(project_name)"
42 false
43 endif
44 false
45 endif
46 -cd $(project_dir) 2>/dev/null; git show $(TAG-y) >/dev/null 2>&1 ; \
47 if [ $$? -ne 0 ] || [ "$(TAG-y)" = "origin/main" ]; then \
48 echo " Fetching new commits from the $(project_name) git repo"; \
49 git fetch; fi
51 checkout: fetch
52 echo " Checking out $(project_name) revision $(NAME-y) ($(TAG-y))"
53 cd $(project_dir); \
54 git checkout main; \
55 git branch -D coreboot 2>/dev/null; \
56 git checkout -b coreboot $(TAG-y)
58 build: checkout
59 echo " MAKE $(project_name) $(NAME-y)"
60 $(MAKE) -C $(build_dir) all
61 ifeq ($(CONFIG_MEMTEST86PLUS_V6),y)
62 cp $(build_dir)/memtest.bin $(project_dir)/memtest
63 endif
65 clean:
66 test -d $(build_dir) && $(MAKE) -C $(build_dir) clean || exit 0
68 distclean:
69 rm -rf $(project_dir)
71 print-repo-info:
72 echo "$(project_git_repo) $(project_dir)"
74 .PHONY: all build checkout check_version clean distclean fetch print-repo-info