From ab4d151a6a5db80f1e4828a2fc081e70cc8f539c Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 19 Mar 2014 16:17:36 +0100 Subject: [PATCH] improve Makefile.git Change the example Makefile.git as suggested in #895 abort when a patch fails to apply fix build with GNU Make 4.0 reset git to the specified version instead of checking out a detached head --- pkg/Makefile.git | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/Makefile.git b/pkg/Makefile.git index 38e4e00eb9..01b9bc51a3 100644 --- a/pkg/Makefile.git +++ b/pkg/Makefile.git @@ -20,11 +20,11 @@ patch: $(CURDIR)/$(PKG_NAME)/Makefile $(CURDIR)/$(PKG_NAME)/Makefile: $(CURDIR)/$(PKG_NAME) # Here you apply your patch. - $(foreach patch,$(shell ls [0-9][0-9][0-9][0-9]*.patch),cd "$<" && git am "$(patch)";) + $(foreach patch,$(shell ls [0-9][0-9][0-9][0-9]*.patch),cd "$<" && git am "$(patch)" || { git am --abort; exit 1; };) -$(PKG_NAME)/: +$(PKG_NAME): # Get PKG_VERSION of package from PKG_URL - git clone $(PKG_URL) $(PKG_NAME) && cd $(PKG_NAME) && git checkout $(PKG_VERSION) + git clone $(PKG_URL) $(PKG_NAME) && cd $(PKG_NAME) && git reset --hard $(PKG_VERSION) clean:: # Reset package to checkout state.