From a9a98cf8ebc4d823639ff13fdd09762c1eea8009 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 17 Jan 2018 12:25:46 +0100 Subject: [PATCH] - environment.mk: add define to apply patch sets; shameless stolen from DDT --- make/environment.mk | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/make/environment.mk b/make/environment.mk index 12d16f36..7351143f 100644 --- a/make/environment.mk +++ b/make/environment.mk @@ -336,3 +336,24 @@ define local-script $(LOCAL_DIR)/scripts/$(1) $(2) $(TARGET_DIR) $(BUILD_TMP); \ fi endef + +# apply patch sets +define apply_patches + for i in $(1); do \ + if [ -d $$i ]; then \ + for p in $$i/*; do \ + if [ $${p:0:1} == "/" ]; then \ + patch -p1 -i $$p; \ + else \ + $(PATCH)/$$p; \ + fi; \ + done; \ + else \ + if [ $${i:0:1} == "/" ]; then \ + patch -p1 -i $$i; \ + else \ + $(PATCH)/$$i; \ + fi; \ + fi; \ + done +endef