From df6f8926c2c7b3c21d87ddfefd9ecd7f1d25ddd3 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Wed, 23 Sep 2015 17:34:45 +1000 Subject: Makefile: add cleanup-deps-style to reorder deps --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 '' > $@ @echo '' >> $@ -- cgit v0.12