Browse Source

- add Q and KBUILD_VERBOSE

master
vanhofen 4 years ago
parent
commit
b225f6cd54
  1. 21
      Makefile
  2. 9
      make/buildsystem-helpers.mk

21
Makefile

@ -31,10 +31,29 @@ export CDPATH :=
# determinism and reproducibility with top-level parallel build. # determinism and reproducibility with top-level parallel build.
.NOTPARALLEL: .NOTPARALLEL:
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands
ifeq ("$(origin V)", "command line")
KBUILD_VERBOSE = $(V)
endif
ifndef KBUILD_VERBOSE
KBUILD_VERBOSE = 0
endif
ifeq ($(KBUILD_VERBOSE),1)
Q =
ifndef VERBOSE
VERBOSE = 1
endif
export VERBOSE
else
Q = @
endif
# kconfig uses CONFIG_SHELL # kconfig uses CONFIG_SHELL
CONFIG_SHELL := $(SHELL) CONFIG_SHELL := $(SHELL)
export SHELL CONFIG_SHELL export SHELL CONFIG_SHELL Q KBUILD_VERBOSE
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

9
make/buildsystem-helpers.mk

@ -180,13 +180,16 @@ REWRITE_LIBTOOL_RULES = "s,^libdir=.*,libdir='$(1)',; \
REWRITE_LIBTOOL_TAG = rewritten=1 REWRITE_LIBTOOL_TAG = rewritten=1
define rewrite_libtool # (libdir) define rewrite_libtool # (libdir)
@#$(call MESSAGE,"Fixing libtool files in $(subst $(TARGET_DIR)/,,$(1))")
$(Q)( \
for la in $$(find $(1) -name "*.la" -type f); do \ for la in $$(find $(1) -name "*.la" -type f); do \
if ! grep -q "$(REWRITE_LIBTOOL_TAG)" $${la}; then \ if ! grep -q "$(REWRITE_LIBTOOL_TAG)" $${la}; then \
$(call MESSAGE,"Rewriting $${la#$(TARGET_DIR)/}"); \ $(call MESSAGE,"Rewriting $${la#$(TARGET_DIR)/}"); \
$(SED) $(REWRITE_LIBTOOL_RULES) $${la}; \ $(SED) $(REWRITE_LIBTOOL_RULES) $${la}; \
echo -e "\n# Adapted to buildsystem\n$(REWRITE_LIBTOOL_TAG)" >> $${la}; \ echo -e "\n# Adapted to buildsystem\n$(REWRITE_LIBTOOL_TAG)" >> $${la}; \
fi; \ fi; \
done done; \
)
endef endef
# rewrite libtool libraries automatically # rewrite libtool libraries automatically
@ -202,9 +205,11 @@ REWRITE_CONFIG_RULES = "s,^prefix=.*,prefix='$(TARGET_prefix)',; \
s,^includedir=.*,includedir='$(TARGET_includedir)'," s,^includedir=.*,includedir='$(TARGET_includedir)',"
define rewrite_config_script # (config-script) define rewrite_config_script # (config-script)
$(Q)( \
mv $(TARGET_bindir)/$(1) $(HOST_DIR)/bin; \ mv $(TARGET_bindir)/$(1) $(HOST_DIR)/bin; \
$(call MESSAGE,"Rewriting $(1)"); \ $(call MESSAGE,"Rewriting $(1)"); \
$(SED) $(REWRITE_CONFIG_RULES) $(HOST_DIR)/bin/$(1) $(SED) $(REWRITE_CONFIG_RULES) $(HOST_DIR)/bin/$(1); \
)
endef endef
# rewrite config scripts automatically # rewrite config scripts automatically

Loading…
Cancel
Save