From bac717407f38bbdc467fcb1eb501c8938113df42 Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Tue, 31 Jan 2017 11:56:14 -0500 Subject: [PATCH] Patch git checkouts, if a patch exists for a module. Add a per-module clean target. --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index f2aa2aa..6144f0f 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,10 @@ define define_module = # this case, since we don't have a stable version to compare against. $(build)/$($1_dir)/.canary: git clone "$($1_repo)" "$(build)/$($1_dir)" + if [ -r patches/$1.patch ]; then \ + ( cd $(build)/$($1_dir) ; patch -p1 ) \ + < patches/$1.patch; \ + fi touch "$$@" else # Fetch and verify the source tar file @@ -122,6 +126,10 @@ define define_module = $(build)/$($1_dir)/.configured $(MAKE) -C "$(build)/$($1_dir)" $($1_target) + $1.clean: + -$(RM) "$(build)/$($1_dir)/.configured + -$(MAKE) -C "$(build)/$($1_dir)" clean + .INTERMEDIATE: $1.intermediate endef