| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
, := , |
| 4 |
space := $(EMPTY) $(EMPTY) |
| 5 |
|
| 6 |
NJOBS = |
| 7 |
# Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008) |
| 8 |
ifneq (,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS)))) |
| 9 |
NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(,),$(space),$(DEB_BUILD_OPTIONS)))) |
| 10 |
endif |
| 11 |
|
| 12 |
vendor := $(shell if dpkg-vendor --derives-from Ubuntu; then echo Ubuntu; else echo Debian; fi) |
| 13 |
distrelease := $(shell lsb_release -cs) |
| 14 |
|
| 15 |
GCC_VER := $(shell dpkg-parsechangelog |egrep ^Source:|cut -f2 -d' '|cut -f2 -d'-') |
| 16 |
|
| 17 |
ifeq ($(GCC_VER),15) |
| 18 |
MIN_VER_GCC := 15.2.0-7~ |
| 19 |
PPA_VER_GCC := 15.2.0-7~ |
| 20 |
endif |
| 21 |
|
| 22 |
ifndef MIN_VER_GCC |
| 23 |
MIN_VER_GCC := ${GCC_VER}.0.1-0~ |
| 24 |
#MIN_VER_GCC := ${GCC_VER}-20160225-0~ |
| 25 |
endif |
| 26 |
|
| 27 |
DEB_NAME_ACT := $(shell dpkg-parsechangelog| sed -n 's/-*//; s/^Source: \(.*\)/\1/p') |
| 28 |
DEB_SVER_ACT := $(shell dpkg-parsechangelog| sed -n 's/-*//; s/^Version: \(.*\)/\1/p') |
| 29 |
ifeq ($(DEB_NAME_ACT),gcc-$(GCC_VER)-cross-mipsen) |
| 30 |
DEB_VER_ACT := $(shell /bin/sh debian/new_cross_version.sh mipsr6el) |
| 31 |
else |
| 32 |
DEB_VER_ACT := $(shell /bin/sh debian/new_cross_version.sh $(if $(filter $(DEB_NAME_ACT), gcc-$(GCC_VER)-cross),arm64,ppc64)) |
| 33 |
endif |
| 34 |
CROSS_EXT := cross$(DEB_VER_ACT) |
| 35 |
|
| 36 |
ifeq ($(CROSS_EXT),cross) |
| 37 |
$(error macros CROSS_EXT and DEB_VER_ACT are not correctly set ($(CROSS_EXT)/$(DEB_VER_ACT))) |
| 38 |
endif |
| 39 |
|
| 40 |
VER_GCC := $(shell dpkg-parsechangelog -l/usr/src/gcc-${GCC_VER}/debian/changelog | awk '/^Version:/ {print $$2}' | sed 's/-[^-]*$$//') |
| 41 |
GCC_DIR := /usr/src/gcc-${GCC_VER} |
| 42 |
GCC_TARBALL := $(wildcard $(GCC_DIR)/gcc-*.xz) |
| 43 |
VER_BINUTILS := 2.45-5 |
| 44 |
MIN_VER_BINUTILS := 2.45-5 |
| 45 |
VER_ISL := 0.26-3~ |
| 46 |
MIN_VER_GLIBC := 2.37 |
| 47 |
|
| 48 |
DEB_VER_GCC := $(shell dpkg-parsechangelog -l${GCC_DIR}/debian/changelog | egrep '^Version:' | cut -f 2 -d ' ') |
| 49 |
|
| 50 |
CROSS_BIARCH_armhf:=armel |
| 51 |
CROSS_BIARCH_armel:=armhf |
| 52 |
CROSS_BIARCH_powerpc:=ppc64 |
| 53 |
CROSS_BIARCH_s390x:=s390 |
| 54 |
|
| 55 |
HOST_ARCHS_alpha = amd64 arm64 i386 ppc64el x32 |
| 56 |
# FIXME: adding amd64 in HOST_ARCHS_amd64 hard codes the indep build |
| 57 |
# to amd64 buildds ... |
| 58 |
HOST_ARCHS_amd64 = amd64 arm64 i386 ppc64el s390x x32 |
| 59 |
HOST_ARCHS_arc = amd64 arm64 i386 ppc64el x32 |
| 60 |
HOST_ARCHS_armhf = amd64 i386 x32 arm64 ppc64el s390x |
| 61 |
HOST_ARCHS_armel = amd64 i386 x32 arm64 ppc64el |
| 62 |
HOST_ARCHS_arm64 = amd64 i386 x32 ppc64el s390x |
| 63 |
HOST_ARCHS_hppa = amd64 arm64 i386 ppc64el x32 |
| 64 |
HOST_ARCHS_i386 = amd64 arm64 ppc64el s390x x32 |
| 65 |
HOST_ARCHS_loong64 = amd64 arm64 i386 ppc64el x32 |
| 66 |
HOST_ARCHS_m68k = amd64 arm64 i386 ppc64el x32 |
| 67 |
HOST_ARCHS_powerpc = amd64 arm64 i386 ppc64el s390x x32 |
| 68 |
HOST_ARCHS_ppc64 = amd64 i386 ppc64el s390x x32 |
| 69 |
HOST_ARCHS_ppc64el = amd64 arm64 i386 ppc64 s390x x32 |
| 70 |
HOST_ARCHS_riscv64 = amd64 arm64 i386 ppc64el s390x x32 |
| 71 |
HOST_ARCHS_s390x = amd64 i386 x32 arm64 ppc64el |
| 72 |
HOST_ARCHS_sh4 = amd64 arm64 i386 ppc64el x32 |
| 73 |
HOST_ARCHS_sparc64 = amd64 arm64 i386 ppc64el x32 |
| 74 |
HOST_ARCHS_x32 = amd64 arm64 i386 ppc64el |
| 75 |
|
| 76 |
all_archs_mips = mips mipsel mipsn32 mipsn32el mips64 mips64el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el |
| 77 |
mipsen_archs = amd64 i386 x32 mips64el mipsel mips64r6el arm64 ppc64el |
| 78 |
$(foreach a, $(all_archs_mips), \ |
| 79 |
$(eval HOST_ARCHS_$(a) = $(filter-out $(a), $(mipsen_archs))) \ |
| 80 |
) |
| 81 |
|
| 82 |
HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 83 |
HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 84 |
stamp := stamp-dir/ |
| 85 |
|
| 86 |
# package metadata information |
| 87 |
ifeq (,$(ELF_PACKAGE_METADATA)) |
| 88 |
ELF_PACKAGE_METADATA := $(subst $(space),,{ \ |
| 89 |
"type":"deb", \ |
| 90 |
"os":"$(shell awk -F= '/^ID=/ {print $$2}' /etc/os-release)", \ |
| 91 |
"name":"$(DEB_NAME_ACT)", \ |
| 92 |
"version":"$(DEB_SVER_ACT)", \ |
| 93 |
"architecture":"$(HOST_ARCH)" \ |
| 94 |
$(if $(DEB_BUILD_DEBUG_INFO_URL),$(,)"debugInfoUrl":"$(DEB_BUILD_DEBUG_INFO_URL)") \ |
| 95 |
}) |
| 96 |
export ELF_PACKAGE_METADATA |
| 97 |
endif |
| 98 |
|
| 99 |
ifeq (,$(CROSS_ARCHS)) |
| 100 |
ifeq ($(DEB_NAME_ACT),gcc-15-cross) |
| 101 |
ifneq (,$(filter $(HOST_ARCH),amd64 i386 x32)) |
| 102 |
CROSS_ARCHS ?= amd64 arm64 s390x ppc64el armhf riscv64 \ |
| 103 |
$(if $(filter $(vendor), Ubuntu), powerpc) \ |
| 104 |
$(if $(filter $(HOST_ARCH), amd64 x32), i386) |
| 105 |
else ifeq ($(HOST_ARCH),arm64) |
| 106 |
CROSS_ARCHS ?= amd64 armhf i386 ppc64el riscv64 s390x \ |
| 107 |
$(if $(filter $(vendor), Ubuntu), powerpc) |
| 108 |
else ifeq ($(HOST_ARCH),ppc64) |
| 109 |
CROSS_ARCHS ?= ppc64el |
| 110 |
else ifeq ($(HOST_ARCH),ppc64el) |
| 111 |
CROSS_ARCHS ?= amd64 arm64 armhf i386 riscv64 s390x \ |
| 112 |
$(if $(filter $(vendor), Ubuntu), powerpc) |
| 113 |
else ifeq ($(HOST_ARCH),s390x) |
| 114 |
CROSS_ARCHS ?= amd64 arm64 armhf i386 ppc64el riscv64 \ |
| 115 |
$(if $(filter $(vendor), Ubuntu), powerpc) |
| 116 |
else |
| 117 |
CROSS_ARCHS = |
| 118 |
endif |
| 119 |
GCC_PORTS_BUILD= |
| 120 |
else ifeq ($(DEB_NAME_ACT),gcc-15-cross-ports) |
| 121 |
ifneq (,$(filter $(HOST_ARCH),amd64 i386 x32)) |
| 122 |
CROSS_ARCHS ?= alpha arc armel hppa loong64 m68k ppc64 sh4 sparc64 \ |
| 123 |
$(if $(filter $(vendor), Ubuntu),, powerpc) \ |
| 124 |
$(if $(filter $(HOST_ARCH), amd64 i386), x32) |
| 125 |
else ifeq ($(HOST_ARCH),arm64) |
| 126 |
CROSS_ARCHS ?= alpha arc armel hppa loong64 m68k sh4 sparc64 x32 \ |
| 127 |
$(if $(filter $(vendor), Ubuntu),, powerpc) |
| 128 |
else ifeq ($(HOST_ARCH),ppc64el) |
| 129 |
CROSS_ARCHS ?= alpha arc armel hppa loong64 m68k sh4 sparc64 x32 \ |
| 130 |
$(if $(filter $(vendor), Ubuntu),, powerpc) ppc64 |
| 131 |
else ifeq ($(HOST_ARCH),s390x) |
| 132 |
CROSS_ARCHS ?= ppc64 \ |
| 133 |
$(if $(filter $(vendor), Ubuntu),, powerpc) |
| 134 |
else |
| 135 |
CROSS_ARCHS = |
| 136 |
endif |
| 137 |
GCC_PORTS_BUILD=-ports |
| 138 |
else ifeq ($(DEB_NAME_ACT),gcc-15-cross-mipsen) |
| 139 |
ifneq (,$(filter $(HOST_ARCH),$(mipsen_archs))) |
| 140 |
CROSS_ARCHS ?= mips mipsel mips64el mips64 \ |
| 141 |
mipsr6 mipsr6el mips64r6 mips64r6el |
| 142 |
# n32: mipsn32 mipsn32el mipsn32r6 mipsn32r6el |
| 143 |
# have problem on ada |
| 144 |
endif |
| 145 |
GCC_PORTS_BUILD=-mipsen |
| 146 |
else |
| 147 |
$(error Unknown source package $(DEB_NAME_ACT)) |
| 148 |
endif |
| 149 |
endif |
| 150 |
|
| 151 |
CROSS_ARCH = $(subst .,,$(suffix $@)) |
| 152 |
KERNEL_ARCH = $(KERNEL_ARCH_$(CROSS_ARCH)) |
| 153 |
CROSS_BIARCH = $(CROSS_BIARCH_$(CROSS_ARCH)) |
| 154 |
_gnu_type = $(shell dpkg-architecture -a$(1) -qDEB_HOST_GNU_TYPE -f) |
| 155 |
_pkg_gnu_type = $(shell dpkg-architecture -a$(1) -qDEB_HOST_GNU_TYPE -f | tr _ -) |
| 156 |
CROSS_GNU_TYPE = $(call _gnu_type,${CROSS_ARCH}) |
| 157 |
HOST_ARCHS = $(HOST_ARCH_$(CROSS_ARCH)) |
| 158 |
ADA_HOST_ARCHS = $(HOST_ARCH_$(CROSS_ARCH)) |
| 159 |
ADA64_HOST_ARCHS = $(filter-out i386,$(HOST_ARCH_$(CROSS_ARCH))) |
| 160 |
|
| 161 |
ARM32_MULTILIBS := |
| 162 |
ifeq ($(vendor),Ubuntu) |
| 163 |
ifneq (,$(filter $(distrelease), precise trusty xenial bionic focal groovy hirsute)) |
| 164 |
ARM32_MULTILIBS := yes |
| 165 |
endif |
| 166 |
endif |
| 167 |
|
| 168 |
ifeq ($(vendor),Debian) |
| 169 |
skip_dbg_packages = yes |
| 170 |
else ifeq ($(vendor),Ubuntu) |
| 171 |
endif |
| 172 |
|
| 173 |
libgcc_source := $(shell apt-cache show --no-all-versions libgcc-s1-arm64-cross | awk '/^Source:/ { print $$2 }') |
| 174 |
#ifneq ($(DEB_NAME_ACT),$(libgcc_source)) |
| 175 |
# skip_common_packages = yes |
| 176 |
#endif |
| 177 |
|
| 178 |
BINUTILS_BUILD_DEPS = $(foreach a,$(CROSS_ARCHS),binutils-$(call _pkg_gnu_type,$(a)) (>= $(MIN_VER_BINUTILS)) [$(HOST_ARCHS_$(a))]$(,)) |
| 179 |
GLIBC_BUILD_DEPS = $(foreach a,$(CROSS_ARCHS),libc6$(if $(filter $(a),alpha ia64),.1)-dev-$(a)-cross (>= $(MIN_VER_GLIBC)) [$(HOST_ARCHS_$(a))]$(,)) |
| 180 |
LINUX_BUILD_DEPS = $(foreach a,$(CROSS_ARCHS),linux-libc-dev-$(a)-cross [$(HOST_ARCHS_$(a))]$(,)) |
| 181 |
|
| 182 |
# build multilib cross compilers |
| 183 |
ifeq ($(ARM32_MULTILIBS),yes) |
| 184 |
ifneq (,$(filter armel, $(CROSS_ARCHS))) |
| 185 |
EXTRA_BUILD_DEPS += libc6-dev-armhf-cross [$(HOST_ARCHS_armel)], |
| 186 |
ifeq ($(skip_common_packages),yes) |
| 187 |
GCC_BUILD_DEPS += libhfgcc-s1-armel-cross [$(HOST_ARCHS_armel)], |
| 188 |
endif |
| 189 |
endif |
| 190 |
|
| 191 |
ifneq (,$(filter armhf, $(CROSS_ARCHS))) |
| 192 |
EXTRA_BUILD_DEPS += libc6-dev-armel-cross [$(HOST_ARCHS_armhf)], |
| 193 |
ifeq ($(skip_common_packages),yes) |
| 194 |
GCC_BUILD_DEPS += libsfgcc-s1-armhf-cross [$(HOST_ARCHS_armhf)], |
| 195 |
endif |
| 196 |
endif |
| 197 |
endif |
| 198 |
|
| 199 |
ifneq (,$(filter amd64, $(CROSS_ARCHS))) |
| 200 |
EXTRA_BUILD_DEPS += libc6-dev-i386-amd64-cross [$(HOST_ARCHS_amd64)], |
| 201 |
EXTRA_BUILD_DEPS += libc6-dev-x32-amd64-cross [$(HOST_ARCHS_amd64)], |
| 202 |
ifeq ($(skip_common_packages),yes) |
| 203 |
GCC_BUILD_DEPS += lib32gcc-s1-amd64-cross [$(HOST_ARCHS_amd64)], |
| 204 |
GCC_BUILD_DEPS += libx32gcc-s1-amd64-cross [$(HOST_ARCHS_amd64)], |
| 205 |
endif |
| 206 |
endif |
| 207 |
|
| 208 |
ifneq (,$(filter i386, $(CROSS_ARCHS))) |
| 209 |
EXTRA_BUILD_DEPS += libc6-dev-amd64-i386-cross [$(HOST_ARCHS_i386)], |
| 210 |
EXTRA_BUILD_DEPS += libc6-dev-x32-i386-cross [$(HOST_ARCHS_i386)], |
| 211 |
ifeq ($(skip_common_packages),yes) |
| 212 |
GCC_BUILD_DEPS += lib64gcc-s1-i386-cross [$(HOST_ARCHS_i386)], |
| 213 |
GCC_BUILD_DEPS += libx32gcc-s1-i386-cross [$(HOST_ARCHS_i386)], |
| 214 |
endif |
| 215 |
endif |
| 216 |
|
| 217 |
ifneq (,$(filter x32, $(CROSS_ARCHS))) |
| 218 |
EXTRA_BUILD_DEPS += libc6-dev-i386-x32-cross [$(HOST_ARCHS_x32)], |
| 219 |
EXTRA_BUILD_DEPS += libc6-dev-amd64-x32-cross [$(HOST_ARCHS_x32)], |
| 220 |
ifeq ($(skip_common_packages),yes) |
| 221 |
GCC_BUILD_DEPS += lib32gcc-s1-x32-cross [$(HOST_ARCHS_x32)], |
| 222 |
GCC_BUILD_DEPS += lib64gcc-s1-x32-cross [$(HOST_ARCHS_x32)], |
| 223 |
endif |
| 224 |
endif |
| 225 |
|
| 226 |
ifneq (,$(filter ppc64, $(CROSS_ARCHS))) |
| 227 |
EXTRA_BUILD_DEPS += libc6-dev-powerpc-ppc64-cross [$(HOST_ARCHS_ppc64)], |
| 228 |
ifeq ($(skip_common_packages),yes) |
| 229 |
GCC_BUILD_DEPS += lib32gcc-s1-ppc64-cross [$(HOST_ARCHS_ppc64)], |
| 230 |
endif |
| 231 |
endif |
| 232 |
|
| 233 |
ifneq ($(vendor),Ubuntu) |
| 234 |
ifneq (,$(filter s390x, $(CROSS_ARCHS))) |
| 235 |
EXTRA_BUILD_DEPS += libc6-dev-s390-s390x-cross [$(HOST_ARCHS_s390x)], |
| 236 |
ifeq ($(skip_common_packages),yes) |
| 237 |
GCC_BUILD_DEPS += lib32gcc-s1-s390x-cross [$(HOST_ARCHS_s390x)], |
| 238 |
endif |
| 239 |
endif |
| 240 |
endif |
| 241 |
|
| 242 |
ifneq (,$(filter sparc64, $(CROSS_ARCHS))) |
| 243 |
EXTRA_BUILD_DEPS += libc6-dev-sparc-sparc64-cross [$(HOST_ARCHS_sparc64)], |
| 244 |
ifeq ($(skip_common_packages),yes) |
| 245 |
GCC_BUILD_DEPS += lib32gcc-s1-sparc64-cross [$(HOST_ARCHS_sparc64)], |
| 246 |
endif |
| 247 |
endif |
| 248 |
|
| 249 |
ifneq (,$(filter powerpc, $(CROSS_ARCHS))) |
| 250 |
EXTRA_BUILD_DEPS += libc6-dev-ppc64-powerpc-cross [$(HOST_ARCHS_powerpc)], |
| 251 |
ifeq ($(skip_common_packages),yes) |
| 252 |
GCC_BUILD_DEPS += lib64gcc-s1-powerpc-cross [$(HOST_ARCHS_powerpc)], |
| 253 |
endif |
| 254 |
endif |
| 255 |
|
| 256 |
ifneq (,$(filter mips, $(CROSS_ARCHS))) |
| 257 |
EXTRA_BUILD_DEPS += libc6-dev-mips64-mips-cross [$(HOST_ARCHS_mips)], |
| 258 |
EXTRA_BUILD_DEPS += libc6-dev-mipsn32-mips-cross [$(HOST_ARCHS_mips)], |
| 259 |
ifeq ($(skip_common_packages),yes) |
| 260 |
GCC_BUILD_DEPS += lib64gcc-s1-mips-cross [$(HOST_ARCHS_mips)], |
| 261 |
GCC_BUILD_DEPS += libn32gcc-s1-mips-cross [$(HOST_ARCHS_mips)], |
| 262 |
endif |
| 263 |
endif |
| 264 |
|
| 265 |
ifneq (,$(filter mipsel, $(CROSS_ARCHS))) |
| 266 |
EXTRA_BUILD_DEPS += libc6-dev-mips64-mipsel-cross [$(HOST_ARCHS_mipsel)], |
| 267 |
EXTRA_BUILD_DEPS += libc6-dev-mipsn32-mipsel-cross [$(HOST_ARCHS_mipsel)], |
| 268 |
ifeq ($(skip_common_packages),yes) |
| 269 |
GCC_BUILD_DEPS += lib64gcc-s1-mipsel-cross [$(HOST_ARCHS_mipsel)], |
| 270 |
GCC_BUILD_DEPS += libn32gcc-s1-mipsel-cross [$(HOST_ARCHS_mipsel)], |
| 271 |
endif |
| 272 |
endif |
| 273 |
|
| 274 |
ifneq (,$(filter mipsn32, $(CROSS_ARCHS))) |
| 275 |
EXTRA_BUILD_DEPS += libc6-dev-mips32-mipsn32-cross [$(HOST_ARCHS_mipsn32)], |
| 276 |
EXTRA_BUILD_DEPS += libc6-dev-mips64-mipsn32-cross [$(HOST_ARCHS_mipsn32)], |
| 277 |
ifeq ($(skip_common_packages),yes) |
| 278 |
GCC_BUILD_DEPS += lib32gcc-s1-mipsn32-cross [$(HOST_ARCHS_mipsn32)], |
| 279 |
GCC_BUILD_DEPS += lib64gcc-s1-mipsn32-cross [$(HOST_ARCHS_mipsn32)], |
| 280 |
endif |
| 281 |
endif |
| 282 |
|
| 283 |
ifneq (,$(filter mipsn32el, $(CROSS_ARCHS))) |
| 284 |
EXTRA_BUILD_DEPS += libc6-dev-mips32-mipsn32el-cross [$(HOST_ARCHS_mipsn32el)], |
| 285 |
EXTRA_BUILD_DEPS += libc6-dev-mips64-mipsn32el-cross [$(HOST_ARCHS_mipsn32el)], |
| 286 |
ifeq ($(skip_common_packages),yes) |
| 287 |
GCC_BUILD_DEPS += lib32gcc-s1-mipsn32el-cross [$(HOST_ARCHS_mipsn32el)], |
| 288 |
GCC_BUILD_DEPS += lib64gcc-s1-mipsn32el-cross [$(HOST_ARCHS_mipsn32el)], |
| 289 |
endif |
| 290 |
endif |
| 291 |
|
| 292 |
ifneq (,$(filter mips64, $(CROSS_ARCHS))) |
| 293 |
EXTRA_BUILD_DEPS += libc6-dev-mips32-mips64-cross [$(HOST_ARCHS_mips64)], |
| 294 |
EXTRA_BUILD_DEPS += libc6-dev-mipsn32-mips64-cross [$(HOST_ARCHS_mips64)], |
| 295 |
ifeq ($(skip_common_packages),yes) |
| 296 |
GCC_BUILD_DEPS += lib32gcc-s1-mips64-cross [$(HOST_ARCHS_mips64)], |
| 297 |
GCC_BUILD_DEPS += libn32gcc-s1-mips64-cross [$(HOST_ARCHS_mips64)], |
| 298 |
endif |
| 299 |
endif |
| 300 |
|
| 301 |
ifneq (,$(filter mips64el, $(CROSS_ARCHS))) |
| 302 |
EXTRA_BUILD_DEPS += libc6-dev-mips32-mips64el-cross [$(HOST_ARCHS_mips64el)], |
| 303 |
EXTRA_BUILD_DEPS += libc6-dev-mipsn32-mips64el-cross [$(HOST_ARCHS_mips64el)], |
| 304 |
ifeq ($(skip_common_packages),yes) |
| 305 |
GCC_BUILD_DEPS += lib32gcc-s1-mips64el-cross [$(HOST_ARCHS_mips64el)], |
| 306 |
GCC_BUILD_DEPS += libn32gcc-s1-mips64el-cross [$(HOST_ARCHS_mips64el)], |
| 307 |
endif |
| 308 |
endif |
| 309 |
|
| 310 |
ifneq (,$(filter mipsr6, $(CROSS_ARCHS))) |
| 311 |
EXTRA_BUILD_DEPS += libc6-dev-mips64-mipsr6-cross [$(HOST_ARCHS_mipsr6)], |
| 312 |
EXTRA_BUILD_DEPS += libc6-dev-mipsn32-mipsr6-cross [$(HOST_ARCHS_mipsr6)], |
| 313 |
ifeq ($(skip_common_packages),yes) |
| 314 |
GCC_BUILD_DEPS += lib64gcc-s1-mipsr6-cross [$(HOST_ARCHS_mipsr6)], |
| 315 |
GCC_BUILD_DEPS += libn32gcc-s1-mipsr6-cross [$(HOST_ARCHS_mipsr6)], |
| 316 |
endif |
| 317 |
endif |
| 318 |
|
| 319 |
ifneq (,$(filter mipsr6el, $(CROSS_ARCHS))) |
| 320 |
EXTRA_BUILD_DEPS += libc6-dev-mips64-mipsr6el-cross [$(HOST_ARCHS_mipsr6el)], |
| 321 |
EXTRA_BUILD_DEPS += libc6-dev-mipsn32-mipsr6el-cross [$(HOST_ARCHS_mipsr6el)], |
| 322 |
ifeq ($(skip_common_packages),yes) |
| 323 |
GCC_BUILD_DEPS += lib64gcc-s1-mipsr6el-cross [$(HOST_ARCHS_mipsr6el)], |
| 324 |
GCC_BUILD_DEPS += libn32gcc-s1-mipsr6el-cross [$(HOST_ARCHS_mipsr6el)], |
| 325 |
endif |
| 326 |
endif |
| 327 |
|
| 328 |
ifneq (,$(filter mipsn32r6, $(CROSS_ARCHS))) |
| 329 |
EXTRA_BUILD_DEPS += libc6-dev-mips32-mipsn32r6-cross [$(HOST_ARCHS_mipsn32r6)], |
| 330 |
EXTRA_BUILD_DEPS += libc6-dev-mips64-mipsn32r6-cross [$(HOST_ARCHS_mipsn32r6)], |
| 331 |
ifeq ($(skip_common_packages),yes) |
| 332 |
GCC_BUILD_DEPS += lib32gcc-s1-mipsn32r6-cross [$(HOST_ARCHS_mipsn32r6)], |
| 333 |
GCC_BUILD_DEPS += lib64gcc-s1-mipsn32r6-cross [$(HOST_ARCHS_mipsn32r6)], |
| 334 |
endif |
| 335 |
endif |
| 336 |
|
| 337 |
ifneq (,$(filter mipsn32r6el, $(CROSS_ARCHS))) |
| 338 |
EXTRA_BUILD_DEPS += libc6-dev-mips32-mipsn32r6el-cross [$(HOST_ARCHS_mipsn32r6el)], |
| 339 |
EXTRA_BUILD_DEPS += libc6-dev-mips64-mipsn32r6el-cross [$(HOST_ARCHS_mipsn32r6el)], |
| 340 |
ifeq ($(skip_common_packages),yes) |
| 341 |
GCC_BUILD_DEPS += lib32gcc-s1-mipsn32r6el-cross [$(HOST_ARCHS_mipsn32r6el)], |
| 342 |
GCC_BUILD_DEPS += lib64gcc-s1-mipsn32r6el-cross [$(HOST_ARCHS_mipsn32r6el)], |
| 343 |
endif |
| 344 |
endif |
| 345 |
|
| 346 |
ifneq (,$(filter mips64r6, $(CROSS_ARCHS))) |
| 347 |
EXTRA_BUILD_DEPS += libc6-dev-mips32-mips64r6-cross [$(HOST_ARCHS_mips64r6)], |
| 348 |
EXTRA_BUILD_DEPS += libc6-dev-mipsn32-mips64r6-cross [$(HOST_ARCHS_mips64r6)], |
| 349 |
ifeq ($(skip_common_packages),yes) |
| 350 |
GCC_BUILD_DEPS += lib32gcc-s1-mips64r6-cross [$(HOST_ARCHS_mips64r6)], |
| 351 |
GCC_BUILD_DEPS += libn32gcc-s1-mips64r6-cross [$(HOST_ARCHS_mips64r6)], |
| 352 |
endif |
| 353 |
endif |
| 354 |
|
| 355 |
ifneq (,$(filter mips64r6el, $(CROSS_ARCHS))) |
| 356 |
EXTRA_BUILD_DEPS += libc6-dev-mips32-mips64r6el-cross [$(HOST_ARCHS_mips64r6el)], |
| 357 |
EXTRA_BUILD_DEPS += libc6-dev-mipsn32-mips64r6el-cross [$(HOST_ARCHS_mips64r6el)], |
| 358 |
ifeq ($(skip_common_packages),yes) |
| 359 |
GCC_BUILD_DEPS += lib32gcc-s1-mips64r6el-cross [$(HOST_ARCHS_mips64r6el)], |
| 360 |
GCC_BUILD_DEPS += libn32gcc-s1-mips64r6el-cross [$(HOST_ARCHS_mips64r6el)], |
| 361 |
endif |
| 362 |
endif |
| 363 |
|
| 364 |
PHOBOS_ARCHS = amd64 armel armhf arm64 i386 x32 kfreebsd-amd64 kfreebsd-i386 \ |
| 365 |
hppa ppc64el riscv64 s390x sparc64 \ |
| 366 |
mips mips64 mipsel mips64el mipsn32 mipsn32el \ |
| 367 |
mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el |
| 368 |
|
| 369 |
PHOBOS_DEP = libgphobos-GCC_VER-dev-CROSS_ARCH-cross (= $${gcc:Version}), |
| 370 |
# FIXME: Set correctly ... |
| 371 |
PHOBOS_ML_DEP = libgphobos-GCC_VER-dev-CROSS_ARCH-cross (= $${gcc:Version}), |
| 372 |
|
| 373 |
|
| 374 |
info: |
| 375 |
@echo "Package name: ${DEB_NAME_ACT} ${DEB_VER_ACT}" |
| 376 |
@echo 'Package metadata: $(ELF_PACKAGE_METADATA)' |
| 377 |
@echo |
| 378 |
@echo "GCC ${GCC_VER} version: ${VER_GCC} ${DEB_VER_GCC}" |
| 379 |
@echo |
| 380 |
@echo "Target architecture: ${CROSS_ARCH}" |
| 381 |
@echo "Target GNU type: ${CROSS_GNU_TYPE}" |
| 382 |
@echo "Host architecture: ${HOST_ARCH}" |
| 383 |
@echo "Host GNU type: ${HOST_GNU_TYPE}" |
| 384 |
@echo "skips (debug/common): $(skip_dbg_packages)/$(skip_common_packages)" |
| 385 |
|
| 386 |
$(stamp)init-gcc: |
| 387 |
@echo START $@ |
| 388 |
rm -rf bin |
| 389 |
mkdir -p bin |
| 390 |
ln -s /usr/bin/gcc-$(GCC_VER) bin/gcc |
| 391 |
ln -s /usr/bin/g++-$(GCC_VER) bin/g++ |
| 392 |
ln -s /usr/bin/gnatbind-$(GCC_VER) bin/gnatbind |
| 393 |
ln -s /usr/bin/gnatmake-$(GCC_VER) bin/gnatmake |
| 394 |
ln -s /usr/bin/gnatlink-$(GCC_VER) bin/gnatlink |
| 395 |
ln -s /usr/bin/gnatls-$(GCC_VER) bin/gnatls |
| 396 |
mkdir -p gcc |
| 397 |
set -ex; \ |
| 398 |
cd gcc ; \ |
| 399 |
ln -sf $(GCC_TARBALL) $(notdir $(GCC_TARBALL)) ;\ |
| 400 |
cp -a $(GCC_DIR)/debian/ . ; \ |
| 401 |
if [ -n "$$(grep -v '^\#' $(CURDIR)/debian/patches/gcc/series)" ]; then \ |
| 402 |
QUILT_PATCHES=$(CURDIR)/debian/patches/gcc quilt push --quiltrc /dev/null -a ; \ |
| 403 |
fi |
| 404 |
# set -ex; \ |
| 405 |
# if dpkg --compare-versions $(DEB_VER_GCC) lt 15.0.0-1; then \ |
| 406 |
# cd gcc; \ |
| 407 |
# patch -p1 < ../debian/patches/gcc/updates.diff; \ |
| 408 |
# fi |
| 409 |
touch $@ |
| 410 |
|
| 411 |
$(stamp)build-gcc.%: $(stamp)init-gcc |
| 412 |
@echo START $@ |
| 413 |
@if [ "$(HOST_ARCH)" = "$(CROSS_ARCH)" ] && [ "X$(dbp_flag)" = X-B ]; then \ |
| 414 |
echo "Skipping binary-arch build for $(CROSS_ARCH)"; \ |
| 415 |
else \ |
| 416 |
set -x; \ |
| 417 |
echo ${CROSS_ARCH} >gcc/debian/target; \ |
| 418 |
cd gcc && \ |
| 419 |
PATH=$(CURDIR)/bin:$$PATH \ |
| 420 |
WITH_SYSROOT=/ \ |
| 421 |
PKG_IGNORE_CURRENTLY_BUILDING=1 \ |
| 422 |
BACKPORT=false \ |
| 423 |
WITHOUT_LANG="hppa64 jit nvptx" \ |
| 424 |
GNATMAKE=gnatmake-$(GCC_VER) \ |
| 425 |
GNATBIND=gnatbind-$(GCC_VER) \ |
| 426 |
$(if $(filter $(HOST_ARCH),$(CROSS_ARCH)),FORCE_CROSS_LAYOUT=yes WITH_BOOTSTRAP=off) \ |
| 427 |
GCC_PORTS_BUILD=$(GCC_PORTS_BUILD) \ |
| 428 |
dpkg-buildpackage $(if $(filter $(HOST_ARCH),$(CROSS_ARCH)),$(subst -b,-A,$(dbp_flag)),$(dbp_flag)) -uc -us -d; \ |
| 429 |
fi |
| 430 |
touch $@ |
| 431 |
|
| 432 |
clean: |
| 433 |
rm -rf bin gcc tmp-* |
| 434 |
rm -f *.*deb *.changes *.buildinfo debian/files |
| 435 |
rm -rf $(stamp) |
| 436 |
mkdir $(stamp) |
| 437 |
dh_clean |
| 438 |
|
| 439 |
$(stamp)repack-%: |
| 440 |
@umask 022; \ |
| 441 |
if [ -z "$(TARGET_ARCH)" ]; then \ |
| 442 |
echo >&2 "repack: macro TARGET_ARCH not set"; \ |
| 443 |
exit 1; \ |
| 444 |
fi; \ |
| 445 |
t_arch=$(TARGET_ARCH); \ |
| 446 |
t_gnu_type=$(call _gnu_type,$(TARGET_ARCH)); \ |
| 447 |
deb=$*; \ |
| 448 |
pkgname=`echo $$deb | cut -d'_' -f1`; \ |
| 449 |
tmp=tmp-$$pkgname; \ |
| 450 |
if [ "$(skip_dbg_packages)" = yes ]; then \ |
| 451 |
case $$deb in *-dbg*) exit 0; esac; \ |
| 452 |
fi; \ |
| 453 |
echo "repack $$pkgname ($$deb) ..."; \ |
| 454 |
rm -rf $$tmp; \ |
| 455 |
mkdir -p $$tmp; \ |
| 456 |
dpkg-deb -x $$deb $$tmp; \ |
| 457 |
dpkg-deb -e $$deb $$tmp/DEBIAN; \ |
| 458 |
sed -i -e's/^Source:.*/Source: $(DEB_NAME_ACT) ($(DEB_SVER_ACT))/' \ |
| 459 |
-e "/^Depends:/s/$(DEB_VER_GCC)/$(DEB_VER_GCC)$(CROSS_EXT)/g" \ |
| 460 |
-e "/^Recommends:/s/$(DEB_VER_GCC)/$(DEB_VER_GCC)$(CROSS_EXT)/g" \ |
| 461 |
-e "/^Suggests:/s/$(DEB_VER_GCC)/$(DEB_VER_GCC)$(CROSS_EXT)/g" \ |
| 462 |
-e "/^Version:/s/$(DEB_VER_GCC)/$(DEB_VER_GCC)$(CROSS_EXT)/" \ |
| 463 |
$$tmp/DEBIAN/control ; \ |
| 464 |
sed -i -e "/^Depends:/s/\(libgnat-[0-9]*\) (>= $(DEB_VER_GCC)$(CROSS_EXT))/\1 (>= $(VER_GCC))/g" \ |
| 465 |
$$tmp/DEBIAN/control ; \ |
| 466 |
sed -i -e "/^Depends:/s/\(libgnat-util[0-9]*\) (>= $(DEB_VER_GCC)$(CROSS_EXT))/\1 (>= $(VER_GCC))/g" \ |
| 467 |
$$tmp/DEBIAN/control ; \ |
| 468 |
case $$pkgname in \ |
| 469 |
gcc-$(GCC_VER)-$${t_gnu_type}) \ |
| 470 |
sed -i -e '/Depends/s/\(libcc1[^,]*\)$(CROSS_EXT)/\1/' \ |
| 471 |
$$tmp/DEBIAN/control;; \ |
| 472 |
*-cross) \ |
| 473 |
sed -i -e '/^Depends:/s/\(-base *( *\)=\([^)]*\)cross[^)]*)/\1>=\2)/' \ |
| 474 |
$$tmp/DEBIAN/control;; \ |
| 475 |
esac; \ |
| 476 |
install -d -m 755 $$tmp/usr/share/lintian/overrides; \ |
| 477 |
if [ -e debian/overrides/$$pkgname ]; then \ |
| 478 |
cp debian/overrides/$$pkgname $$tmp/usr/share/lintian/overrides/; \ |
| 479 |
fi; \ |
| 480 |
case "$$pkgname" in \ |
| 481 |
gcc-$(GCC_VER)-cross-base*) \ |
| 482 |
echo "$$pkgname binary: wrong-name-for-changelog-of-native-package" \ |
| 483 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname \ |
| 484 |
;; \ |
| 485 |
gcc-$(GCC_VER)-*-base) \ |
| 486 |
echo "$$pkgname binary: wrong-name-for-changelog-of-native-package" \ |
| 487 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname \ |
| 488 |
;; \ |
| 489 |
gcc-$(GCC_VER)-multilib) \ |
| 490 |
echo "$$pkgname binary: binary-from-other-architecture" \ |
| 491 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname \ |
| 492 |
;; \ |
| 493 |
gccgo-$(GCC_VER)*) \ |
| 494 |
echo "$$pkgname binary: binary-from-other-architecture" \ |
| 495 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 496 |
echo "$$pkgname binary: non-standard-dir-in-usr" \ |
| 497 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 498 |
;; \ |
| 499 |
*-multilib-*) \ |
| 500 |
;; \ |
| 501 |
cpp-*|g++-*|gcc-*|gccgo-*|gdc-*|gfortran-*|gobjc*|gm2-*|gccrs-*|gnat-$(GCC_VER)-sjlj-*) \ |
| 502 |
echo "$$pkgname binary: binary-from-other-architecture" \ |
| 503 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname \ |
| 504 |
;; \ |
| 505 |
gnat-$(GCC_VER)-*) \ |
| 506 |
echo "$$pkgname binary: binary-from-other-architecture" \ |
| 507 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 508 |
echo "$$pkgname binary: non-standard-dir-in-usr" \ |
| 509 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 510 |
;; \ |
| 511 |
*-dev-$${t_arch}-cross) \ |
| 512 |
echo "$$pkgname binary: arch-independent-package-contains-binary-or-object" \ |
| 513 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 514 |
echo "$$pkgname binary: non-standard-dir-in-usr" \ |
| 515 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 516 |
;; \ |
| 517 |
*-dbg-$${t_arch}-cross) \ |
| 518 |
echo "$$pkgname binary: arch-independent-package-contains-binary-or-object" \ |
| 519 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 520 |
echo "$$pkgname binary: debug-package-should-be-named-dbg" \ |
| 521 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 522 |
echo "$$pkgname binary: non-standard-dir-in-usr" \ |
| 523 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 524 |
;; \ |
| 525 |
*-pic-$${t_arch}-cross) \ |
| 526 |
echo "$$pkgname binary: arch-independent-package-contains-binary-or-object" \ |
| 527 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 528 |
;; \ |
| 529 |
*-$${t_arch}-cross) \ |
| 530 |
echo "$$pkgname binary: arch-independent-package-contains-binary-or-object" \ |
| 531 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 532 |
echo "$$pkgname binary: non-standard-dir-in-usr" \ |
| 533 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 534 |
echo "$$pkgname binary: shlibs-declares-dependency-on-other-package" \ |
| 535 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 536 |
case "$$pkgname" in \ |
| 537 |
lib*gphobos*) \ |
| 538 |
echo "$$pkgname binary: embedded-library" \ |
| 539 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname;; \ |
| 540 |
*-hppa-cross) \ |
| 541 |
echo "$$pkgname binary: binary-compiled-with-profiling-enabled" \ |
| 542 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname;; \ |
| 543 |
esac; \ |
| 544 |
;; \ |
| 545 |
esac; \ |
| 546 |
case $$pkgname in \ |
| 547 |
lib*san*-cross) \ |
| 548 |
echo "$$pkgname binary: custom-library-search-path" \ |
| 549 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \ |
| 550 |
esac; \ |
| 551 |
case $$pkgname in \ |
| 552 |
lib*san*-cross) \ |
| 553 |
echo "$$pkgname binary: custom-library-search-path" \ |
| 554 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname;; \ |
| 555 |
libstdc++-*-dev-amd64-cross) \ |
| 556 |
sed -i -e "/^Depends:/s/libc6 /libc6-amd64-cross /g" \ |
| 557 |
-e "/^Depends:/s/libgcc-s1 /libgcc-s1-amd64-cross /g" \ |
| 558 |
$$tmp/DEBIAN/control; \ |
| 559 |
echo "$$pkgname binary: missing-dependency-on-libc" \ |
| 560 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname;; \ |
| 561 |
lib64stdc++-*-dev-i386-cross) \ |
| 562 |
sed -i -e "/^Depends:/s/libc6 /libc6-amd64-i386-cross /g" \ |
| 563 |
-e "/^Depends:/s/libgcc-s1 /lib64gcc-s1-i386-cross /g" \ |
| 564 |
$$tmp/DEBIAN/control; \ |
| 565 |
echo "$$pkgname binary: missing-dependency-on-libc" \ |
| 566 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname;; \ |
| 567 |
lib64stdc++-*-dev-x32-cross) \ |
| 568 |
sed -i -e "/^Depends:/s/libc6 /libc6-amd64-x32-cross /g" \ |
| 569 |
-e "/^Depends:/s/libgcc-s1 /lib64gcc-s1-x32-cross /g" \ |
| 570 |
$$tmp/DEBIAN/control; \ |
| 571 |
echo "$$pkgname binary: missing-dependency-on-libc" \ |
| 572 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname;; \ |
| 573 |
lib??*stdc++-*-dev-*-cross) \ |
| 574 |
sed -i -e "/^Depends:/s/\(libc6-[[a-z0-9]*\):\([a-z0-9]*\)/\1-\2-cross/g" \ |
| 575 |
$$tmp/DEBIAN/control; \ |
| 576 |
echo "$$pkgname binary: missing-dependency-on-libc" \ |
| 577 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname;; \ |
| 578 |
libstdc++-*-dev-*-cross) \ |
| 579 |
sed -i -e "/^Depends:/s/\(libc6[.1]*\):\([a-z0-9]*\)/\1-\2-cross/g" \ |
| 580 |
$$tmp/DEBIAN/control; \ |
| 581 |
echo "$$pkgname binary: missing-dependency-on-libc" \ |
| 582 |
>> $$tmp/usr/share/lintian/overrides/$$pkgname;; \ |
| 583 |
esac; \ |
| 584 |
if [ -e $$tmp/usr/share/doc/gcc-${GCC_VER}-$${t_gnu_type}-base/changelog.Debian.gz ]; then \ |
| 585 |
mv $$tmp/usr/share/doc/gcc-${GCC_VER}-$${t_gnu_type}-base/changelog.Debian.gz \ |
| 586 |
$$tmp/usr/share/doc/gcc-${GCC_VER}-$${t_gnu_type}-base/changelog.Debian.gcc-${GCC_VER}.gz; \ |
| 587 |
gzip -c9n debian/changelog \ |
| 588 |
> $$tmp/usr/share/doc/gcc-${GCC_VER}-$${t_gnu_type}-base/changelog.Debian.gz;\ |
| 589 |
fi ; \ |
| 590 |
rm -f $$tmp/DEBIAN/md5sums; \ |
| 591 |
(cd $$tmp && find usr -type f | LC_ALL=C sort | xargs -r md5sum >>DEBIAN/md5sums); \ |
| 592 |
find $$tmp/DEBIAN -name md5sums -empty | xargs -r rm -f; \ |
| 593 |
newdeb=`echo $$deb|sed -e "s/\(.*\)_\(.*\)_\(.*\)/\1_\2$(CROSS_EXT)_\3/g"`; \ |
| 594 |
NO_PKG_MANGLE=1 dpkg-deb --threads-max=2 -b $$tmp ../$$newdeb; \ |
| 595 |
rm -rf $$tmp |
| 596 |
touch $@ |
| 597 |
|
| 598 |
$(stamp)repack-debs-arch: $(stamp)build |
| 599 |
@echo START $@ |
| 600 |
dh_testroot |
| 601 |
$(MAKE) $(NJOBS) -f debian/rules TARGET_ARCH=$(HOST_ARCH) \ |
| 602 |
$(addprefix $(stamp)repack-,$(wildcard *_$(HOST_ARCH).deb)) |
| 603 |
$(MAKE) $(NJOBS) -f debian/rules TARGET_ARCH=$(HOST_ARCH) \ |
| 604 |
$(addprefix $(stamp)repack-,$(wildcard *$(DEB_VER_GCC)_$(HOST_ARCH).ddeb)) |
| 605 |
rm -f *$(DEB_VER_GCC)_$(HOST_ARCH).ddeb |
| 606 |
if [ -f ../gcc-$(GCC_VER)-$(call _gnu_type,$(HOST_ARCH))-dbgsym_${DEB_VER_GCC}$(CROSS_EXT)_$(HOST_ARCH).ddeb ]; then mv -f ../*.ddeb . ; fi |
| 607 |
touch $@ |
| 608 |
|
| 609 |
$(stamp)repack-debs-indep: $(stamp)build |
| 610 |
@echo START $@ |
| 611 |
dh_testroot |
| 612 |
set -e; \ |
| 613 |
$(foreach arch,$(CROSS_ARCHS), \ |
| 614 |
$(MAKE) $(NJOBS) -f debian/rules TARGET_ARCH=$(arch) \ |
| 615 |
$(addprefix $(stamp)repack-,$(wildcard *-$(arch)-cross_*_all.deb)); \ |
| 616 |
) |
| 617 |
$(MAKE) $(NJOBS) -f debian/rules TARGET_ARCH=$(HOST_ARCH) \ |
| 618 |
$(addprefix $(stamp)repack-,$(wildcard gcc-$(GCC_VER)-cross-base$(GCC_PORTS_BUILD)_*_all.deb)) |
| 619 |
touch $@ |
| 620 |
|
| 621 |
build: $(stamp)build |
| 622 |
$(stamp)build: $(foreach arch,$(CROSS_ARCHS),$(addsuffix .$(arch),$(stamp)build-gcc)) |
| 623 |
@echo START $@ |
| 624 |
touch $@ |
| 625 |
|
| 626 |
build: dbp_flag = -b |
| 627 |
build-arch: dbp_flag = -B |
| 628 |
build-indep: dbp_flag = -b |
| 629 |
|
| 630 |
build-arch: $(stamp)build |
| 631 |
build-indep: $(stamp)build |
| 632 |
|
| 633 |
binary: binary-arch binary-indep |
| 634 |
binary-arch: build-arch $(stamp)build $(stamp)repack-debs-arch $(stamp)mangle-debian-files-arch |
| 635 |
binary-indep: build-indep $(stamp)build $(stamp)repack-debs-indep $(stamp)mangle-debian-files-indep |
| 636 |
|
| 637 |
define generate_debian_files |
| 638 |
touch debian/files |
| 639 |
for deb in $1; do \ |
| 640 |
[ -f "$$deb" ] || continue; \ |
| 641 |
pkg=`basename $$deb`; \ |
| 642 |
if [ "$(skip_dbg_packages)" = yes ]; then \ |
| 643 |
case $$pkg in *-dbg*) continue; esac; \ |
| 644 |
fi; \ |
| 645 |
if [ "$(skip_common_packages)" = yes ] && grep -q "^$$pkg$$" debian/packages.common; then \ |
| 646 |
continue; \ |
| 647 |
fi; \ |
| 648 |
echo -n "$$pkg " >>debian/files; \ |
| 649 |
dpkg-deb -I $$deb | grep Section | cut -d ' ' -f 3 | tr "\n" ' ' >>debian/files; \ |
| 650 |
dpkg-deb -I $$deb | grep Priority | cut -d ' ' -f 3 | tr -d "\n" >>debian/files; \ |
| 651 |
echo "" >>debian/files; \ |
| 652 |
done |
| 653 |
endef |
| 654 |
|
| 655 |
$(stamp)mangle-debian-files-arch: build $(stamp)repack-debs-arch $(stamp)debian-files-base |
| 656 |
@echo START $@ |
| 657 |
$(call generate_debian_files, *_$(HOST_ARCH).deb) |
| 658 |
sed -i -e "s/${DEB_VER_GCC}_/${DEB_VER_GCC}$(CROSS_EXT)_/g" debian/files |
| 659 |
touch $@ |
| 660 |
|
| 661 |
$(stamp)mangle-debian-files-indep: $(stamp)repack-debs-indep $(stamp)debian-files-base |
| 662 |
@echo START $@ |
| 663 |
$(call generate_debian_files, *_all.deb) |
| 664 |
sed -i -e "s/${DEB_VER_GCC}_/${DEB_VER_GCC}$(CROSS_EXT)_/g" debian/files |
| 665 |
touch $@ |
| 666 |
|
| 667 |
$(stamp)debian-files-base: |
| 668 |
@echo START $@ |
| 669 |
rm -f debian/files |
| 670 |
touch $@ |
| 671 |
|
| 672 |
|
| 673 |
control: |
| 674 |
sed -e "s/MIN_VER_GCC/${MIN_VER_GCC}/g" \ |
| 675 |
-e "s/GCC_BUILD_DEPS/$(GCC_BUILD_DEPS)/g" \ |
| 676 |
-e "s/BINUTILS_BUILD_DEPS/$(BINUTILS_BUILD_DEPS)/g" \ |
| 677 |
-e "s/GLIBC_BUILD_DEPS/$(GLIBC_BUILD_DEPS)/g" \ |
| 678 |
-e "s/EXTRA_BUILD_DEPS/${EXTRA_BUILD_DEPS}/g" \ |
| 679 |
-e "s/LINUX_BUILD_DEPS/$(LINUX_BUILD_DEPS)/g" \ |
| 680 |
-e "s/GCC_VER/${GCC_VER}/g" \ |
| 681 |
-e "s/MIN_VER_BINUTILS/${MIN_VER_BINUTILS}/g" \ |
| 682 |
-e "s/VER_BINUTILS/${VER_BINUTILS}/g" \ |
| 683 |
-e "s/VER_ISL/${VER_ISL}/g" \ |
| 684 |
-e "s/GCC_PORTS_BUILD/$(GCC_PORTS_BUILD)/g" \ |
| 685 |
$(CURDIR)/debian/control.source.in >$(CURDIR)/debian/control |
| 686 |
|
| 687 |
$(foreach a,$(CROSS_ARCHS), \ |
| 688 |
sed \ |
| 689 |
-e 's/PHOBOS_DEP/$(if $(filter $(a),$(PHOBOS_ARCHS)),${PHOBOS_DEP})/g' \ |
| 690 |
-e 's/PHOBOS_ML_DEP/$(if $(filter $(a),$(PHOBOS_ARCHS)),${PHOBOS_ML_DEP})/g' \ |
| 691 |
-e 's/CROSS_ARCH/$(a)/g' \ |
| 692 |
-e 's/CROSS_GNU_TYPE/$(call _pkg_gnu_type,$(a))/g' \ |
| 693 |
-e 's/MIN_VER_GCC/${MIN_VER_GCC}/g' \ |
| 694 |
-e 's/GCC_VER/${GCC_VER}/g' \ |
| 695 |
-e 's/MIN_VER_BINUTILS/${MIN_VER_BINUTILS}/g' \ |
| 696 |
-e 's/@host_archs@/$(filter-out $(a),$(HOST_ARCHS_$(a)))/g' \ |
| 697 |
-e 's/@ada_host_archs@/$(filter-out $(a),$(HOST_ARCHS_$(a)))/g' \ |
| 698 |
-e 's/@ada64_host_archs@/$(filter-out $(a),$(filter-out XXXi386,$(HOST_ARCHS_$(a))))/g' \ |
| 699 |
$(CURDIR)/debian/control.arch.in >>$(CURDIR)/debian/control; ) |
| 700 |
|
| 701 |
cp debian/packages.invalid debian/packages.invalid-all |
| 702 |
ifeq ($(vendor),Ubuntu) |
| 703 |
ifeq (,$(filter $(distrelease), trusty xenial bionic focal jammy mantic noble)) |
| 704 |
cat debian/packages.invalid-s390x >> debian/packages.invalid-all |
| 705 |
endif |
| 706 |
endif |
| 707 |
python3 debian/remove-unbuilt \ |
| 708 |
$(if $(filter yes,$(skip_dbg_packages)), --skip-dbg-packages) \ |
| 709 |
$(if $(filter yes,$(skip_common_packages)), --skip-common-packages) \ |
| 710 |
debian/control debian/packages.invalid-all debian/packages.common \ |
| 711 |
> debian/control.new && mv debian/control.new debian/control |
| 712 |
rm -f debian/packages.invalid-all |
| 713 |
|
| 714 |
sort-pkgfiles: |
| 715 |
for i in packages.common packages.invalid; do \ |
| 716 |
LC_ALL=C sort -u debian/$$i > debian/$$i.tmp; \ |
| 717 |
mv -f debian/$$i.tmp debian/$$i; \ |
| 718 |
done |
| 719 |
|
| 720 |
.PRECIOUS: $(stamp)init-dirs \ |
| 721 |
$(stamp)init-gcc \ |
| 722 |
$(stamp)build \ |
| 723 |
$(stamp)build-gcc.% \ |
| 724 |
$(stamp)debian-files-base \ |
| 725 |
$(stamp)repack-debs-arch \ |
| 726 |
$(stamp)repack-debs-indep \ |
| 727 |
$(stamp)repack-debs-indep.% \ |
| 728 |
$(stamp)mangle-debian-files-arch |
| 729 |
$(stamp)mangle-debian-files-indep \ |
| 730 |
build build-arch build-indep binary binary-arch binary-indep |