Replace $(AT) with .SILENCE.

This reduces the amount of syntax noise in the makefiles.
This commit is contained in:
Dmitry Goncharov 2021-06-19 12:09:11 -04:00
parent d3474b8df2
commit 8494dcae0e
2 changed files with 49 additions and 52 deletions

View file

@ -102,10 +102,6 @@ host_prefix=$($(host_arch)_$(host_os)_prefix)
build_prefix=$(host_prefix)/native build_prefix=$(host_prefix)/native
build_host=$(build) build_host=$(build)
AT_$(V):=
AT_:=@
AT:=$(AT_$(V))
all: install all: install
include hosts/$(host_os).mk include hosts/$(host_os).mk
@ -178,12 +174,12 @@ include funcs.mk
final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in) final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)) final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))
$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages) $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
$(AT)rm -rf $(@D) rm -rf $(@D)
$(AT)mkdir -p $(@D) mkdir -p $(@D)
$(AT)echo copying packages: $^ echo copying packages: $^
$(AT)echo to: $(@D) echo to: $(@D)
$(AT)cd $(@D); $(foreach package,$^, tar xf $($(package)_cached); ) cd $(@D); $(foreach package,$^, tar xf $($(package)_cached); )
$(AT)touch $@ touch $@
# $PATH is not preserved between ./configure and make by convention. Its # $PATH is not preserved between ./configure and make by convention. Its
# modification and overriding at ./configure time is (as I understand it) # modification and overriding at ./configure time is (as I understand it)
@ -210,8 +206,8 @@ $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
# we expect them to be available in $PATH at all times, more specificity does # we expect them to be available in $PATH at all times, more specificity does
# not hurt. # not hurt.
$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id) $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id)
$(AT)@mkdir -p $(@D) @mkdir -p $(@D)
$(AT)sed -e 's|@HOST@|$(host)|' \ sed -e 's|@HOST@|$(host)|' \
-e 's|@CC@|$(host_CC)|' \ -e 's|@CC@|$(host_CC)|' \
-e 's|@CXX@|$(host_CXX)|' \ -e 's|@CXX@|$(host_CXX)|' \
-e 's|@AR@|$(host_AR)|' \ -e 's|@AR@|$(host_AR)|' \
@ -236,7 +232,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
-e 's|@multiprocess@|$(MULTIPROCESS)|' \ -e 's|@multiprocess@|$(MULTIPROCESS)|' \
-e 's|@debug@|$(DEBUG)|' \ -e 's|@debug@|$(DEBUG)|' \
$< > $@ $< > $@
$(AT)touch $@ touch $@
define check_or_remove_cached define check_or_remove_cached
@ -285,3 +281,4 @@ $(foreach package,$(all_packages),$(eval $(call ext_add_stages,$(package))))
.PHONY: install cached clean clean-all download-one download-osx download-linux download-win download check-packages check-sources .PHONY: install cached clean clean-all download-one download-osx download-linux download-win download check-packages check-sources
.PHONY: FORCE .PHONY: FORCE
$(V).SILENT:

View file

@ -188,53 +188,53 @@ endef
define int_add_cmds define int_add_cmds
$($(1)_fetched): $($(1)_fetched):
$(AT)mkdir -p $$(@D) $(SOURCES_PATH) mkdir -p $$(@D) $(SOURCES_PATH)
$(AT)rm -f $$@ rm -f $$@
$(AT)touch $$@ touch $$@
$(AT)cd $$(@D); $(call $(1)_fetch_cmds,$(1)) cd $$(@D); $(call $(1)_fetch_cmds,$(1))
$(AT)cd $($(1)_source_dir); $(foreach source,$($(1)_all_sources),$(build_SHA256SUM) $(source) >> $$(@);) cd $($(1)_source_dir); $(foreach source,$($(1)_all_sources),$(build_SHA256SUM) $(source) >> $$(@);)
$(AT)touch $$@ touch $$@
$($(1)_extracted): | $($(1)_fetched) $($(1)_extracted): | $($(1)_fetched)
$(AT)echo Extracting $(1)... echo Extracting $(1)...
$(AT)mkdir -p $$(@D) mkdir -p $$(@D)
$(AT)cd $$(@D); $(call $(1)_extract_cmds,$(1)) cd $$(@D); $(call $(1)_extract_cmds,$(1))
$(AT)touch $$@ touch $$@
$($(1)_preprocessed): | $($(1)_extracted) $($(1)_preprocessed): | $($(1)_extracted)
$(AT)echo Preprocessing $(1)... echo Preprocessing $(1)...
$(AT)mkdir -p $$(@D) $($(1)_patch_dir) mkdir -p $$(@D) $($(1)_patch_dir)
$(AT)$(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;) $(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;)
$(AT)cd $$(@D); $(call $(1)_preprocess_cmds, $(1)) cd $$(@D); $(call $(1)_preprocess_cmds, $(1))
$(AT)touch $$@ touch $$@
$($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed) $($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed)
$(AT)echo Configuring $(1)... echo Configuring $(1)...
$(AT)rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), tar --no-same-owner -xf $($(package)_cached); ) rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), tar --no-same-owner -xf $($(package)_cached); )
$(AT)mkdir -p $$(@D) mkdir -p $$(@D)
$(AT)+cd $$(@D); $($(1)_config_env) $(call $(1)_config_cmds, $(1)) +cd $$(@D); $($(1)_config_env) $(call $(1)_config_cmds, $(1))
$(AT)touch $$@ touch $$@
$($(1)_built): | $($(1)_configured) $($(1)_built): | $($(1)_configured)
$(AT)echo Building $(1)... echo Building $(1)...
$(AT)mkdir -p $$(@D) mkdir -p $$(@D)
$(AT)+cd $$(@D); $($(1)_build_env) $(call $(1)_build_cmds, $(1)) +cd $$(@D); $($(1)_build_env) $(call $(1)_build_cmds, $(1))
$(AT)touch $$@ touch $$@
$($(1)_staged): | $($(1)_built) $($(1)_staged): | $($(1)_built)
$(AT)echo Staging $(1)... echo Staging $(1)...
$(AT)mkdir -p $($(1)_staging_dir)/$(host_prefix) mkdir -p $($(1)_staging_dir)/$(host_prefix)
$(AT)cd $($(1)_build_dir); $($(1)_stage_env) $(call $(1)_stage_cmds, $(1)) cd $($(1)_build_dir); $($(1)_stage_env) $(call $(1)_stage_cmds, $(1))
$(AT)rm -rf $($(1)_extract_dir) rm -rf $($(1)_extract_dir)
$(AT)touch $$@ touch $$@
$($(1)_postprocessed): | $($(1)_staged) $($(1)_postprocessed): | $($(1)_staged)
$(AT)echo Postprocessing $(1)... echo Postprocessing $(1)...
$(AT)cd $($(1)_staging_prefix_dir); $(call $(1)_postprocess_cmds) cd $($(1)_staging_prefix_dir); $(call $(1)_postprocess_cmds)
$(AT)touch $$@ touch $$@
$($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed) $($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed)
$(AT)echo Caching $(1)... echo Caching $(1)...
$(AT)cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | tar --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T - cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | tar --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T -
$(AT)mkdir -p $$(@D) mkdir -p $$(@D)
$(AT)rm -rf $$(@D) && mkdir -p $$(@D) rm -rf $$(@D) && mkdir -p $$(@D)
$(AT)mv $$($(1)_staging_dir)/$$(@F) $$(@) mv $$($(1)_staging_dir)/$$(@F) $$(@)
$(AT)rm -rf $($(1)_staging_dir) rm -rf $($(1)_staging_dir)
$($(1)_cached_checksum): $($(1)_cached) $($(1)_cached_checksum): $($(1)_cached)
$(AT)cd $$(@D); $(build_SHA256SUM) $$(<F) > $$(@) cd $$(@D); $(build_SHA256SUM) $$(<F) > $$(@)
.PHONY: $(1) .PHONY: $(1)
$(1): | $($(1)_cached_checksum) $(1): | $($(1)_cached_checksum)