Skip to content

Commit

Permalink
Merge pull request #18031 from fjmolinas/pr_pkg_quieter
Browse files Browse the repository at this point in the history
pkg/pkg.mk: silence info if QUIETER
  • Loading branch information
aabadie authored Jun 9, 2022
2 parents 8e1f908 + fc92f31 commit c239f63
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions makefiles/vars.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FLASH_ADDR ?= 0x0
export Q # Used in front of Makefile lines to suppress the printing of the command if user did not opt-in to see them.
export QQ # as Q, but be more quiet
export QUIET # The parameter to use whether to show verbose makefile commands or not.
export QUIETER # The parameter to use to hide most makefile output

export OS # The operating system of the build host
export OS_ARCH # The build host's hardware architecture
Expand Down
4 changes: 2 additions & 2 deletions pkg/c25519/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ all: $(PKG_SOURCE_DIR)/
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/src -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_NAME)

$(PKG_SOURCE_DIR)/: $(PKGDIRBASE)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)
test "$(PKG_SHA512) $(PKG_ZIPFILE)" = "$$(sha512sum "${PKG_ZIPFILE}")"
$(QQ)test "$(PKG_SHA512) $(PKG_ZIPFILE)" = "$$(sha512sum "${PKG_ZIPFILE}")"
$(Q)$(UNZIP_HERE) -D -d $(PKGDIRBASE) $<

$(PKG_ZIPFILE):
mkdir -p $(PKGDIRBASE)
$(QQ)mkdir -p $(PKGDIRBASE)
$(Q)$(DOWNLOAD_TO_FILE) $@ $(PKG_URL)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)

clean::
Expand Down
6 changes: 3 additions & 3 deletions pkg/edhoc-c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ CFLAGS += -Wno-newline-eof
EDHOC_C_MODULES := $(filter edhoc-c_%,$(USEMODULE))

all: $(EDHOC_C_MODULES)
"$(MAKE)" -C $(PKG_SOURCE_DIR)/src -f $(RIOTBASE)/Makefile.base MODULE=edhoc-c
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/src -f $(RIOTBASE)/Makefile.base MODULE=edhoc-c

edhoc-c_crypto_%:
"$(MAKE)" -C $(PKG_SOURCE_DIR)/src/crypto -f $(RIOTBASE)/Makefile.base MODULE=$@ SRC=$*.c
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/src/crypto -f $(RIOTBASE)/Makefile.base MODULE=$@ SRC=$*.c

edhoc-c_cbor_%:
"$(MAKE)" -C $(PKG_SOURCE_DIR)/src/cbor -f $(RIOTBASE)/Makefile.base MODULE=$@ SRC=$*.c
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/src/cbor -f $(RIOTBASE)/Makefile.base MODULE=$@ SRC=$*.c
2 changes: 1 addition & 1 deletion pkg/mynewt-core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ all: $(filter $(MYNEWT_CORE_MODULES),$(USEMODULE))
@true

mynewt-core_%: rm_riot_provided_headers
"$(MAKE)" -C $(PKG_SOURCE_DIR)/$(MYNEWT_CORE_PATH_$*) -f $(RIOTPKG)/$(PKG_NAME)/$@.mk MODULE=$@
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/$(MYNEWT_CORE_PATH_$*) -f $(RIOTPKG)/$(PKG_NAME)/$@.mk MODULE=$@

# The following mynewt-core headers are provided by RIOT, remove them from
# mynewt-core include paths to avoid header conflicts
Expand Down
19 changes: 10 additions & 9 deletions pkg/pkg.mk
Original file line number Diff line number Diff line change
Expand Up @@ -111,40 +111,41 @@ gen_dependency_files = $(file >$1,$@: $2)$(foreach f,$2,$(file >>$1,$(f):))
# * checkout the wanted base commit
# * apply patches if there are any. (If none, it does nothing)
$(PKG_PATCHED): $(PKG_PATCHED_PREREQUISITES)
$(info [INFO] patch $(PKG_NAME))
$(if $(QUIETER),,$(info [INFO] patch $(PKG_NAME)))
$(call gen_dependency_files,$@.d,$(PKG_PATCHED_PREREQUISITES))
$(Q)$(GIT_IN_PKG) clean $(GIT_QUIET) -xdff '**' -e $(PKG_STATE:$(PKG_SOURCE_DIR)/%='%*')
$(Q)$(GIT_IN_PKG) checkout $(GIT_QUIET) -f $(PKG_VERSION)
$(Q) if test -n "$(PKG_PATCHES)" ; then \
$(GIT_IN_PKG) $(GITFLAGS) am $(GITAMFLAGS) $(PKG_PATCHES) ; \
fi
@touch $@
$(Q)touch $@

$(PKG_DOWNLOADED): $(MAKEFILE_LIST) | $(PKG_SOURCE_DIR)/.git
$(info [INFO] updating $(PKG_NAME) $(PKG_DOWNLOADED))
$(if $(QUIETER),,$(info [INFO] updating $(PKG_NAME) $(PKG_DOWNLOADED)))
$(Q)if ! $(GIT_IN_PKG) cat-file -e $(PKG_VERSION); then \
printf "[INFO] fetching new $(PKG_NAME) version "$(PKG_VERSION)"\n"; \
$(if $(QUIETER),,printf "[INFO] fetching new $(PKG_NAME) version "$(PKG_VERSION)"\n";) \
$(GIT_IN_PKG) fetch $(GIT_QUIET) "$(PKG_URL)" "$(PKG_VERSION)"; \
fi
echo $(PKG_VERSION) > $@
$(Q)echo $(PKG_VERSION) > $@

ifeq ($(GIT_CACHE_DIR),$(wildcard $(GIT_CACHE_DIR)))
$(PKG_SOURCE_DIR)/.git: | $(PKG_CUSTOM_PREPARED)
$(info [INFO] cloning $(PKG_NAME))
$(if $(QUIETER),,$(info [INFO] cloning $(PKG_NAME)))
$(Q)rm -Rf $(PKG_SOURCE_DIR)
$(Q)mkdir -p $(PKG_SOURCE_DIR)
$(Q)$(GITCACHE) clone $(PKG_URL) $(PKG_VERSION) $(PKG_SOURCE_DIR)
else
# redirect stderr so git sees a pipe and not a terminal see https://github.com/git/git/blob/master/progress.c#L138
$(PKG_SOURCE_DIR)/.git: | $(PKG_CUSTOM_PREPARED)
$(info [INFO] cloning without cache $(PKG_NAME))
$(if $(QUIETER),,$(info [INFO] cloning without cache $(PKG_NAME)))
$(Q)rm -Rf $(PKG_SOURCE_DIR)
$(Q)mkdir -p $(PKG_SOURCE_DIR)
$(Q)git init -q $(PKG_SOURCE_DIR)
$(Q)git init $(GIT_QUIET) $(PKG_SOURCE_DIR)
$(Q)$(GIT_IN_PKG) remote add origin $(PKG_URL)
$(Q)$(GIT_IN_PKG) config extensions.partialClone origin
$(Q)$(GIT_IN_PKG) config advice.detachedHead false
$(Q)$(GIT_IN_PKG) fetch $(GIT_QUIET) --depth=1 -t --filter=blob:none origin $(PKG_VERSION)
$(Q)$(GIT_IN_PKG) checkout $(GIT_QUIET) $(PKG_VERSION)
$(Q)$(GIT_IN_PKG) checkout $(GIT_QUIET) $(PKG_VERSION) 2>&1 | cat
endif

ifeq ($(PKG_SOURCE_DIR),$(PKG_BUILD_DIR))
Expand Down

0 comments on commit c239f63

Please sign in to comment.