]> Git Repo - VerusCoin.git/blame - depends/Makefile
Auto merge of #3631 - arielgabizon:rename-method, r=bitcartel
[VerusCoin.git] / depends / Makefile
CommitLineData
1dec09b3
CF
1.NOTPARALLEL :
2
3SOURCES_PATH ?= $(BASEDIR)/sources
4BASE_CACHE ?= $(BASEDIR)/built
5SDK_PATH ?= $(BASEDIR)/SDKs
1dec09b3 6NO_WALLET ?=
be60c6d7 7PRIORITY_DOWNLOAD_PATH ?= https://z.cash/depends-sources
1dec09b3 8
1ead1bb0 9BUILD ?= $(shell ./config.guess)
1dec09b3
CF
10HOST ?= $(BUILD)
11PATCHES_PATH = $(BASEDIR)/patches
12BASEDIR = $(CURDIR)
13HASH_LENGTH:=11
df7565d9
CF
14DOWNLOAD_CONNECT_TIMEOUT:=10
15DOWNLOAD_RETRIES:=3
0adfdc99 16CRATE_REGISTRY:=vendored-sources
1dec09b3
CF
17
18host:=$(BUILD)
19ifneq ($(HOST),)
20host:=$(HOST)
21host_toolchain:=$(HOST)-
22endif
23
2027ad30
CF
24ifneq ($(DEBUG),)
25release_type=debug
26else
27release_type=release
28endif
29
1dec09b3
CF
30base_build_dir=$(BASEDIR)/work/build
31base_staging_dir=$(BASEDIR)/work/staging
d546191d 32base_download_dir=$(BASEDIR)/work/download
1dec09b3
CF
33canonical_host:=$(shell ./config.sub $(HOST))
34build:=$(shell ./config.sub $(BUILD))
35
36build_arch =$(firstword $(subst -, ,$(build)))
37build_vendor=$(word 2,$(subst -, ,$(build)))
38full_build_os:=$(subst $(build_arch)-$(build_vendor)-,,$(build))
39build_os:=$(findstring linux,$(full_build_os))
40build_os+=$(findstring darwin,$(full_build_os))
41build_os:=$(strip $(build_os))
42ifeq ($(build_os),)
43build_os=$(full_build_os)
44endif
45
46host_arch=$(firstword $(subst -, ,$(canonical_host)))
47host_vendor=$(word 2,$(subst -, ,$(canonical_host)))
48full_host_os:=$(subst $(host_arch)-$(host_vendor)-,,$(canonical_host))
49host_os:=$(findstring linux,$(full_host_os))
50host_os+=$(findstring darwin,$(full_host_os))
51host_os+=$(findstring mingw32,$(full_host_os))
52host_os:=$(strip $(host_os))
53ifeq ($(host_os),)
54host_os=$(full_host_os)
55endif
56
57$(host_arch)_$(host_os)_prefix=$(BASEDIR)/$(host)
58$(host_arch)_$(host_os)_host=$(host)
59host_prefix=$($(host_arch)_$(host_os)_prefix)
60build_prefix=$(host_prefix)/native
61build_host=$(build)
62
63AT_$(V):=
64AT_:=@
65AT:=$(AT_$(V))
66
67all: install
68
69include hosts/$(host_os).mk
70include hosts/default.mk
71include builders/$(build_os).mk
72include builders/default.mk
73include packages/packages.mk
74
1dec09b3 75wallet_packages_$(NO_WALLET) = $(wallet_packages)
f493d3e0 76proton_packages_$(NO_PROTON) = $(proton_packages)
1dec09b3 77
d9cd254e 78packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(rust_packages) $(proton_packages_) $(wallet_packages_)
d5966580 79native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)
1dec09b3
CF
80all_packages = $(packages) $(native_packages)
81
0adfdc99 82meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk cargo-checksum.sh
1dec09b3
CF
83
84$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain)
85
86include funcs.mk
87
88toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin)
89final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
90final_build_id+=$(shell echo -n $(final_build_id_long) | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))
235b3a78 91$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
1dec09b3
CF
92 $(AT)rm -rf $(@D)
93 $(AT)mkdir -p $(@D)
235b3a78 94 $(AT)echo copying packages: $^
1dec09b3 95 $(AT)echo to: $(@D)
235b3a78 96 $(AT)cd $(@D); $(foreach package,$^, tar xf $($(package)_cached); )
1dec09b3
CF
97 $(AT)touch $@
98
99$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id)
100 $(AT)@mkdir -p $(@D)
101 $(AT)sed -e 's|@HOST@|$(host)|' \
102 -e 's|@CC@|$(toolchain_path)$(host_CC)|' \
103 -e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \
104 -e 's|@AR@|$(toolchain_path)$(host_AR)|' \
105 -e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \
106 -e 's|@NM@|$(toolchain_path)$(host_NM)|' \
107 -e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \
108 -e 's|@build_os@|$(build_os)|' \
109 -e 's|@host_os@|$(host_os)|' \
2027ad30
CF
110 -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \
111 -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
112 -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
113 -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
1dec09b3 114 -e 's|@no_wallet@|$(NO_WALLET)|' \
2027ad30 115 -e 's|@debug@|$(DEBUG)|' \
1dec09b3
CF
116 $< > $@
117 $(AT)touch $@
118
235b3a78
CF
119
120define check_or_remove_cached
121 mkdir -p $(BASE_CACHE)/$(host)/$(package) && cd $(BASE_CACHE)/$(host)/$(package); \
122 $(build_SHA256SUM) -c $($(package)_cached_checksum) >/dev/null 2>/dev/null || \
123 ( rm -f $($(package)_cached_checksum); \
124 if test -f "$($(package)_cached)"; then echo "Checksum mismatch for $(package). Forcing rebuild.."; rm -f $($(package)_cached_checksum) $($(package)_cached); fi )
125endef
126
127define check_or_remove_sources
128 mkdir -p $($(package)_source_dir); cd $($(package)_source_dir); \
129 $(build_SHA256SUM) -c $($(package)_fetched) >/dev/null 2>/dev/null || \
130 ( if test -f $($(package)_all_sources); then echo "Checksum missing or mismatched for $(package) source. Forcing re-download."; fi; \
131 rm -f $($(package)_all_sources) $($(1)_fetched))
132endef
133
134check-packages:
135 @$(foreach package,$(all_packages),$(call check_or_remove_cached,$(package));)
136check-sources:
137 @$(foreach package,$(all_packages),$(call check_or_remove_sources,$(package));)
138
139$(host_prefix)/share/config.site: check-packages
140
141check-packages: check-sources
142
143install: check-packages $(host_prefix)/share/config.site
144
145
146download-one: check-sources $(all_sources)
147
422f873e
CF
148download-osx:
149 @$(MAKE) -s HOST=x86_64-apple-darwin11 download-one
150download-linux:
151 @$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one
152download-win:
153 @$(MAKE) -s HOST=x86_64-w64-mingw32 download-one
154download: download-osx download-linux download-win
235b3a78
CF
155
156.PHONY: install cached download-one download-osx download-linux download-win download check-packages check-sources
This page took 0.133898 seconds and 4 git commands to generate.