blob: ec3c9c5767d737f6110231189fff82fda3089b08 [file] [log] [blame]
Martin Rothf2c3d802018-09-13 04:06:39 -06001##
2## This file is part of the coreboot project.
3##
4## Copyright (C) 2016 Google Inc.
5##
6## This program is free software; you can redistribute it and/or modify
7## it under the terms of the GNU General Public License as published by
8## the Free Software Foundation; version 2 of the License.
9##
10## This program is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13## GNU General Public License for more details.
14##
15
16TAG-$(CONFIG_YABITS_MASTER)=origin/master
17NAME-$(CONFIG_YABITS_MASTER)=Master
18TAG-$(CONFIG_YABITS_STABLE)=d25abb067431dee9af9f8a874a209730ab7f0e91
19NAME-$(CONFIG_YABITS_STABLE)=Stable
20TAG-$(CONFIG_YABITS_REVISION)=$(CONFIG_YABITS_REVISION_ID)
21
22project_name=Yabits
23project_dir=$(CURDIR)/uefi
24project_git_repo=https://github.com/yabits/uefi.git
25LIBCONFIG_PATH="../../../libpayload"
26
27all: build
28
29$(project_dir):
30 echo " Cloning $(project_name) from Git"
31 git clone $(project_git_repo) $(project_dir)
32
33fetch: $(project_dir)
34ifeq ($(TAG-y),)
35 echo "Error: The specified tag is invalid"
36ifeq ($(CONFIG_YABITS_REVISION),y)
37 echo "Error: There is no revision specified for $(project_name)"
38 false
39endif
40 false
41endif
42 -cd $(project_dir); git show $(TAG-y) >/dev/null 2>&1 ; \
43 if [ $$? -ne 0 ] || [ "$(TAG-y)" = "origin/master" ]; then \
44 echo " Fetching new commits from the $(project_name) git repo"; \
45 git fetch; fi
46
47checkout: fetch
48 echo " Checking out $(project_name) revision $(NAME-y) ($(TAG-y))"
49 cd $(project_dir); \
50 git checkout master; \
51 git branch -D coreboot 2>/dev/null; \
52 git checkout -b coreboot $(TAG-y)
53
54build: checkout
55 echo " MAKE $(project_name) $(NAME-y)"
56 $(if $(wildcard uefi/.xcompile),,$(shell bash ../../../util/xcompile/xcompile > uefi/.xcompile))
57 $(MAKE) -C $(project_dir) defconfig LIBCONFIG_PATH=$(LIBCONFIG_PATH) XGCC=$(XGCCPATH)
58 $(MAKE) -C $(project_dir) all LIBCONFIG_PATH=$(LIBCONFIG_PATH) XGCC=$(XGCCPATH)
59
60clean:
61 test -d $(project_dir) && $(MAKE) -C $(project_dir) clean LIBCONFIG_PATH=$(LIBCONFIG_PATH) XGCC=$(XGCCPATH) || exit 0
62
63distclean:
64 rm -rf $(project_dir)
65
66print-repo-info:
67 echo "$(project_git_repo) $(project_dir)"
68
69.PHONY: all build checkout clean distclean fetch print-repo-info