Changeset 689 in kBuild
- Timestamp:
- Dec 8, 2006 8:12:03 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer.kmk
r688 r689 635 635 # 636 636 # 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. 640 643 # 641 644 # By not depending directly on the archives (nor on any unpacked files) … … 643 646 # the user to delete the archives. Naturally, this means we'll have to 644 647 # 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. 645 653 # 646 # TODOs:654 # @todo 647 655 # 1. Port md5sum or some equivalent tool and include it in kBuild. 648 656 # 2. Download corruption / continuation. … … 887 895 define def_fetch_rules 888 896 889 $(out) : $(_TARGET_$(target)_UNPACKED) | $(call DIRDEP,$(inst))897 $(out).lst: $(_TARGET_$(target)_UNPACKED) | $(call DIRDEP,$(inst)) 890 898 @$$(ECHO) Successfully fetched $(target) 891 899 $$(RM) -f $$@ [email protected] 892 @$$(APPEND) [email protected] "$(notdir $(out) .$(_TARGET_$(target)_DIGEST))"900 @$$(APPEND) [email protected] "$(notdir $(out))" 893 901 $(if $(_TARGET_$(target)_UNPACKED),$$(CAT_EXT) $(_TARGET_$(target)_UNPACKED) >> [email protected]) 894 902 $$(MV) -f [email protected] $$@ … … 896 904 $(out)_unfetched: 897 905 @$$(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)" 910 919 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) 914 924 915 925 endef … … 942 952 out := $(inst)_kBuild_fetch_$(target) 943 953 954 $(eval includedep $(out)) 944 955 $(eval $(def_fetch_rules)) 945 956 946 _FETCHES += $(out) .$(_TARGET_$(target)_DIGEST)957 _FETCHES += $(out) 947 958 _DOWNLOADS += $(_TARGET_$(target)_FETCHED) 948 959 _UNPACKS += $(_TARGET_$(target)_UNPACKED)
Note:
See TracChangeset
for help on using the changeset viewer.