You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. .NOTPARALLEL :
  2. SOURCES_PATH ?= $(BASEDIR)/sources
  3. BASE_CACHE ?= $(BASEDIR)/built
  4. SDK_PATH ?= $(BASEDIR)/SDKs
  5. NO_QT ?=
  6. NO_WALLET ?=
  7. NO_UPNP ?=
  8. FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
  9. BUILD = $(shell ./config.guess)
  10. HOST ?= $(BUILD)
  11. PATCHES_PATH = $(BASEDIR)/patches
  12. BASEDIR = $(CURDIR)
  13. HASH_LENGTH:=11
  14. DOWNLOAD_CONNECT_TIMEOUT:=10
  15. DOWNLOAD_RETRIES:=3
  16. host:=$(BUILD)
  17. ifneq ($(HOST),)
  18. host:=$(HOST)
  19. host_toolchain:=$(HOST)-
  20. endif
  21. base_build_dir=$(BASEDIR)/work/build
  22. base_staging_dir=$(BASEDIR)/work/staging
  23. canonical_host:=$(shell ./config.sub $(HOST))
  24. build:=$(shell ./config.sub $(BUILD))
  25. build_arch =$(firstword $(subst -, ,$(build)))
  26. build_vendor=$(word 2,$(subst -, ,$(build)))
  27. full_build_os:=$(subst $(build_arch)-$(build_vendor)-,,$(build))
  28. build_os:=$(findstring linux,$(full_build_os))
  29. build_os+=$(findstring darwin,$(full_build_os))
  30. build_os:=$(strip $(build_os))
  31. ifeq ($(build_os),)
  32. build_os=$(full_build_os)
  33. endif
  34. host_arch=$(firstword $(subst -, ,$(canonical_host)))
  35. host_vendor=$(word 2,$(subst -, ,$(canonical_host)))
  36. full_host_os:=$(subst $(host_arch)-$(host_vendor)-,,$(canonical_host))
  37. host_os:=$(findstring linux,$(full_host_os))
  38. host_os+=$(findstring darwin,$(full_host_os))
  39. host_os+=$(findstring mingw32,$(full_host_os))
  40. host_os:=$(strip $(host_os))
  41. ifeq ($(host_os),)
  42. host_os=$(full_host_os)
  43. endif
  44. $(host_arch)_$(host_os)_prefix=$(BASEDIR)/$(host)
  45. $(host_arch)_$(host_os)_host=$(host)
  46. host_prefix=$($(host_arch)_$(host_os)_prefix)
  47. build_prefix=$(host_prefix)/native
  48. build_host=$(build)
  49. AT_$(V):=
  50. AT_:=@
  51. AT:=$(AT_$(V))
  52. all: install
  53. include hosts/$(host_os).mk
  54. include hosts/default.mk
  55. include builders/$(build_os).mk
  56. include builders/default.mk
  57. include packages/packages.mk
  58. qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages)
  59. qt_native_packages_$(NO_QT) = $(qt_native_packages)
  60. wallet_packages_$(NO_WALLET) = $(wallet_packages)
  61. upnp_packages_$(NO_UPNP) = $(upnp_packages)
  62. packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_)
  63. native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) $(qt_native_packages_)
  64. all_packages = $(packages) $(native_packages)
  65. meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk
  66. $(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain)
  67. include funcs.mk
  68. toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin)
  69. final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
  70. final_build_id+=$(shell echo -n $(final_build_id_long) | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))
  71. $(host_prefix)/.stamp_$(final_build_id): | $(native_packages) $(packages)
  72. $(AT)rm -rf $(@D)
  73. $(AT)mkdir -p $(@D)
  74. $(AT)echo copying packages: $|
  75. $(AT)echo to: $(@D)
  76. $(AT)cd $(@D); $(foreach package,$|, tar xf $($(package)_cached); )
  77. $(AT)touch $@
  78. $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id)
  79. $(AT)@mkdir -p $(@D)
  80. $(AT)sed -e 's|@HOST@|$(host)|' \
  81. -e 's|@CC@|$(toolchain_path)$(host_CC)|' \
  82. -e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \
  83. -e 's|@AR@|$(toolchain_path)$(host_AR)|' \
  84. -e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \
  85. -e 's|@NM@|$(toolchain_path)$(host_NM)|' \
  86. -e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \
  87. -e 's|@build_os@|$(build_os)|' \
  88. -e 's|@host_os@|$(host_os)|' \
  89. -e 's|@CFLAGS@|$(host_CFLAGS)|' \
  90. -e 's|@CXXFLAGS@|$(host_CXXFLAGS)|' \
  91. -e 's|@LDFLAGS@|$(host_LDFLAGS)|' \
  92. -e 's|@no_qt@|$(NO_QT)|' \
  93. -e 's|@no_wallet@|$(NO_WALLET)|' \
  94. -e 's|@no_upnp@|$(NO_UPNP)|' \
  95. $< > $@
  96. $(AT)touch $@
  97. install: $(host_prefix)/share/config.site
  98. download: $(all_sources)
  99. .PHONY: install cached