VirtualBox

Changeset 689 in kBuild


Ignore:
Timestamp:
Dec 8, 2006 8:12:03 AM (18 years ago)
Author:
bird
Message:

use a dep like target to avoid really really long filenames.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r688 r689  
    635635#
    636636#   We make use of the SIZE and MD5 attributes for each of the sources to
    637 #   construct a primary goal. Should any sources change only sligtly this
    638 #   name will change and we'll have to remake it. Upon remaking we will
    639 #   perform an 'unfetch' to remove old unpacked files.
     637#   create a digest that is stored in the primary target file. Subsequent
     638#   runswill compare their digest with it to decide if a refetch is required.
     639#   When a refetch is found necessary, an 'unfetch' is performed first to
     640#       clean out old files and directores. Note even changes in source order
     641#   will cause a refetch due to the way the digest is constructed and
     642#   evaluated.
    640643#
    641644#   By not depending directly on the archives (nor on any unpacked files)
     
    643646#   the user to delete the archives. Naturally, this means we'll have to
    644647#   check and fetch missing archives before attempting to unpack them.
     648#
     649# @remark
     650#
     651#       This feature will *NOT* work correctly with vanilla GNU make becuase
     652#   it makes use of includedep to avoid too many unnecessary files.
    645653#
    646 # TODOs:
     654# @todo
    647655#       1. Port md5sum or some equivalent tool and include it in kBuild.
    648656#   2. Download corruption / continuation.
     
    887895define def_fetch_rules
    888896
    889 $(out): $(_TARGET_$(target)_UNPACKED) | $(call DIRDEP,$(inst))
     897$(out).lst: $(_TARGET_$(target)_UNPACKED) | $(call DIRDEP,$(inst))
    890898        @$$(ECHO) Successfully fetched $(target)
    891899        $$(RM) -f $$@ [email protected]
    892         @$$(APPEND) [email protected] "$(notdir $(out).$(_TARGET_$(target)_DIGEST))"
     900        @$$(APPEND) [email protected] "$(notdir $(out))"
    893901        $(if $(_TARGET_$(target)_UNPACKED),$$(CAT_EXT) $(_TARGET_$(target)_UNPACKED) >> [email protected])
    894902        $$(MV) -f [email protected] $$@
     
    896904$(out)_unfetched:
    897905        @$$(ECHO) Unfetching $(target)...
    898         $$(RM) -f $$(addprefix $(inst),$$(shell $$(CAT_EXT) $(out) 2> /dev/null | $$(SED) -e '/\/$$$$/d'))
    899         $$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $(out)) \
    900                 $$(addprefix $(inst),$$(sort $$(dir $$(shell $$(CAT_EXT) $(out) 2> /dev/null))))
    901         $$(RM) -f $(out)
    902         $$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $(out))
    903 
    904 $(out).$(_TARGET_$(target)_DIGEST): | $(call DIRDEP,$(inst))
    905         @$$(RM) -f $(out).$(_TARGET_$(target)_DIGEST)
    906         @$$(ECHO) $$(if $$(wildcard $(out)),Re-fetching,Fetching) $(target)...
    907         $$(if $$(wildcard $(out)),$$(MAKE) -f $(MAKEFILE) $(out)_unfetched)
    908         $$(MAKE) -f $(MAKEFILE) $(out)
    909         $$(APPEND) $$@ ""
     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 $$@) \
     908                $$(addprefix $(inst),$$(sort $$(dir $$(shell $$(CAT_EXT) $(out).lst 2> /dev/null))))
     909        $$(RM) -f $(out).lst $(out)
     910                -/cygwin/bin/sleep 30
     911        $$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@)
     912
     913$(out): $(comp-vars _TARGET_$(target)_DIGEST_PREV,_TARGET_$(target)_DIGEST,FORCE) | $(call DIRDEP,$(inst))
     914        @$$(RM) -f $$@
     915        @$$(ECHO) $$(if $$(wildcard $(out).lst),Re-fetching,Fetching) $(target)...
     916        $$(if $$(wildcard $(out).lst),$$(MAKE) -f $(MAKEFILE) $(out)_unfetched)
     917        $$(MAKE) -f $(MAKEFILE) $(out).lst
     918        @$$(APPEND) $$@ "_TARGET_$(target)_DIGEST_PREV := $(_TARGET_$(target)_DIGEST)"
    910919       
    911 $(target):: $(out).$(_TARGET_$(target)_DIGEST)
    912 
    913 .NOTPARALLEL: $(out) $(out)_unfetched $(out).$(_TARGET_$(target)_DIGEST)
     920$(target):: $(out)
     921$(target)_unfetch:: $(out)_unfetched
     922
     923.NOTPARALLEL: $(out).lst $(out)_unfetched $(out)
    914924
    915925endef
     
    942952out := $(inst)_kBuild_fetch_$(target)
    943953
     954$(eval includedep $(out))
    944955$(eval $(def_fetch_rules))
    945956
    946 _FETCHES += $(out).$(_TARGET_$(target)_DIGEST)
     957_FETCHES += $(out)
    947958_DOWNLOADS += $(_TARGET_$(target)_FETCHED)
    948959_UNPACKS += $(_TARGET_$(target)_UNPACKED)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette