Ignore:
Timestamp:
Dec 10, 2006, 8:16:02 AM (19 years ago)
Author:
bird
Message:

Implemented KBUILD_QUIET and KBUILD_VERBOSE={1|full} (was BUILD_QUIET, BUILD_VERBOSE, BUILD_DEBUG).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r693 r696  
    666666.PRECIOUS: $(out)
    667667$(out) $($(target)_$(srcname)_FETCH_OUTPUT_): | $($(target)_$(srcname)_FETCH_DEPORD_)
    668         @$$(ECHO) Downloading $(source)...
    669         ## @todo do fancy stuff like download continuation.
    670         $$(RM) -f $(out) $(out).md5
     668        $$(call MSG_L1,Downloading $(source)...)
     669        @## @todo do fancy stuff like download continuation.
     670        $$(QUIET)$$(RM) -f $(out) $(out).md5
    671671        $($(target)_$(srcname)_FETCH_CMDS_)
    672         @$(if $(md5),$$(APPEND) $(out).md5 "$(md5) *$(out)")
    673         $(if $(md5),$$(MD5SUM) -c $(out).md5)
     672        $$(QUIET2)$(if $(md5),$$(APPEND) $(out).md5 "$(md5) *$(out)")
     673        $$(QUIET)$(if $(md5),$$(MD5SUM) -c $(out).md5)
    674674
    675675
     
    677677# Intermediate goal for making sure the md5 and size matches. it will (re) fetch the archive if necessary.
    678678$(out).checked_$(md5)_$(size): $($(target)_$(srcname)_FETCH_DEPEND_) | $($(target)_$(srcname)_FETCH_DEPORD_)
    679         @$$(ECHO) Checking $(out) ($(source))...
    680         $$(RM) -f $$@ $(out).md5
     679        $$(call MSG_L1,Checking $(out),($(source))...)
     680        $$(QUIET)$$(RM) -f $$@ $(out).md5
    681681        @# creates the .md5 we pass to md5sum.
    682         @$(if $(md5),$$(APPEND) $(out).md5 "$(md5) *$(out)")
     682        $$(QUIET2)$(if $(md5),$$(APPEND) $(out).md5 "$(md5) *$(out)")
    683683        @# (re)fetch the file if it doesn't exist or if it doesn't matches the md5.
    684         ## @todo do fancy stuff like download continuation.
    685         ( test -f $(out) && $(if $(md5),$$(MD5SUM) -c $(out).md5, true) ) \
    686                 || (   $$(RM_EXT) -f $(out) \
    687                     && $$(MAKE)      $(out) -f $(MAKEFILE) )
    688         @$$(APPEND) $$@
     684        @## @todo do fancy stuff like download continuation.
     685        $$(QUIET)( test -f $(out) && $(if $(md5),$$(MD5SUM) -c $(out).md5, true) ) \
     686                  || (   $$(RM_EXT) -f $(out) \
     687                      && $$(MAKE)      $(out) -f $(MAKEFILE) --no-print-directory )
     688        $$(QUIET2)$$(APPEND) $$@
    689689
    690690_TARGET_$(target)_FETCHED += $(out) $(out).checked_$(md5)_$(size)
     
    700700$(out) $($(target)_$(srcname)_UNPACK_OUTPUT_): $($(target)_$(srcname)_UNPACK_DEPEND_) \
    701701                | $($(target)_$(srcname)_UNPACK_DEPORD_) $(archive).checked_$(md5)_$(size)
    702         @$$(ECHO) Unpacking $(source) into $(inst)...
    703         $$(RM) -f $(out)
     702        $$(call MSG_L1,Unpacking $(archive),into $(inst)...)
     703        $$(QUIET)$$(RM) -f $(out)
    704704        @# if the source archive doesn't exist fetch it (can have been deleted to save space).
    705         test -f $(archive) \
    706                 || (   $$(RM_EXT) -f $(archive).checked_$(md5)_$(size) \
    707                     && $$(MAKE)      $(archive).checked_$(md5)_$(size) -f $(MAKEFILE) )
     705        $$(QUIET)test -f $(archive) \
     706                 || (   $$(RM_EXT) -f $(archive).checked_$(md5)_$(size) \
     707                     && $$(MAKE)      $(archive).checked_$(md5)_$(size) -f $(MAKEFILE) --no-print-directory )
    708708        $($(target)_$(srcname)_UNPACK_CMDS_)
    709         @$$(APPEND) $(out) $(notdir $(archive).checked_$(md5)_$(size))
    710         @$$(APPEND) $(out) $(notdir $(out))
     709        $$(QUIET2)$$(APPEND) $(out) $(notdir $(archive).checked_$(md5)_$(size))
     710        $$(QUIET2)$$(APPEND) $(out) $(notdir $(out))
    711711
    712712$(eval _TARGET_$(target)_UNPACKED += $(out))
     
    896896
    897897$(out).lst: $(_TARGET_$(target)_UNPACKED) | $(call DIRDEP,$(inst))
    898         @$$(ECHO) kBuild: Successfully fetched $(target)
    899         $$(RM) -f $$@ $$@.tmp
    900         @$$(APPEND) $$@.tmp "$(notdir $(out))"
    901         $(if $(_TARGET_$(target)_UNPACKED),$$(CAT_EXT) $(_TARGET_$(target)_UNPACKED) >> $$@.tmp)
    902         $$(MV) -f $$@.tmp $$@
     898        $$(call MSG_L1,Successfully fetched $(target))
     899        $$(QUIET)$$(RM) -f $$@ $$@.tmp
     900        $$(QUIET2)$$(APPEND) $$@.tmp "$(notdir $(out))"
     901        $$(QUIET)$(if $(_TARGET_$(target)_UNPACKED),$$(CAT_EXT) $(_TARGET_$(target)_UNPACKED) >> $$@.tmp)
     902        $$(QUIET)$$(MV) -f $$@.tmp $$@
    903903
    904904$(out)_unfetched:
    905         @$$(ECHO) kBuild: Unfetching $(target)...
    906         $$(RM) -f $$(addprefix $(inst),$$(shell $$(CAT_EXT) $(out).lst 2> /dev/null | $$(SED) -e '/\/$$$$/d'))
    907         $$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@) \
     905        $$(call MSG_L1,Unfetching $(target)...)
     906        $$(QUIET)$$(RM) -f $$(addprefix $(inst),$$(shell $$(CAT_EXT) $(out).lst 2> /dev/null | $$(SED) -e '/\/$$$$/d'))
     907        $$(QUIET)$$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@) \
    908908                $$(addprefix $(inst),$$(sort $$(dir $$(shell $$(CAT_EXT) $(out).lst 2> /dev/null))))
    909         $$(RM) -f $(out).lst $(out)
    910         $$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@)
     909        $$(QUIET)$$(RM) -f $(out).lst $(out)
     910        $$(QUIET)$$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@)
    911911
    912912$(out): $(comp-vars _TARGET_$(target)_DIGEST_PREV,_TARGET_$(target)_DIGEST,FORCE) | $(call DIRDEP,$(inst))
    913         @$$(RM) -f $$@
    914         @$$(ECHO) kBuild: $$(if $$(wildcard $(out).lst),$$(if $$(_TARGET_$(target)_DIGEST),Re-fetching,Removing),Fetching) $(target)...
    915         @$$(if $$(wildcard $(out).lst),$$(MAKE) -f $(MAKEFILE) $(out)_unfetched)
    916         @$$(if $$(_TARGET_$(target)_DIGEST),$$(MAKE) -f $(MAKEFILE) $(out).lst)
    917         @$$(if $$(_TARGET_$(target)_DIGEST),$$(APPEND) $$@ "_TARGET_$(target)_DIGEST_PREV := $(_TARGET_$(target)_DIGEST)")
     913        $$(QUIET)$$(RM) -f $$@
     914        $$(call MSG_L1,$$(if $$(wildcard $(out).lst),$$(if $$(_TARGET_$(target)_DIGEST),Re-fetching,Removing),Fetching) $(target)...)
     915        $$(QUIET)$$(if $$(wildcard $(out).lst      ),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out)_unfetched)
     916        $$(QUIET)$$(if  $$(_TARGET_$(target)_DIGEST),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out).lst)
     917        $$(QUIET2)$$(if $$(_TARGET_$(target)_DIGEST),$$(APPEND) $$@ "_TARGET_$(target)_DIGEST_PREV := $(_TARGET_$(target)_DIGEST)")
    918918       
    919919.NOTPARALLEL: $(out).lst $(out)_unfetched $(out)
     
    10251025                | \
    10261026                $($(target)_$(source)_DEPORD_)
    1027         $(call MSG_L1,Creating $$@)
    1028         $(RM) -f $(dep) $(obj) $($(target)_$(source)_OUTPUT_)
     1027        $$(call MSG_L1,Compiling $(source),=> $$@)
     1028        $$(QUIET)$$(RM) -f $(dep) $(obj) $($(target)_$(source)_OUTPUT_)
    10291029        $(custom_pre)
    10301030
     
    10331033        $(custom_post)
    10341034ifndef NO_COMPILE_CMDS_DEPS
    1035         @$(APPEND) "$(dep)"
    1036         @$(APPEND) "$(dep)" 'define $(target)_$(source)_CMDS_PREV_'
    1037         @$(APPEND) "$(dep)" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$(dep)" ',$($(target)_$(source)_CMDS_))'
    1038         @$(APPEND) "$(dep)" 'endef'
     1035        $$(QUIET2)$$(APPEND) "$(dep)"
     1036        $$(QUIET2)$$(APPEND) "$(dep)" 'define $(target)_$(source)_CMDS_PREV_'
     1037        $$(QUIET2)$$(APPEND) "$(dep)" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$(dep)" ',$($(target)_$(source)_CMDS_))'
     1038        $$(QUIET2)$$(APPEND) "$(dep)" 'endef'
    10391039endif
    10401040
     
    10731073                | \
    10741074                $($(target)_DEPORD_)
    1075         $(call MSG_L1,Creating $$@)
    1076         $(RM) -f $(dep) $(out) $($(target)_OUTPUT_)
     1075        $$(call MSG_L1,Linking $$@)
     1076        $$(QUIET)$$(RM) -f $(dep) $(out) $($(target)_OUTPUT_)
    10771077        $(custom_pre)
    10781078
     
    10811081        $(custom_post)
    10821082ifndef NO_LINK_CMDS_DEPS
    1083         @$(APPEND) "$(dep)" 'define $(target)_CMDS_PREV_'
    1084         @$(APPEND) "$(dep)" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$(dep)" ',$($(target)_CMDS_))'
    1085         @$(APPEND) "$(dep)" 'endef'
     1083        $$(QUIET2)$$(APPEND) "$(dep)" 'define $(target)_CMDS_PREV_'
     1084        $$(QUIET2)$$(APPEND) "$(dep)" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$(dep)" ',$($(target)_CMDS_))'
     1085        $$(QUIET2)$$(APPEND) "$(dep)" 'endef'
    10861086endif
    10871087
     
    10981098define def_link_install_rule
    10991099$(INSTARGET_$(target)) : $(out) | $(call DIRDEP,$(dir $(INSTARGET_$(target))))
    1100         $(INSTALL) $$(if $(mode),-m $(mode)) $(out) $$@
     1100        $$(call MSG_L1,Installing $(target),=> $$@)
     1101        $$(QUIET)$$(INSTALL) $$(if $(mode),-m $(mode)) $(out) $$@
    11011102endef
    11021103
     
    20192020# the install rule
    20202021$(insdst) : $(srcsrc) | $(call DIRDEP,$(dir $(insdst)))
    2021         $$(if $$(filter $(INSTALL),$(inscmd)),,$$(RM) -f $$@)
    2022         $(inscmd)
     2022        $$(call MSG_L1,Installing $(srcsrc),=> $(insdst))
     2023        $$(QUIET)$$(if $$(filter $(INSTALL),$(inscmd)),,$$(RM) -f $$@)
     2024        $$(QUIET)$(inscmd)
    20232025endef
    20242026
     
    21342136# the install rule
    21352137$(insdst) : | $(call DIRDEP,$(dir $(insdst)))
    2136         $$(RM) -f $$@
    2137         $$(LN_SYMLINK) $(symdst) $(insdst)
     2138        $$(call MSG_L1,Installing symlink $(insdst),pointing to $(symdst))
     2139        $$(QUIET)$$(RM) -f $$@
     2140        $$(QUIET)$$(LN_SYMLINK) $(symdst) $(insdst)
    21382141endef
    21392142
     
    21832186# the install rule
    21842187$(insdst):
    2185         $(INSTALL) -d \
     2188        $$(call MSG_L1,Installing directory $(insdst))
     2189        $$(QUIET)$$(INSTALL) -d \
    21862190                $(if $(uid),-o $(uid))\
    21872191                $(if $(gid),-g $(gid))\
     
    22962300define def_mkdir_rule
    22972301$(directory):
    2298         $(call MSG_L1,Creating directory $$@)
    2299         $(MKDIR) -p $$@
     2302        $$(call MSG_L2,Creating directory $$@)
     2303        $$(QUIET)$$(MKDIR) -p $$@
    23002304endef
    23012305
     
    23282332define def_pass_subdir
    23292333pass_$(pass)$(tag):: $(dep)
    2330         + $(QUIET)$$(MAKE) -C $(subdir) -f $$(notdir $$(firstword $$(wildcard $$(addprefix $(subdir)/,$$(DEFAULT_MAKEFILE))))) pass_$(pass)
     2334        + $$(QUIET)$$(MAKE) -C $(subdir) -f $$(notdir $$(firstword $$(wildcard $$(addprefix $(subdir)/,$$(DEFAULT_MAKEFILE))))) pass_$(pass)
    23312335endef
    23322336
     
    23382342define def_pass_makefile
    23392343pass_$(pass)$(tag):: $(dep)
    2340         + $(QUIET)$$(MAKE) -C $(patsubst %/,%,$(dir $(makefile))) -f $(notdir $(makefile)) pass_$(pass)
     2344        + $$(QUIET)$$(MAKE) -C $(patsubst %/,%,$(dir $(makefile))) -f $(notdir $(makefile)) pass_$(pass)
    23412345endef
    23422346
     
    23642368pass_$(pass)_doit:      $(PASS_$(PASS)_trgs) $(foreach var,$(PASS_$(PASS)_vars),$(var))
    23652369pass_$(pass)_this:      pass_$(pass)_before
    2366         + $(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)_doit
     2370        + $$(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)_doit
    23672371pass_$(pass)_after::    pass_$(pass)_this
    23682372pass_$(pass):           pass_$(pass)_after
     
    23912395pass_$(pass)_doit:          $(PASS_$(PASS)_trgs) $(foreach var,$(PASS_$(PASS)_vars),$(var))
    23922396pass_$(pass)_this:      pass_$(pass)_before
    2393         + $(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)_doit
     2397        + $$(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)_doit
    23942398pass_$(pass)_after::    pass_$(pass)_this
    23952399pass_$(pass):           pass_$(pass)_after
     
    24212425.PHONY: pass_$(pass)_order
    24222426pass_$(pass)_order: $(pass_prev)
    2423         $(call MSG_L1,Pass - $(if $(PASS_$(PASS)),$(PASS_$(PASS)),$(pass)))
    2424         + $(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)
     2427        $$(call MSG_L1,Pass - $$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
     2428        + $$(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)
    24252429else
    24262430.NOTPARALLEL: pass_$(pass)_order pass_$(pass)_banner
    24272431.PHONY:       pass_$(pass)_order pass_$(pass)_banner
    24282432pass_$(pass)_banner:
    2429         $(call MSG_L1,Pass - $(if $(PASS_$(PASS)),$(PASS_$(PASS)),$(pass)))
     2433        $$(call MSG_L1,Pass - $$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
    24302434pass_$(pass)_order: \
    24312435                $(pass_prev) \
Note: See TracChangeset for help on using the changeset viewer.