Skip to content

Commit

Permalink
improve Makefile.git
Browse files Browse the repository at this point in the history
Change the example Makefile.git as suggested in RIOT-OS#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
  • Loading branch information
benpicco authored and kaspar030 committed Apr 3, 2014
1 parent a41d455 commit 2e3bba2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/Makefile.git
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2e3bba2

Please sign in to comment.