]> Git Repo - VerusCoin.git/blobdiff - depends/Makefile
bump version to 0.11.2
[VerusCoin.git] / depends / Makefile
index fc763bedeb5f24258efff5a8dbdea9f59a962ff1..ef5a20e6c36aa9c9cbb0fa9334ec8d24824a0bc2 100644 (file)
@@ -30,6 +30,7 @@ endif
 
 base_build_dir=$(BASEDIR)/work/build
 base_staging_dir=$(BASEDIR)/work/staging
+base_download_dir=$(BASEDIR)/work/download
 canonical_host:=$(shell ./config.sub $(HOST))
 build:=$(shell ./config.sub $(BUILD))
 
@@ -90,12 +91,12 @@ include funcs.mk
 toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin)
 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))
-$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
+$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
        $(AT)rm -rf $(@D)
        $(AT)mkdir -p $(@D)
-       $(AT)echo copying packages: $|
+       $(AT)echo copying packages: $^
        $(AT)echo to: $(@D)
-       $(AT)cd $(@D); $(foreach package,$|, tar xf $($(package)_cached); )
+       $(AT)cd $(@D); $(foreach package,$^, tar xf $($(package)_cached); )
        $(AT)touch $@
 
 $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id)
@@ -120,6 +121,41 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
             $< > $@
        $(AT)touch $@
 
-install: $(host_prefix)/share/config.site
-download: $(all_sources)
-.PHONY: install cached
+
+define check_or_remove_cached
+  mkdir -p $(BASE_CACHE)/$(host)/$(package) && cd $(BASE_CACHE)/$(host)/$(package); \
+  $(build_SHA256SUM) -c $($(package)_cached_checksum) >/dev/null 2>/dev/null || \
+  ( rm -f $($(package)_cached_checksum); \
+    if test -f "$($(package)_cached)"; then echo "Checksum mismatch for $(package). Forcing rebuild.."; rm -f $($(package)_cached_checksum) $($(package)_cached); fi )
+endef
+
+define check_or_remove_sources
+  mkdir -p $($(package)_source_dir); cd $($(package)_source_dir); \
+  $(build_SHA256SUM) -c $($(package)_fetched) >/dev/null 2>/dev/null || \
+    ( if test -f $($(package)_all_sources); then echo "Checksum missing or mismatched for $(package) source. Forcing re-download."; fi; \
+      rm -f $($(package)_all_sources) $($(1)_fetched))
+endef
+
+check-packages:
+       @$(foreach package,$(all_packages),$(call check_or_remove_cached,$(package));)
+check-sources:
+       @$(foreach package,$(all_packages),$(call check_or_remove_sources,$(package));)
+
+$(host_prefix)/share/config.site: check-packages
+
+check-packages: check-sources
+
+install: check-packages $(host_prefix)/share/config.site
+
+
+download-one: check-sources $(all_sources)
+
+download-osx:
+       @$(MAKE) -s HOST=x86_64-apple-darwin11 download-one
+download-linux:
+       @$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one
+download-win:
+       @$(MAKE) -s HOST=x86_64-w64-mingw32 download-one
+download: download-osx download-linux download-win
+
+.PHONY: install cached download-one download-osx download-linux download-win download check-packages check-sources
This page took 0.024529 seconds and 4 git commands to generate.