git / moonbite-core / depends/Makefile · raw

.NOTPARALLEL :# Pattern rule to print variables, e.g. make print-top_srcdirprint-%:	@echo $* = $($*)# When invoking a sub-make, keep only the command line variable definitions# matching the pattern in the filter function.## e.g. invoking:#   $ make A=1 C=1 print-MAKEOVERRIDES print-MAKEFLAGS## with the following in the Makefile:#   MAKEOVERRIDES := $(filter A=% B=%,$(MAKEOVERRIDES))## will print:#   MAKEOVERRIDES = A=1#   MAKEFLAGS = -- A=1## this is because as the GNU make manual says:#   The command line variable definitions really appear in the variable#   MAKEOVERRIDES, and MAKEFLAGS contains a reference to this variable.## and since the GNU make manual also says:#   variables defined on the command line are passed to the sub-make through#   MAKEFLAGS## this means that sub-makes will be invoked as if:#   $(MAKE) A=1 blah blahMAKEOVERRIDES := $(filter V=%,$(MAKEOVERRIDES))SOURCES_PATH ?= $(BASEDIR)/sourcesWORK_PATH = $(BASEDIR)/workBASE_CACHE ?= $(BASEDIR)/builtSDK_PATH ?= $(BASEDIR)/SDKsNO_QT ?=NO_QR ?=NO_WALLET ?=NO_ZMQ ?=NO_UPNP ?=MULTIPROCESS ?=FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sourcesBUILD = $(shell ./config.guess)HOST ?= $(BUILD)PATCHES_PATH = $(BASEDIR)/patchesBASEDIR = $(CURDIR)HASH_LENGTH:=11DOWNLOAD_CONNECT_TIMEOUT:=30DOWNLOAD_RETRIES:=3HOST_ID_SALT ?= saltBUILD_ID_SALT ?= salthost:=$(BUILD)ifneq ($(HOST),)host:=$(HOST)endififneq ($(DEBUG),)release_type=debugelserelease_type=releaseendifbase_build_dir=$(WORK_PATH)/buildbase_staging_dir=$(WORK_PATH)/stagingbase_download_dir=$(WORK_PATH)/downloadcanonical_host:=$(shell ./config.sub $(HOST))build:=$(shell ./config.sub $(BUILD))build_arch =$(firstword $(subst -, ,$(build)))build_vendor=$(word 2,$(subst -, ,$(build)))full_build_os:=$(subst $(build_arch)-$(build_vendor)-,,$(build))build_os:=$(findstring linux,$(full_build_os))build_os+=$(findstring darwin,$(full_build_os))build_os:=$(strip $(build_os))ifeq ($(build_os),)build_os=$(full_build_os)endifhost_arch=$(firstword $(subst -, ,$(canonical_host)))host_vendor=$(word 2,$(subst -, ,$(canonical_host)))full_host_os:=$(subst $(host_arch)-$(host_vendor)-,,$(canonical_host))host_os:=$(findstring linux,$(full_host_os))host_os+=$(findstring darwin,$(full_host_os))host_os+=$(findstring mingw32,$(full_host_os))ifeq (android,$(findstring android,$(full_host_os)))host_os:=androidendifhost_os:=$(strip $(host_os))ifeq ($(host_os),)host_os=$(full_host_os)endif$(host_arch)_$(host_os)_prefix=$(BASEDIR)/$(host)$(host_arch)_$(host_os)_host=$(host)host_prefix=$($(host_arch)_$(host_os)_prefix)build_prefix=$(host_prefix)/nativebuild_host=$(build)AT_$(V):=AT_:=@AT:=$(AT_$(V))all: installinclude hosts/$(host_os).mkinclude hosts/default.mkinclude builders/$(build_os).mkinclude builders/default.mkinclude packages/packages.mkbuild_id_string:=$(BUILD_ID_SALT)build_id_string+=$(shell $(build_CC) --version 2>/dev/null)build_id_string+=$(shell $(build_AR) --version 2>/dev/null)build_id_string+=$(shell $(build_CXX) --version 2>/dev/null)build_id_string+=$(shell $(build_RANLIB) --version 2>/dev/null)build_id_string+=$(shell $(build_STRIP) --version 2>/dev/null)$(host_arch)_$(host_os)_id_string:=$(HOST_ID_SALT)$(host_arch)_$(host_os)_id_string+=$(shell $(host_CC) --version 2>/dev/null)$(host_arch)_$(host_os)_id_string+=$(shell $(host_AR) --version 2>/dev/null)$(host_arch)_$(host_os)_id_string+=$(shell $(host_CXX) --version 2>/dev/null)$(host_arch)_$(host_os)_id_string+=$(shell $(host_RANLIB) --version 2>/dev/null)$(host_arch)_$(host_os)_id_string+=$(shell $(host_STRIP) --version 2>/dev/null)ifneq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)# Make sure that cache is invalidated when switching between system and# depends-managed, pinned clangbuild_id_string+=system_clang$(host_arch)_$(host_os)_id_string+=system_clangendifqrencode_packages_$(NO_QR) = $(qrencode_packages)qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) $(qrencode_packages_)bdb_packages_$(NO_BDB) = $(bdb_packages)sqlite_packages_$(NO_SQLITE) = $(sqlite_packages)wallet_packages_$(NO_WALLET) = $(bdb_packages_) $(sqlite_packages_)upnp_packages_$(NO_UPNP) = $(upnp_packages)zmq_packages_$(NO_ZMQ) = $(zmq_packages)multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages)packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_)native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)ifneq ($(zmq_packages_),)packages += $(zmq_packages)endififeq ($(multiprocess_packages_),)packages += $(multiprocess_packages)native_packages += $(multiprocess_native_packages)endifall_packages = $(packages) $(native_packages)meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk$(host_arch)_$(host_os)_native_binutils?=$($(host_os)_native_binutils)$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain)include funcs.mkfinal_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)	$(AT)rm -rf $(@D)	$(AT)mkdir -p $(@D)	$(AT)echo copying packages: $^	$(AT)echo to: $(@D)	$(AT)cd $(@D); $(foreach package,$^, tar xf $($(package)_cached); )	$(AT)touch $@# $PATH is not preserved between ./configure and make by convention. Its# modification and overriding at ./configure time is (as I understand it)# supposed to be captured by the AC_{PROG_{,OBJ}CXX,PATH_{PROG,TOOL}} macros,# which will expand the program names to their full absolute paths. The notable# exception is command line overriding: ./configure CC=clang, which skips the# program name expansion step, and works because the user implicitly indicates# with CC=clang that clang will be available in $PATH at all times, and is most# likely part of the user's system.## Therefore, when we "seed the autoconf cache"/"override well-known program# vars" by setting AR=<blah> in our config.site, either one of two things needs# to be true for the build system to work correctly:##   1. If we refer to the program by name (e.g. AR=riscv64-gnu-linux-ar), the#      tool needs to be available in $PATH at all times.##   2. If the tool is _**not**_ expected to be available in $PATH at all times#      (such as is the case for our native_cctools binutils tools), it needs to#      be referred to by its absolute path, such as would be output by the#      AC_PATH_{PROG,TOOL} macros.## Minor note: it is also okay to refer to tools by their absolute path even if# we expect them to be available in $PATH at all times, more specificity does# not hurt.$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id)	$(AT)@mkdir -p $(@D)	$(AT)sed -e 's|@HOST@|$(host)|' \            -e 's|@CC@|$(host_CC)|' \            -e 's|@CXX@|$(host_CXX)|' \            -e 's|@AR@|$(host_AR)|' \            -e 's|@RANLIB@|$(host_RANLIB)|' \            -e 's|@NM@|$(host_NM)|' \            -e 's|@STRIP@|$(host_STRIP)|' \            -e 's|@build_os@|$(build_os)|' \            -e 's|@host_os@|$(host_os)|' \            -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \            -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \            -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \            -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \            -e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \            -e 's|@no_qt@|$(NO_QT)|' \            -e 's|@no_qr@|$(NO_QR)|' \            -e 's|@no_zmq@|$(NO_ZMQ)|' \            -e 's|@no_wallet@|$(NO_WALLET)|' \            -e 's|@no_upnp@|$(NO_UPNP)|' \            -e 's|@multiprocess@|$(MULTIPROCESS)|' \            -e 's|@debug@|$(DEBUG)|' \            $< > $@	$(AT)touch $@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 )endefdefine check_or_remove_sources  mkdir -p $($(package)_source_dir); cd $($(package)_source_dir); \  test -f $($(package)_fetched) && ( $(build_SHA256SUM) -c $($(package)_fetched) >/dev/null 2>/dev/null || \    ( echo "Checksum missing or mismatched for $(package) source. Forcing re-download."; \      rm -f $($(package)_all_sources) $($(1)_fetched))) || trueendefcheck-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-packagescheck-packages: check-sourcesclean-all: clean	@rm -rf $(SOURCES_PATH) x86_64* i686* mips* arm* aarch64* powerpc* riscv32* riscv64* s390x*clean:	@rm -rf $(WORK_PATH) $(BASE_CACHE) $(BUILD)install: check-packages $(host_prefix)/share/config.sitedownload-one: check-sources $(all_sources)download-osx:	@$(MAKE) -s HOST=x86_64-apple-darwin14 download-onedownload-linux:	@$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-onedownload-win:	@$(MAKE) -s HOST=x86_64-w64-mingw32 download-onedownload: download-osx download-linux download-win$(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