Martin Roth | dbae4d0 | 2015-12-11 12:24:33 -0700 | [diff] [blame] | 1 | ## |
| 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 |
| 17 | STABLE_COMMIT_ID=fa85e826c16b9ce1ad302a57e9c4b24db0d8b930 |
| 18 | |
| 19 | TAG-$(CONFIG_UBOOT_MASTER)=origin/master |
| 20 | TAG-$(CONFIG_UBOOT_STABLE)=$(STABLE_COMMIT_ID) |
| 21 | |
| 22 | project_name=U-Boot |
| 23 | project_dir=u-boot |
| 24 | project_git_repo=http://git.denx.de/u-boot.git |
| 25 | project_config_file=$(project_dir)/.config |
| 26 | |
| 27 | unexport KCONFIG_AUTOHEADER |
| 28 | unexport KCONFIG_AUTOCONFIG |
| 29 | unexport KCONFIG_DEPENDENCIES |
| 30 | unexport KCONFIG_SPLITCONFIG |
| 31 | unexport KCONFIG_TRISTATE |
| 32 | unexport KCONFIG_NEGATIVES |
| 33 | |
| 34 | all: build |
| 35 | |
| 36 | $(project_dir): |
| 37 | echo " Cloning $(project_name) from Git" |
| 38 | git clone $(project_git_repo) $(project_dir) |
| 39 | |
| 40 | fetch: $(project_dir) |
| 41 | ifeq ($(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) |
| 47 | else |
| 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) |
| 51 | endif |
| 52 | |
Martin Roth | 22aa9e3 | 2016-02-22 14:03:13 -0800 | [diff] [blame] | 53 | $(project_dir)/tag-$(TAG-y): fetch |
Martin Roth | dbae4d0 | 2015-12-11 12:24:33 -0700 | [diff] [blame] | 54 | 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 | |
| 57 | config: $(project_dir)/$(TAG-y) |
| 58 | rm -f $(project_config_file) |
| 59 | ifneq ($(CONFIG_PAYLOAD_CONFIGFILE),) |
| 60 | ifneq ("$(wildcard $(CONFIG_PAYLOAD_CONFIGFILE))","") |
Martin Roth | 22aa9e3 | 2016-02-22 14:03:13 -0800 | [diff] [blame] | 61 | cat $(CONFIG_PAYLOAD_CONFIGFILE)" > tag-$(project_config_file) |
Martin Roth | dbae4d0 | 2015-12-11 12:24:33 -0700 | [diff] [blame] | 62 | else |
| 63 | echo "Error: File $(CONFIG_PAYLOAD_CONFIGFILE) does not exist" |
| 64 | false |
| 65 | endif |
| 66 | else |
| 67 | cat $(project_dir)/configs/coreboot-x86_defconfig >> $(project_config_file) |
| 68 | endif |
| 69 | |
| 70 | $(MAKE) -C $(project_dir) olddefconfig |
| 71 | |
| 72 | build: config |
| 73 | echo " MAKE $(project_name) $(TAG-y)" |
| 74 | $(MAKE) -C $(project_dir) |
| 75 | |
| 76 | clean: |
| 77 | test -d $(project_dir) && $(MAKE) -C $(project_dir) clean || exit 0 |
| 78 | |
| 79 | distclean: |
| 80 | rm -rf $(project_dir) |
| 81 | |
Martin Roth | ae269c0 | 2016-03-16 12:42:05 -0600 | [diff] [blame] | 82 | print-repo-info: |
| 83 | echo "$(project_git_repo) $(project_dir)" |
| 84 | |
| 85 | .PHONY: config build clean distclean fetch print-repo-info |