summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5d5a937..b6cb0ac 100644
--- a/Makefile
+++ b/Makefile
@@ -567,6 +567,19 @@ endef
cleanup-style:
$(foreach FILE,$(wildcard $(addprefix $(TOP_DIR)/,Makefile index.html CNAME src/*.mk src/*test.* tools/*)),$(call CLEANUP_STYLE,$(FILE)))
+.PHONY: cleanup-deps-style
+cleanup-deps-style:
+ @grep '(PKG)_DEPS.*\\' '$(TOP_DIR)'/src/*.mk > $(TOP_DIR)/tmp-$@-pre
+ @$(foreach PKG,$(PKGS), \
+ $(if $(call lne,$(sort $(filter-out gcc,$($(PKG)_DEPS))),$(filter-out gcc,$($(PKG)_DEPS))), \
+ $(info [cleanup] $(PKG)) \
+ $(SED) -i 's/^\([^ ]*_DEPS *:=\).*/\1 '"$(strip $(filter gcc,$($(PKG)_DEPS)) $(sort $(filter-out gcc,$($(PKG)_DEPS))))"'/' '$(TOP_DIR)/src/$(PKG).mk'; \
+ ))
+ @grep '(PKG)_DEPS.*\\' '$(TOP_DIR)'/src/*.mk > $(TOP_DIR)/tmp-$@-post
+ @diff -u $(TOP_DIR)/tmp-$@-pre $(TOP_DIR)/tmp-$@-post >/dev/null \
+ || echo '*** Multi-line deps are mangled ***' && comm -3 tmp-$@-pre tmp-$@-post
+ @rm -f $(TOP_DIR)/tmp-$@-*
+
build-matrix.html: $(foreach PKG,$(PKGS), $(TOP_DIR)/src/$(PKG).mk)
@echo '<!DOCTYPE html>' > $@
@echo '<html>' >> $@