blob: 5cd89569d75d3724c327863f97c73939307a6271 [file] [log] [blame]
Martin Rothdbae4d02015-12-11 12:24:33 -07001##
2## This file is part of the coreboot project.
3##
4## Copyright (C) 2015 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
Arthur Heymansb524dfc2019-04-12 15:32:24 +020016# 2019-4 tag
17STABLE_COMMIT_ID=3c99166441bf3ea325af2da83cfe65430b49c066
Martin Rothdbae4d02015-12-11 12:24:33 -070018
19TAG-$(CONFIG_UBOOT_MASTER)=origin/master
20TAG-$(CONFIG_UBOOT_STABLE)=$(STABLE_COMMIT_ID)
21
22project_name=U-Boot
23project_dir=u-boot
24project_git_repo=http://git.denx.de/u-boot.git
25project_config_file=$(project_dir)/.config
26
27unexport KCONFIG_AUTOHEADER
28unexport KCONFIG_AUTOCONFIG
29unexport KCONFIG_DEPENDENCIES
30unexport KCONFIG_SPLITCONFIG
31unexport KCONFIG_TRISTATE
32unexport KCONFIG_NEGATIVES
Arthur Heymans52cb8a72019-04-12 15:23:41 +020033unexport $(COREBOOT_EXPORTS)
Martin Rothdbae4d02015-12-11 12:24:33 -070034
35all: build
36
37$(project_dir):
38 echo " Cloning $(project_name) from Git"
39 git clone $(project_git_repo) $(project_dir)
40
41fetch: $(project_dir)
42ifeq ($(CONFIG_UBOOT_MASTER),y)
43 echo " Fetching new commits from the $(project_name) git repo"
44 git fetch
45
46 #master doesn't get a file, so it's continuously updated
47 rm -f $(project_dir)/$(STABLE_COMMIT_ID)
48else
49 cd $(project_dir); git show $(TAG-y) >/dev/null 2>&1 ; if [ $$? -ne 0 ]; \
50 then echo " Fetching new commits from the $(project_name) git repo"; git fetch; fi
51 touch $(project_dir)/$(STABLE_COMMIT_ID)
52endif
53
Arthur Heymansf4af7232019-04-12 15:24:57 +020054checkout: fetch
Martin Rothdbae4d02015-12-11 12:24:33 -070055 echo " Checking out $(project_name) revision $(TAG-y)"
56 cd $(project_dir); git checkout master; git branch -D coreboot 2>/dev/null; git checkout -b coreboot $(TAG-y)
57
Arthur Heymansf4af7232019-04-12 15:24:57 +020058config: checkout
Martin Rothdbae4d02015-12-11 12:24:33 -070059 rm -f $(project_config_file)
60ifneq ($(CONFIG_PAYLOAD_CONFIGFILE),)
61ifneq ("$(wildcard $(CONFIG_PAYLOAD_CONFIGFILE))","")
Martin Roth22aa9e32016-02-22 14:03:13 -080062 cat $(CONFIG_PAYLOAD_CONFIGFILE)" > tag-$(project_config_file)
Martin Rothdbae4d02015-12-11 12:24:33 -070063else
64 echo "Error: File $(CONFIG_PAYLOAD_CONFIGFILE) does not exist"
65 false
66endif
67else
Arthur Heymans89d4a602019-04-12 15:26:33 +020068 cat $(project_dir)/configs/coreboot_defconfig >> $(project_config_file)
Martin Rothdbae4d02015-12-11 12:24:33 -070069endif
70
71 $(MAKE) -C $(project_dir) olddefconfig
72
73build: config
74 echo " MAKE $(project_name) $(TAG-y)"
75 $(MAKE) -C $(project_dir)
76
77clean:
78 test -d $(project_dir) && $(MAKE) -C $(project_dir) clean || exit 0
79
80distclean:
81 rm -rf $(project_dir)
82
Martin Rothae269c02016-03-16 12:42:05 -060083print-repo-info:
84 echo "$(project_git_repo) $(project_dir)"
85
Arthur Heymansf4af7232019-04-12 15:24:57 +020086.PHONY: checkout config build clean distclean fetch print-repo-info