Browse Source

- move defines to helpers.mk

master
vanhofen 6 years ago
parent
commit
39f50c2417
  1. 31
      make/environment-build.mk
  2. 35
      make/helpers.mk

31
make/environment-build.mk

@ -384,34 +384,3 @@ TUXBOX_LIBSTB-HAL = library-stb-hal
TUXBOX_REMOTE_REPO = tuxbox
TANGO_REMOTE_REPO = tango
# execute local scripts
define local-script
@if [ -x $(LOCAL_DIR)/scripts/$(1) ]; then \
$(LOCAL_DIR)/scripts/$(1) $(2) $(TARGET_DIR) $(BUILD_TMP); \
fi
endef
# apply patch sets
define apply_patches
l=`echo $(2)`; test -z $$l && l=1; \
for i in $(1); do \
if [ -d $$i ]; then \
for p in $$i/*; do \
echo -e "$(TERM_YELLOW)Applying $$p$(TERM_NORMAL)"; \
if [ $${p:0:1} == "/" ]; then \
patch -p$$l -i $$p; \
else \
patch -p$$l -i $(PATCHES)/$$p; \
fi; \
done; \
else \
echo -e "$(TERM_YELLOW)Applying $$i$(TERM_NORMAL)"; \
if [ $${i:0:1} == "/" ]; then \
patch -p$$l -i $$i; \
else \
patch -p$$l -i $(PATCHES)/$$i; \
fi; \
fi; \
done
endef

35
make/helpers.mk

@ -3,6 +3,41 @@
#
# -----------------------------------------------------------------------------
# execute local scripts
define local-script
@if [ -x $(LOCAL_DIR)/scripts/$(1) ]; then \
$(LOCAL_DIR)/scripts/$(1) $(2) $(TARGET_DIR) $(BUILD_TMP); \
fi
endef
# -----------------------------------------------------------------------------
# apply patch sets
define apply_patches
l=`echo $(2)`; test -z $$l && l=1; \
for i in $(1); do \
if [ -d $$i ]; then \
for p in $$i/*; do \
echo -e "$(TERM_YELLOW)Applying $$p$(TERM_NORMAL)"; \
if [ $${p:0:1} == "/" ]; then \
patch -p$$l -i $$p; \
else \
patch -p$$l -i $(PATCHES)/$$p; \
fi; \
done; \
else \
echo -e "$(TERM_YELLOW)Applying $$i$(TERM_NORMAL)"; \
if [ $${i:0:1} == "/" ]; then \
patch -p$$l -i $$i; \
else \
patch -p$$l -i $(PATCHES)/$$i; \
fi; \
fi; \
done
endef
# -----------------------------------------------------------------------------
archives-list:
@rm -f $(BUILD_TMP)/$@
@make -qp | grep --only-matching '^\$(ARCHIVE).*:' | sed "s|:||g" > $(BUILD_TMP)/$@

Loading…
Cancel
Save