blob: 67c60c1535553370cfcd0dbeab67a716e873be0d [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
16# 2016-1 tag
17STABLE_COMMIT_ID=fa85e826c16b9ce1ad302a57e9c4b24db0d8b930
18
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
33
34all: build
35
36$(project_dir):
37 echo " Cloning $(project_name) from Git"
38 git clone $(project_git_repo) $(project_dir)
39
40fetch: $(project_dir)
41ifeq ($(CONFIG_UBOOT_MASTER),y)
42 echo " Fetching new commits from the $(project_name) git repo"
43 git fetch
44
45 #master doesn't get a file, so it's continuously updated
46 rm -f $(project_dir)/$(STABLE_COMMIT_ID)
47else
48 cd $(project_dir); git show $(TAG-y) >/dev/null 2>&1 ; if [ $$? -ne 0 ]; \
49 then echo " Fetching new commits from the $(project_name) git repo"; git fetch; fi
50 touch $(project_dir)/$(STABLE_COMMIT_ID)
51endif
52
Martin Roth22aa9e32016-02-22 14:03:13 -080053$(project_dir)/tag-$(TAG-y): fetch
Martin Rothdbae4d02015-12-11 12:24:33 -070054 echo " Checking out $(project_name) revision $(TAG-y)"
55 cd $(project_dir); git checkout master; git branch -D coreboot 2>/dev/null; git checkout -b coreboot $(TAG-y)
56
57config: $(project_dir)/$(TAG-y)
58 rm -f $(project_config_file)
59ifneq ($(CONFIG_PAYLOAD_CONFIGFILE),)
60ifneq ("$(wildcard $(CONFIG_PAYLOAD_CONFIGFILE))","")
Martin Roth22aa9e32016-02-22 14:03:13 -080061 cat $(CONFIG_PAYLOAD_CONFIGFILE)" > tag-$(project_config_file)
Martin Rothdbae4d02015-12-11 12:24:33 -070062else
63 echo "Error: File $(CONFIG_PAYLOAD_CONFIGFILE) does not exist"
64 false
65endif
66else
67 cat $(project_dir)/configs/coreboot-x86_defconfig >> $(project_config_file)
68endif
69
70 $(MAKE) -C $(project_dir) olddefconfig
71
72build: config
73 echo " MAKE $(project_name) $(TAG-y)"
74 $(MAKE) -C $(project_dir)
75
76clean:
77 test -d $(project_dir) && $(MAKE) -C $(project_dir) clean || exit 0
78
79distclean:
80 rm -rf $(project_dir)
81
Martin Rothae269c02016-03-16 12:42:05 -060082print-repo-info:
83 echo "$(project_git_repo) $(project_dir)"
84
85.PHONY: config build clean distclean fetch print-repo-info