<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21163">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">[WIP] payloads/external: Provide generic Makefile.git<br><br>Provide a Makefile.git to be included by payloads built from Git.<br>Featuring:<br><br>* Offline mode, e.g. don't care if a later fetch failed.<br>* Fetching of origin, including tags and branch updates.<br>* Simplyfied checkout:<br>  Should work with commit hashes, local/remote branches and tags.<br>* Patch application, ported from tianocore, untested.<br>* Unexporting of variables exported by coreboot:<br>  No more sub-make confusion!<br>* The usual boilerplate.<br><br>Change-Id: I7557ca81fa1e32cd5c17c757e9458d048ff1ec99<br>Signed-off-by: Nico Huber <nico.h@gmx.de><br>---<br>A payloads/external/Makefile.git<br>1 file changed, 64 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/21163/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/payloads/external/Makefile.git b/payloads/external/Makefile.git<br>new file mode 100644<br>index 0000000..560991c<br>--- /dev/null<br>+++ b/payloads/external/Makefile.git<br>@@ -0,0 +1,64 @@<br>+##<br>+## This file is part of the coreboot project.<br>+##<br>+## Copyright (C) 2017 Nico Huber <nico.h@gmx.de><br>+##<br>+## This program is free software; you can redistribute it and/or modify<br>+## it under the terms of the GNU General Public License as published by<br>+## the Free Software Foundation; version 2 of the License.<br>+##<br>+## This program is distributed in the hope that it will be useful,<br>+## but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+## GNU General Public License for more details.<br>+##<br>+<br>+project_rev    := $(if $(strip $(project_rev)),$(project_rev),origin/master)<br>+project_dir     := $(abspath $(project_dir))<br>+project_patches  ?= $(wildcard $(CURDIR)/patches/*.patch)<br>+<br>+unexport $(COREBOOT_EXPORTS)<br>+MAKEOVERRIDES :=<br>+<br>+all: $(project_output)<br>+<br>+$(project_dir)/.git:<br>+  printf "    CLONE       $(project_name) into $(project_dir)\n"<br>+     git clone "$(project_repo)" "$(project_dir)"<br>+<br>+fetch: $(project_dir)/.git<br>+     -cd "$(project_dir)" && git fetch origin<br>+<br>+checkout: fetch<br>+      cd "$(project_dir)" && \<br>+   if ! git diff --quiet _cb_checkout "$(project_rev)" -- 2>/dev/null; \<br>+   then \<br>+               printf "    CHECKOUT    $(project_name) [$(project_rev)]\n"; \<br>+             git checkout $$(git rev-parse HEAD) >/dev/null 2>&1; \<br>+             git branch -f _cb_checkout "$(project_rev)" && \<br>+           git checkout _cb_checkout && \<br>+               $(if $(project_patches), \<br>+           for patch in $(project_patches); do \<br>+                        printf "    PATCH       $$patch\n"; \<br>+                      git am --keep-cr "$$patch" || \<br>+                            ( printf "Error when applying patches.\n"; \<br>+                                 git am --abort; exit 1; ); \<br>+               done;,true;) \<br>+       fi<br>+<br>+$(project_output): checkout<br>+  printf "    MAKE        $(project_name) [$(project_rev)]\n"<br>+        $(MAKE) -C"$(dir $(project_output))" $(project_params)<br>+<br>+clean:<br>+ if [ -f "$(dir $(project_output))Makefile" ]; then \<br>+               $(MAKE) -C $(dir $(project_output)) clean || true; \<br>+ fi<br>+<br>+distclean:<br>+   rm -rf $(project_dir)<br>+<br>+print-repo-info:<br>+  printf "$(project_repo) $(project_dir)\n"<br>+<br>+.PHONY: all fetch checkout clean distclean print-repo-info<br></pre><p>To view, visit <a href="https://review.coreboot.org/21163">change 21163</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21163"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I7557ca81fa1e32cd5c17c757e9458d048ff1ec99 </div>
<div style="display:none"> Gerrit-Change-Number: 21163 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>