| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
Troup |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
include /usr/share/dpkg/pkg-info.mk |
| 17 |
|
| 18 |
vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1))) |
| 19 |
DPKG_VARS := $(shell dpkg-architecture) |
| 20 |
DEB_BUILD_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE) |
| 21 |
DEB_HOST_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH) |
| 22 |
DEB_HOST_GNU_CPU ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_CPU) |
| 23 |
DEB_HOST_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE) |
| 24 |
DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH) |
| 25 |
|
| 26 |
include debian/rules.defs |
| 27 |
|
| 28 |
ifeq (,$(filter no, $(DEB_RULES_REQUIRES_ROOT))) |
| 29 |
require_root = yes |
| 30 |
endif |
| 31 |
ifeq ($(require_root),yes) |
| 32 |
CHOWN = chown |
| 33 |
DPKG_DEB = dpkg-deb |
| 34 |
else |
| 35 |
CHOWN = : chown |
| 36 |
DPKG_DEB = dpkg-deb --root-owner-group |
| 37 |
endif |
| 38 |
|
| 39 |
p_bin = binutils-gold |
| 40 |
p_com = $(p_bin)-common |
| 41 |
p_lib = lib$(p_bin) |
| 42 |
p_nat = $(p_bin)-$(subst _,-,$(DEB_HOST_GNU_TYPE)) |
| 43 |
p_dev = $(p_bin)-dev |
| 44 |
p_mul = $(p_bin)-multiarch |
| 45 |
p_mdev = $(p_mul)-dev |
| 46 |
p_doc = $(p_bin)-doc |
| 47 |
p_hppa64 = $(p_bin)-hppa64-linux-gnu |
| 48 |
p_src = $(p_bin)-source |
| 49 |
|
| 50 |
p_ctf = libctf0 |
| 51 |
p_ctfn = libctf-nobfd0 |
| 52 |
p_gpng = libgprofng0 |
| 53 |
p_sfrm = libsframe1 |
| 54 |
|
| 55 |
p_hst = $(p_bin)-for-host |
| 56 |
p_bld = $(p_bin)-for-build |
| 57 |
|
| 58 |
p_cross = $(p_bin)-$(subst _,-,$(DEB_TARGET_GNU_TYPE)) |
| 59 |
|
| 60 |
|
| 61 |
min_ver = 2.30-2 |
| 62 |
|
| 63 |
distribution := $(shell lsb_release -is) |
| 64 |
distrelease := $(shell lsb_release -cs) |
| 65 |
ifeq ($(distrelease),n/a) |
| 66 |
distrelease := sid |
| 67 |
endif |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
ifeq ($(BACKPORT),true) |
| 72 |
p_src = $(p_bin)-$(VERSION)-source |
| 73 |
else |
| 74 |
p_src = $(p_bin)-source |
| 75 |
endif |
| 76 |
|
| 77 |
pwd := $(shell pwd) |
| 78 |
d = debian/tmp |
| 79 |
d_bin = $(d) |
| 80 |
d_com = debian/$(p_com) |
| 81 |
d_lib = debian/$(p_lib) |
| 82 |
d_nat = debian/$(p_nat) |
| 83 |
d_dev = debian/$(p_dev) |
| 84 |
d_mul = debian/$(p_mul) |
| 85 |
d_mdev = debian/$(p_mdev) |
| 86 |
d_doc = debian/$(p_doc) |
| 87 |
d_hppa64 = debian/$(p_hppa64) |
| 88 |
d_src = debian/$(p_src) |
| 89 |
|
| 90 |
d_ctf = debian/$(p_ctf) |
| 91 |
d_ctfn = debian/$(p_ctfn) |
| 92 |
d_gpng = debian/$(p_gpng) |
| 93 |
d_sfrm = debian/$(p_sfrm) |
| 94 |
|
| 95 |
d_hst = debian/$(p_hst) |
| 96 |
d_bld = debian/$(p_bld) |
| 97 |
|
| 98 |
d_cross = debian/$(p_cross) |
| 99 |
|
| 100 |
install_dir = install -d -m 755 |
| 101 |
install_file = install -m 644 |
| 102 |
install_script = install -m 755 |
| 103 |
install_binary = install -m 755 -s --strip-program="$(STRIP)" |
| 104 |
|
| 105 |
NATIVE_ARCHS ?= amd64 i386 arm64 armhf armel ppc64el s390x |
| 106 |
NATIVE_ARCHS += alpha arc hppa loong64 m68k powerpc ppc64 \ |
| 107 |
riscv64 sh4 sparc sparc64 x32 |
| 108 |
NATIVE_ARCHS += hurd-amd64 hurd-i386 |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
ifneq ($(distribution)-$(CROSS_ARCHS),Ubuntu-) |
| 114 |
NATIVE_ARCHS += mips mipsel mips64 mips64el |
| 115 |
NATIVE_ARCHS += mipsn32 mipsn32el |
| 116 |
NATIVE_ARCHS += mipsn32r6 mipsn32r6el mipsr6 mipsr6el mips64r6 mips64r6el |
| 117 |
endif |
| 118 |
|
| 119 |
with_cross = yes |
| 120 |
ifneq (,$(filter $(DEB_SOURCE),binutils binutils-gold)) |
| 121 |
with_native = yes |
| 122 |
same_source = yes |
| 123 |
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 x32)) |
| 124 |
|
| 125 |
CROSS_ARCHS ?= amd64 i386 x32 \ |
| 126 |
s390x ppc64el arm64 armhf armel \ |
| 127 |
alpha arc hppa loong64 m68k \ |
| 128 |
powerpc ppc64 sh4 sparc sparc64 \ |
| 129 |
riscv64 \ |
| 130 |
hurd-amd64 hurd-i386 |
| 131 |
else ifeq ($(DEB_HOST_ARCH),arm64) |
| 132 |
CROSS_ARCHS ?= amd64 armel armhf i386 powerpc ppc64el riscv64 s390x \ |
| 133 |
alpha arc hppa loong64 m68k sh4 sparc sparc64 x32 |
| 134 |
else ifeq ($(DEB_HOST_ARCH),ppc64) |
| 135 |
CROSS_ARCHS ?= ppc64el |
| 136 |
else ifeq ($(DEB_HOST_ARCH),ppc64el) |
| 137 |
CROSS_ARCHS ?= powerpc ppc64 amd64 armel armhf arm64 i386 riscv64 s390x \ |
| 138 |
alpha arc hppa loong64 m68k sh4 sparc sparc64 x32 |
| 139 |
else ifeq ($(DEB_HOST_ARCH),s390x) |
| 140 |
CROSS_ARCHS ?= amd64 armhf arm64 i386 riscv64 powerpc ppc64 ppc64el |
| 141 |
endif |
| 142 |
else ifeq ($(DEB_SOURCE),binutils-ports) |
| 143 |
CROSS_ARCHS ?= m68k sh4 |
| 144 |
else ifeq ($(DEB_SOURCE),binutils-mipsen) |
| 145 |
with_native = |
| 146 |
same_source = |
| 147 |
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 x32 arm64 ppc64el)) |
| 148 |
CROSS_ARCHS ?= mips mipsel mips64el mips64 mipsn32 mipsn32el \ |
| 149 |
mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el |
| 150 |
else ifneq (,$(filter $(DEB_HOST_ARCH), arm64 ppc64el)) |
| 151 |
CROSS_ARCHS ?= mipsel mips64el |
| 152 |
endif |
| 153 |
else |
| 154 |
$(error unexpected source package name: $(DEB_SOURCE)) |
| 155 |
endif |
| 156 |
|
| 157 |
CROSS_ARCHS := $(filter-out $(DEB_HOST_ARCH),$(CROSS_ARCHS)) |
| 158 |
|
| 159 |
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 i386 x32 hppa)) |
| 160 |
with_hppa64 = yes |
| 161 |
endif |
| 162 |
|
| 163 |
with_multiarch := yes |
| 164 |
|
| 165 |
|
| 166 |
ifeq (0,1) |
| 167 |
|
| 168 |
ifneq (,$(ADT_TEST_TRIGGERS)) |
| 169 |
|
| 170 |
|
| 171 |
with_hppa64 := |
| 172 |
with_multiarch := |
| 173 |
endif |
| 174 |
endif |
| 175 |
|
| 176 |
ifeq ($(DEB_SOURCE),binutils-gold) |
| 177 |
CROSS_ARCHS := $(filter $(gold_targets),$(CROSS_ARCHS)) |
| 178 |
with_hppa64 := |
| 179 |
with_multiarch := |
| 180 |
endif |
| 181 |
|
| 182 |
HOST_ARCHS_armhf = amd64 i386 x32 arm64 ppc64el s390x |
| 183 |
HOST_ARCHS_armel = amd64 i386 x32 arm64 ppc64el |
| 184 |
HOST_ARCHS_arm64 = amd64 i386 x32 ppc64el s390x |
| 185 |
HOST_ARCHS_powerpc = amd64 i386 x32 arm64 ppc64el s390x |
| 186 |
HOST_ARCHS_ppc64el = amd64 i386 x32 ppc64 arm64 s390x |
| 187 |
HOST_ARCHS_s390x = amd64 i386 x32 arm64 ppc64el |
| 188 |
HOST_ARCHS_amd64 = arm64 i386 ppc64el x32 s390x |
| 189 |
HOST_ARCHS_i386 = amd64 arm64 ppc64el x32 s390x |
| 190 |
HOST_ARCHS_riscv64 = amd64 i386 x32 arm64 ppc64el s390x |
| 191 |
|
| 192 |
HOST_ARCHS_alpha = amd64 i386 x32 arm64 ppc64el |
| 193 |
HOST_ARCHS_arc = amd64 i386 x32 arm64 ppc64el |
| 194 |
HOST_ARCHS_hppa = amd64 i386 x32 arm64 ppc64el |
| 195 |
HOST_ARCHS_loong64 = amd64 i386 x32 arm64 ppc64el |
| 196 |
HOST_ARCHS_m68k = amd64 i386 x32 arm64 ppc64el |
| 197 |
HOST_ARCHS_ppc64 = amd64 i386 x32 ppc64el s390x |
| 198 |
HOST_ARCHS_sh4 = amd64 i386 x32 arm64 ppc64el |
| 199 |
HOST_ARCHS_sparc = amd64 i386 x32 arm64 ppc64el |
| 200 |
HOST_ARCHS_sparc64 = amd64 i386 x32 arm64 ppc64el |
| 201 |
HOST_ARCHS_x32 = amd64 arm64 i386 ppc64el |
| 202 |
|
| 203 |
HOST_ARCHS_mips = amd64 i386 x32 |
| 204 |
HOST_ARCHS_mipsel = amd64 i386 x32 arm64 ppc64el |
| 205 |
HOST_ARCHS_mipsn32 = amd64 i386 x32 |
| 206 |
HOST_ARCHS_mipsn32el = amd64 i386 x32 |
| 207 |
HOST_ARCHS_mips64 = amd64 i386 x32 |
| 208 |
HOST_ARCHS_mips64el = amd64 i386 x32 arm64 ppc64el |
| 209 |
|
| 210 |
HOST_ARCHS_mipsr6 = amd64 i386 x32 |
| 211 |
HOST_ARCHS_mipsr6el = amd64 i386 x32 |
| 212 |
HOST_ARCHS_mipsn32r6 = amd64 i386 x32 |
| 213 |
HOST_ARCHS_mipsn32r6el = amd64 i386 x32 |
| 214 |
HOST_ARCHS_mips64r6 = amd64 i386 x32 |
| 215 |
HOST_ARCHS_mips64r6el = amd64 i386 x32 |
| 216 |
|
| 217 |
HOST_ARCHS_hurd-amd64 = amd64 i386 x32 |
| 218 |
HOST_ARCHS_hurd-i386 = amd64 i386 x32 |
| 219 |
|
| 220 |
|
| 221 |
CROSS_ARCH = $(subst .,,$(suffix $@)) |
| 222 |
CROSS_GNU_TYPE = $(call _gnu_type,$(CROSS_ARCH)) |
| 223 |
P_CROSS = binutils-gold-$(subst _,-,$(CROSS_GNU_TYPE)) |
| 224 |
D_CROSS = debian/$(P_CROSS) |
| 225 |
|
| 226 |
|
| 227 |
ifeq (,$(TARGET)) |
| 228 |
ifneq (,$(wildcard debian/target)) |
| 229 |
TARGET := $(shell cat debian/target 2>/dev/null) |
| 230 |
endif |
| 231 |
endif |
| 232 |
|
| 233 |
ifneq (,$(TARGET)) |
| 234 |
with_native = |
| 235 |
with_cross = disabled by TARGET |
| 236 |
same_source = |
| 237 |
|
| 238 |
|
| 239 |
DEB_TARGET_ARCH := $(or $(shell dpkg-architecture -f -t$(TARGET) -qDEB_HOST_ARCH 2>/dev/null),\ |
| 240 |
$(TARGET)) |
| 241 |
DEB_TARGET_GNU_TYPE = $(call _gnu_type,$(DEB_TARGET_ARCH)) |
| 242 |
DEB_TARGET_MULTIARCH = $(call _multiarch,$(DEB_TARGET_ARCH)) |
| 243 |
for_target = $(call run_dpkg_arch,$(DEB_TARGET_ARCH)) |
| 244 |
else |
| 245 |
for_target = |
| 246 |
endif |
| 247 |
|
| 248 |
ifneq (,$(TARGET)) |
| 249 |
APPEND_TOOLLIBDIR=yes |
| 250 |
export APPEND_TOOLLIBDIR |
| 251 |
endif |
| 252 |
|
| 253 |
ifeq (,$(DEB_HOST_MULTIARCH)) |
| 254 |
ifeq ($(DEB_HOST_ARCH),i386) |
| 255 |
DEB_HOST_MULTIARCH = i386-linux-gnu |
| 256 |
else |
| 257 |
DEB_HOST_MULTIARCH = $(DEB_HOST_GNU_TYPE) |
| 258 |
endif |
| 259 |
endif |
| 260 |
|
| 261 |
export SHELL = /bin/bash |
| 262 |
|
| 263 |
ifeq ($(with_gold),yes) |
| 264 |
gold_provides = -Vgold:Provides=binutils-gold |
| 265 |
endif |
| 266 |
|
| 267 |
CFLAGS = -g -O2 -ffile-prefix-map=$(CURDIR)=. |
| 268 |
CXXFLAGS = -g -O2 -ffile-prefix-map=$(CURDIR)=. |
| 269 |
LDFLAGS = |
| 270 |
CROSS := $(DEB_HOST_GNU_TYPE)- |
| 271 |
CC = $(CROSS)gcc |
| 272 |
CXX = $(CROSS)g++ |
| 273 |
ifneq (,$(shell dpkg-buildflags | grep '^CFLAGS=.*-fno-omit-frame-pointer')) |
| 274 |
CFLAGS += -fno-omit-frame-pointer |
| 275 |
CXXFLAGS += -fno-omit-frame-pointer |
| 276 |
endif |
| 277 |
ifneq (,$(shell dpkg-buildflags | grep '^CFLAGS=.*-mbackchain')) |
| 278 |
CFLAGS += -mbackchain |
| 279 |
CXXFLAGS += -mbackchain |
| 280 |
endif |
| 281 |
STRIP = $(CROSS)strip -R .comment -R .note |
| 282 |
STRIP_LTO = $(CROSS)strip -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_slim -N __gnu_lto_v1 |
| 283 |
|
| 284 |
ifeq (,$(findstring nopgo,$(DEB_BUILD_OPTIONS))) |
| 285 |
ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) |
| 286 |
ifeq (,$(filter $(DEB_HOST_ARCH), armel armhf mipsel)) |
| 287 |
CONF_PGO = --enable-pgo-build=lto |
| 288 |
endif |
| 289 |
endif |
| 290 |
endif |
| 291 |
|
| 292 |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 293 |
CFLAGS = -g -O0 |
| 294 |
CONF_PGO = |
| 295 |
endif |
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
check_cpp = $(shell $(CROSS)cpp -dM -P /dev/null | grep -q '^\#define $(1)' && echo 1 || echo 0) |
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
ifneq (,$(filter $(DEB_HOST_ARCH), armel armhf)) |
| 305 |
ifeq ($(call check_cpp,__thumb__),1) |
| 306 |
CFLAGS += -marm |
| 307 |
endif |
| 308 |
endif |
| 309 |
|
| 310 |
SPACE = $(EMPTY) $(EMPTY) |
| 311 |
COMMA = , |
| 312 |
|
| 313 |
DEB_SVERSION := $(shell echo $(DEB_VERSION) | sed 's/+b[0-9][0-9]*$$//') |
| 314 |
|
| 315 |
VERSION := $(shell sed -n 's/^ *VERSION=\(.*\)/\1/p' bfd/configure | head -1 | tr -d \') |
| 316 |
DATE := $(shell sed -n 's/.* \([0-9]*\)$$/\1/p' bfd/version.h) |
| 317 |
ifneq (,$(DATE)) |
| 318 |
|
| 319 |
endif |
| 320 |
BUILD_DATE := $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p') |
| 321 |
BUILD_DAY := $(shell date -Idate -u -d "$(BUILD_DATE)") |
| 322 |
|
| 323 |
|
| 324 |
ifeq (,$(ELF_PACKAGE_METADATA)) |
| 325 |
ELF_PACKAGE_METADATA := $(subst $(SPACE),,{ \ |
| 326 |
"type":"deb", \ |
| 327 |
"os":"$(shell awk -F= '/^ID=/ {print $$2}' /etc/os-release)", \ |
| 328 |
"name":"$(DEB_SOURCE)", \ |
| 329 |
"version":"$(DEB_VERSION)", \ |
| 330 |
"architecture":"$(DEB_HOST_ARCH)" \ |
| 331 |
$(if $(DEB_BUILD_DEBUG_INFO_URL),$(COMMA)"debugInfoUrl":"$(DEB_BUILD_DEBUG_INFO_URL)") \ |
| 332 |
}) |
| 333 |
export ELF_PACKAGE_METADATA |
| 334 |
endif |
| 335 |
|
| 336 |
is_rc = yes |
| 337 |
is_rc = |
| 338 |
|
| 339 |
ifneq ($(DEB_VERSION_UPSTREAM),$(VERSION)$(DATE_EXT)) |
| 340 |
$(error upstream ($(VERSION)$(DATE_EXT)) and debian ($(DEB_VERSION_UPSTREAM)) version mismatch) |
| 341 |
endif |
| 342 |
|
| 343 |
SINGLE_VERSION= -system |
| 344 |
MULTI_VERSION = -multiarch |
| 345 |
HPPA64_VERSION= -hppa64 |
| 346 |
|
| 347 |
ifeq (,$(filter $(distrelease),squeeze wheezy precise trusty)) |
| 348 |
DPKG_DEV = dpkg-dev (>= 1.17.11), |
| 349 |
endif |
| 350 |
ifeq (,$(filter $(distrelease),squeeze wheezy stretch precise trusty xenial zesty artful)) |
| 351 |
DPKG_DEV = dpkg-dev (>= 1.19.0.5), |
| 352 |
endif |
| 353 |
|
| 354 |
NJOBS = |
| 355 |
|
| 356 |
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) |
| 357 |
NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) |
| 358 |
endif |
| 359 |
ifneq (,$(findstring nogold,$(DEB_BUILD_OPTIONS))) |
| 360 |
with_gold = disabled in DEB_BUILD_OPTIONS |
| 361 |
endif |
| 362 |
ifneq (,$(findstring nomult,$(DEB_BUILD_OPTIONS))) |
| 363 |
with_multiarch = disabled in DEB_BUILD_OPTIONS |
| 364 |
endif |
| 365 |
ifneq (,$(findstring nocross,$(DEB_BUILD_OPTIONS))) |
| 366 |
with_cross = disabled in DEB_BUILD_OPTIONS |
| 367 |
endif |
| 368 |
ifneq (,$(findstring nohppa,$(DEB_BUILD_OPTIONS))) |
| 369 |
with_hppa64 = disabled in DEB_BUILD_OPTIONS |
| 370 |
endif |
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
ifeq ($(PF),) |
| 375 |
PF = usr |
| 376 |
endif |
| 377 |
|
| 378 |
|
| 379 |
GFDL_INVARIANT_FREE := yes |
| 380 |
ifeq ($(distribution),Ubuntu) |
| 381 |
GFDL_INVARIANT_FREE := no |
| 382 |
endif |
| 383 |
|
| 384 |
gfdl_toplevel_texinfo_files = \ |
| 385 |
bfd/doc/bfd.texi \ |
| 386 |
bfd/doc/bfdint.texi \ |
| 387 |
ld/ldint.texi |
| 388 |
|
| 389 |
gfdl_generated_files = \ |
| 390 |
bfd/doc/bfd.info |
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
CONFARGS = $(BINUTILS_BASECONF) \ |
| 396 |
--prefix=/$(PF) \ |
| 397 |
--sysconfdir=/etc \ |
| 398 |
--enable-shared \ |
| 399 |
--with-system-zlib \ |
| 400 |
--build=$(DEB_BUILD_GNU_TYPE) \ |
| 401 |
--host=$(DEB_HOST_GNU_TYPE) \ |
| 402 |
--with-pkgversion="GNU Binutils for $(distribution)" |
| 403 |
|
| 404 |
|
| 405 |
CONFARGS += --disable-werror |
| 406 |
|
| 407 |
with_check := yes |
| 408 |
ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) |
| 409 |
buildd |
| 410 |
ifneq (,$(filter $(DEB_HOST_ARCH), m68k sh4)) |
| 411 |
ifneq (,$(findstring nocheck,$(LOCAL_BUILD_OPTIONS))) |
| 412 |
with_check := disabled through LOCAL_BUILD_OPTIONS |
| 413 |
endif |
| 414 |
else |
| 415 |
with_check := disabled through DEB_BUILD_OPTIONS |
| 416 |
endif |
| 417 |
endif |
| 418 |
ifneq (,$(filter $(DEB_HOST_ARCH), none)) |
| 419 |
with_check := disabled for architecture $(DEB_HOST_ARCH) |
| 420 |
endif |
| 421 |
|
| 422 |
|
| 423 |
regression_archs = m68k |
| 424 |
ifneq (,$(filter $(DEB_HOST_ARCH), $(regression_archs))) |
| 425 |
ignore_regressions := regressions ignored on architecture $(DEB_HOST_ARCH) |
| 426 |
endif |
| 427 |
ignore_regressions := regressions ignored on architecture $(DEB_HOST_ARCH) |
| 428 |
|
| 429 |
with_strip := yes |
| 430 |
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 431 |
with_strip := disabled through DEB_BUILD_OPTIONS |
| 432 |
endif |
| 433 |
|
| 434 |
source_files = $(addprefix $(shell basename $(pwd))/, \ |
| 435 |
$(filter-out stamps .pc CVS debian builddir-% test-summary%, $(wildcard *))) |
| 436 |
|
| 437 |
|
| 438 |
|
| 439 |
update-patches: export QUILT_PATCHES := debian/patches |
| 440 |
update-patches: |
| 441 |
while quilt push; do \ |
| 442 |
quilt refresh --no-timestamps --no-index -pab --sort; \ |
| 443 |
done |
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
|
| 450 |
|
| 451 |
clean: |
| 452 |
$(checkdir) |
| 453 |
rm -rf stamps |
| 454 |
rm -rf builddir-* |
| 455 |
rm -rf stamps |
| 456 |
find . -name \*.gmo -o -name \*~ -o -name \*.info ! -name sysroff.info | xargs -r rm -f |
| 457 |
rm -f test-summary* |
| 458 |
rm -rf $(d_bin) $(d_com) $(d_lib) $(d_lib)-dbg $(d_nat) $(d_nat)-dbg \ |
| 459 |
$(d_hst) $(d_dev) $(d_mul) $(d_mul)-dbg $(d_mdev) $(d_doc) \ |
| 460 |
$(d_hppa64) $(d_hppa64)-dbg $(d_src) $(d_bld) \ |
| 461 |
$(d_ctf) $(d_ctf)-dbg $(d_ctfn) $(d_ctfn)-dbg $(d_gpng) $(d_gpng)-dbg \ |
| 462 |
$(d_sfrm) $(d_sfrm)-dbg |
| 463 |
rm -rf $(foreach ca,$(CROSS_ARCHS),debian/binutils-gold-$(subst _,-,$(call _gnu_type,$(ca))){,-dbg}) |
| 464 |
rm -rf debian/tmp debian/files* debian/substvars |
| 465 |
rm -f debian/*.orig debian/*.rej |
| 466 |
rm -f debian/files debian/substvars |
| 467 |
ifneq (,$(TARGET)) |
| 468 |
rm -rf $(d_cross) |
| 469 |
endif |
| 470 |
for i in debian/*.in; do \ |
| 471 |
case "$$i" in debian/control*.in) continue; esac; \ |
| 472 |
rm -f $${i%*.in}; \ |
| 473 |
done |
| 474 |
|
| 475 |
rm -f *-stamp |
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
stamps/control: debian/control.in debian/control.cross.in |
| 480 |
ifneq (,$(TARGET)) |
| 481 |
sed -n -e 's/@dpkg_dev@/$(DPKG_DEV)/' \ |
| 482 |
-e "s/@gold_targets@/$(gold_targets)/" \ |
| 483 |
-e '/^Package: binutils-for-build$$/q;p' \ |
| 484 |
< debian/control.in > debian/control |
| 485 |
sed -e "s/@target@/$(subst _,-,$(DEB_TARGET_GNU_TYPE))/g" \ |
| 486 |
-e "s/@host_archs@/any/" \ |
| 487 |
-e 's/@binutils_alt_triplet@//' \ |
| 488 |
< debian/control.cross.in >> debian/control |
| 489 |
else |
| 490 |
sed -e 's/@dpkg_dev@/$(DPKG_DEV)/' \ |
| 491 |
-e "s/@gold_targets@/$(gold_targets)/" \ |
| 492 |
debian/control.in > debian/control |
| 493 |
$(foreach ca,$(gold_targets), \ |
| 494 |
sed \ |
| 495 |
-e 's/@host_archs@/$(ca)$(if $(and $(filter yes,$(with_cross)),$(filter $(ca),$(DEB_HOST_ARCH) $(CROSS_ARCHS))), $(HOST_ARCHS_$(ca)))/g' \ |
| 496 |
-e 's/@target@/$(subst _,-,$(call _gnu_type,$(ca)))/g' \ |
| 497 |
-e 's/@binutils_alt_triplet@/$(if $(findstring i386,$(ca)),binutils-$(call _gnu_type,$(ca)))/g' \ |
| 498 |
-e '$(if $(filter yes,$(same_source)),/^Built-Using/d)' \ |
| 499 |
debian/control.cross.in >> debian/control; \ |
| 500 |
) |
| 501 |
endif |
| 502 |
@mkdir -p stamps |
| 503 |
touch $@ |
| 504 |
|
| 505 |
|
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
SINGLE_CONFARGS = $(CONFARGS) $(CONFARGS_TARGET_$(DEB_HOST_ARCH)) |
| 510 |
ifeq ($(with_gold),yes) |
| 511 |
SINGLE_CONFARGS += --enable-ld=default --enable-gold |
| 512 |
endif |
| 513 |
SINGLE_CONFARGS += $(CONF_PGO) $(CONF_GPROFNG) |
| 514 |
|
| 515 |
stamps/configure-single: |
| 516 |
$(checkdir) |
| 517 |
env |
| 518 |
@echo BEGIN $@ |
| 519 |
ifeq ($(with_check),yes) |
| 520 |
@if echo "spawn true" | /usr/bin/expect -f - >/dev/null; then \ |
| 521 |
: ; \ |
| 522 |
else \ |
| 523 |
echo "expect is failing on your system with the above error, which means the"; \ |
| 524 |
echo "testsuite will fail. Please resolve the above issues and retry the build."; \ |
| 525 |
echo "-----------------------------------------------------------------------------"; \ |
| 526 |
exit 1; \ |
| 527 |
fi |
| 528 |
endif |
| 529 |
|
| 530 |
: # force regeneration, not needed for releases |
| 531 |
rm -f ld/ldgram.c ld/ldgram.h ld/ldlex.c |
| 532 |
|
| 533 |
find -name '*.[1-8]' -size 0 | xargs -r rm -f |
| 534 |
|
| 535 |
rm -rf stamps/configure-single builddir-single |
| 536 |
mkdir builddir-single |
| 537 |
cd builddir-single && env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \ |
| 538 |
$(call SET_BINUTILS_MULTIARCH_ENV,$(DEB_HOST_ARCH)) \ |
| 539 |
../configure --with-sysroot=/ \ |
| 540 |
--libdir=/$(PF)/lib/$(DEB_HOST_MULTIARCH) \ |
| 541 |
$(SINGLE_CONFARGS) |
| 542 |
@mkdir -p stamps |
| 543 |
touch $@ |
| 544 |
|
| 545 |
stamps/build-single: stamps/configure-single |
| 546 |
$(checkdir) |
| 547 |
@echo BEGIN $@ |
| 548 |
env BFD_SOVER_EXT="$(SINGLE_VERSION)" CTF_SOVER_EXT="" \ |
| 549 |
$(call SET_BINUTILS_MULTIARCH_ENV,$(DEB_HOST_ARCH)) \ |
| 550 |
$(MAKE) $(NJOBS) -C builddir-single \ |
| 551 |
LDFLAGS="-Wl,-z,relro" |
| 552 |
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
| 553 |
ifeq ($(with_check),yes) |
| 554 |
-env MAKE="$(MAKE) VERSION=$(SINGLE_VERSION)" \ |
| 555 |
$(call SET_BINUTILS_MULTIARCH_ENV,$(DEB_HOST_ARCH)) \ |
| 556 |
$(MAKE) -C builddir-single -k check |
| 557 |
rm -f $(pwd)/test-summary |
| 558 |
for f in \ |
| 559 |
builddir-single/binutils/binutils.sum \ |
| 560 |
builddir-single/gas/testsuite/gas.sum \ |
| 561 |
builddir-single/ld/ld.sum \ |
| 562 |
builddir-single/libctf/libctf.sum \ |
| 563 |
builddir-single/gprofng/gprofng.sum \ |
| 564 |
builddir-single/libsframe/libsframe.sum \ |
| 565 |
; do \ |
| 566 |
[ -f $$f ] || continue; \ |
| 567 |
cat $$f >> $(pwd)/test-summary; \ |
| 568 |
done |
| 569 |
set -e; \ |
| 570 |
tsi=test-summary-installed; \ |
| 571 |
rm -f $$tsi; \ |
| 572 |
if [ -f /usr/share/doc/binutils/test-summary-$(DEB_HOST_ARCH).gz ]; then \ |
| 573 |
zcat /usr/share/doc/binutils/test-summary-$(DEB_HOST_ARCH).gz > $$tsi; \ |
| 574 |
elif [ -f /usr/share/doc/binutils/test-summary.gz ]; then \ |
| 575 |
zcat /usr/share/doc/binutils/test-summary.gz > $$tsi; \ |
| 576 |
elif [ -f /usr/share/doc/binutils/test-summary ]; then \ |
| 577 |
cat /usr/share/doc/binutils/test-summary > $$tsi; \ |
| 578 |
fi; \ |
| 579 |
if [ ! -f $$tsi ]; then \ |
| 580 |
echo "No test results available for the installed binutils version"; \ |
| 581 |
elif [ -x /usr/bin/python3 ]; then \ |
| 582 |
echo "Test results, compared with installed binutils:"; \ |
| 583 |
if python3 debian/test-suite-compare.py $$tsi test-summary; then \ |
| 584 |
: ; \ |
| 585 |
elif [ -n "$(ignore_regressions)" ]; then \ |
| 586 |
echo "$(ignore_regressions)"; \ |
| 587 |
else \ |
| 588 |
false; \ |
| 589 |
fi; \ |
| 590 |
else \ |
| 591 |
echo "python3 not installed, not comparing test results."; \ |
| 592 |
fi |
| 593 |
endif |
| 594 |
endif |
| 595 |
touch $@ |
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
|
| 600 |
|
| 601 |
|
| 602 |
|
| 603 |
|
| 604 |
PIC_CONFARGS = $(CONFARGS) $(CONFARGS_TARGET_$(DEB_HOST_ARCH)) |
| 605 |
PIC_CONFARGS += --enable-ld=default --disable-gold |
| 606 |
|
| 607 |
stamps/configure-pic: |
| 608 |
$(checkdir) |
| 609 |
find -name '*.[1-8]' -size 0 | xargs -r rm -f |
| 610 |
|
| 611 |
rm -rf stamps/configure-pic builddir-pic |
| 612 |
mkdir builddir-pic |
| 613 |
cd builddir-pic && env CC="$(CC)" CXX="$(CXX)" CFLAGS="-fPIC $(CFLAGS)" CXXFLAGS="-fPIC $(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \ |
| 614 |
$(call SET_BINUTILS_MULTIARCH_ENV,$(DEB_HOST_ARCH)) \ |
| 615 |
../configure --with-sysroot=/ \ |
| 616 |
--libdir=/$(PF)/lib/$(DEB_HOST_MULTIARCH) \ |
| 617 |
$(PIC_CONFARGS) |
| 618 |
@mkdir -p stamps |
| 619 |
touch $@ |
| 620 |
|
| 621 |
stamps/build-pic: stamps/configure-pic |
| 622 |
$(checkdir) |
| 623 |
@echo BEGIN $@ |
| 624 |
env BFD_SOVER_EXT="$(SINGLE_VERSION)" CTF_SOVER_EXT="" \ |
| 625 |
$(call SET_BINUTILS_MULTIARCH_ENV,$(DEB_HOST_ARCH)) \ |
| 626 |
$(MAKE) $(NJOBS) -C builddir-pic \ |
| 627 |
LDFLAGS="-Wl,-z,relro" |
| 628 |
touch $@ |
| 629 |
|
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
multiarch_targets = \ |
| 638 |
aarch64-linux-gnu \ |
| 639 |
aarch64_be-linux-gnu \ |
| 640 |
alpha-linux-gnu \ |
| 641 |
arm-linux-gnueabi \ |
| 642 |
hppa-linux-gnu \ |
| 643 |
i686-linux-gnu \ |
| 644 |
loongarch64-linux-gnu \ |
| 645 |
m32r-linux-gnu \ |
| 646 |
m68k-linux-gnu \ |
| 647 |
m68k-rtems \ |
| 648 |
mips-linux-gnu \ |
| 649 |
mipsel-linux-gnu \ |
| 650 |
mips64-linux-gnuabin32 \ |
| 651 |
mips64el-linux-gnuabin32 \ |
| 652 |
mips64-linux-gnu \ |
| 653 |
mips64el-linux-gnu \ |
| 654 |
mipsisa32r6-linux-gnu \ |
| 655 |
mipsisa32r6el-linux-gnu \ |
| 656 |
mipsisa64r6-linux-gnuabin32 \ |
| 657 |
mipsisa64r6el-linux-gnuabin32 \ |
| 658 |
mipsisa64r6-linux-gnuabi64 \ |
| 659 |
mipsisa64r6el-linux-gnuabi64 \ |
| 660 |
powerpc-linux-gnu \ |
| 661 |
powerpc64-linux-gnu \ |
| 662 |
powerpc64le-linux-gnu \ |
| 663 |
riscv64-linux-gnu \ |
| 664 |
s390-linux-gnu \ |
| 665 |
s390x-linux-gnu \ |
| 666 |
sh-linux-gnu \ |
| 667 |
sparc-linux-gnu \ |
| 668 |
sparc64-linux-gnu \ |
| 669 |
x86_64-linux-gnu \ |
| 670 |
x86_64-linux-gnux32 \ |
| 671 |
m32r-linux-gnu \ |
| 672 |
x86_64-pep |
| 673 |
|
| 674 |
|
| 675 |
ifeq ($(DEB_HOST_ARCH),sh4) |
| 676 |
multiarch_targets := $(filter-out hppa-linux-gnu, $(multiarch_targets)) |
| 677 |
endif |
| 678 |
|
| 679 |
stamps/configure-multi: |
| 680 |
$(checkdir) |
| 681 |
@echo BEGIN $@ |
| 682 |
rm -rf stamps/configure-multi \ |
| 683 |
builddir-multi |
| 684 |
mkdir builddir-multi |
| 685 |
cd builddir-multi \ |
| 686 |
&& env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \ |
| 687 |
$(call SET_BINUTILS_MULTIARCH_ENV,$(DEB_HOST_ARCH)) \ |
| 688 |
../configure $(CONFARGS) $(CONF_PGO) $(CONF_GPROFNG) \ |
| 689 |
$(filter-out --enable-targets=%, $(CONFARGS_TARGET_$(DEB_HOST_ARCH))) \ |
| 690 |
--with-sysroot=/ \ |
| 691 |
--libdir=/$(PF)/lib/$(DEB_HOST_MULTIARCH) \ |
| 692 |
--enable-targets=$(subst $(SPACE),$(COMMA),$(multiarch_targets)) |
| 693 |
@mkdir -p stamps |
| 694 |
touch $@ |
| 695 |
|
| 696 |
stamps/build-multi: stamps/configure-multi |
| 697 |
$(checkdir) |
| 698 |
@echo BEGIN $@ |
| 699 |
env BFD_SOVER_EXT="$(MULTI_VERSION)" CTF_SOVER_EXT="$(MULTI_VERSION)" \ |
| 700 |
$(call SET_BINUTILS_MULTIARCH_ENV,$(DEB_HOST_ARCH)) \ |
| 701 |
$(MAKE) $(NJOBS) -C builddir-multi \ |
| 702 |
LDFLAGS="-Wl,-z,relro" |
| 703 |
touch $@ |
| 704 |
|
| 705 |
|
| 706 |
|
| 707 |
|
| 708 |
|
| 709 |
|
| 710 |
|
| 711 |
CROSS_CONFARGS = $(CONFARGS) --enable-initfini-array |
| 712 |
|
| 713 |
ifeq ($(with_gold),yes) |
| 714 |
CROSS_CONFARGS += --enable-ld=default --enable-gold |
| 715 |
endif |
| 716 |
|
| 717 |
stamps/configure.%: |
| 718 |
$(checkdir) |
| 719 |
@echo BEGIN $@ |
| 720 |
rm -rf $@ builddir-$* |
| 721 |
mkdir builddir-$* |
| 722 |
cd builddir-$* \ |
| 723 |
&& env CC="$(CC)" CXX="$(CXX)" \ |
| 724 |
$(call SET_BINUTILS_MULTIARCH_ENV,$*) \ |
| 725 |
../configure \ |
| 726 |
$(CROSS_CONFARGS) \ |
| 727 |
$(CONFARGS_TARGET_$(*)) \ |
| 728 |
--with-sysroot=/ \ |
| 729 |
--libdir=/$(PF)/lib/$(call _multiarch,$*) \ |
| 730 |
$(if $(filter $*, $(gold_targets)),--enable-ld=default --enable-gold,--disable-gold) \ |
| 731 |
--target=$(CROSS_GNU_TYPE) |
| 732 |
@mkdir -p stamps |
| 733 |
touch $@ |
| 734 |
|
| 735 |
stamps/build.%: stamps/configure.% |
| 736 |
$(checkdir) |
| 737 |
@echo BEGIN $@ |
| 738 |
env BFD_SOVER_EXT="-$*" CTF_SOVER_EXT="-$*" \ |
| 739 |
$(call SET_BINUTILS_MULTIARCH_ENV,$*) \ |
| 740 |
$(MAKE) -C builddir-$* $(NJOBS) \ |
| 741 |
CFLAGS="$(CFLAGS)" \ |
| 742 |
CXXFLAGS="$(CXXFLAGS)" \ |
| 743 |
LDFLAGS="$(LDFLAGS) -Wl,-z,relro" |
| 744 |
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
| 745 |
ifeq ($(with_check),yes) |
| 746 |
-env MAKE="$(MAKE) VERSION=$(VERSION)-$*" \ |
| 747 |
$(call SET_BINUTILS_MULTIARCH_ENV,$*) \ |
| 748 |
$(MAKE) -C builddir-$* -k check |
| 749 |
rm -f $(pwd)/test-summary-$* |
| 750 |
for f in \ |
| 751 |
builddir-$*/binutils/binutils.sum \ |
| 752 |
builddir-$*/gas/testsuite/gas.sum \ |
| 753 |
builddir-$*/ld/ld.sum \ |
| 754 |
builddir-$*/libctf/libctf.sum \ |
| 755 |
builddir-$*/gprofng/gprofng.sum \ |
| 756 |
builddir-$*/libsframe/libsframe.sum \ |
| 757 |
; do \ |
| 758 |
[ -f $$f ] || continue; \ |
| 759 |
cat $$f >> $(pwd)/test-summary-$*; \ |
| 760 |
done |
| 761 |
set -e; \ |
| 762 |
tsi=test-summary-$*-installed; \ |
| 763 |
rm -f $$tsi; \ |
| 764 |
if [ -f /usr/share/doc/$(P_CROSS)/test-summary.gz ]; then \ |
| 765 |
zcat /usr/share/doc/$(P_CROSS)/test-summary.gz > $$tsi; \ |
| 766 |
elif [ -f /usr/share/doc/binutils/test-summary-$*.gz ]; then \ |
| 767 |
zcat /usr/share/doc/binutils/test-summary-$*.gz > $$tsi; \ |
| 768 |
fi; \ |
| 769 |
if [ ! -f $$tsi ]; then \ |
| 770 |
echo "No test results available for the installed $(P_CROSS) version"; \ |
| 771 |
elif [ -x /usr/bin/python3 ]; then \ |
| 772 |
echo "Test results, compared with installed binutils:"; \ |
| 773 |
if python3 debian/test-suite-compare.py $$tsi test-summary-$*; then \ |
| 774 |
: ; \ |
| 775 |
elif echo $(regression_archs) | grep --word-regexp --silent "$*"; then \ |
| 776 |
echo "regressions ignore for target $*"; \ |
| 777 |
else \ |
| 778 |
false; \ |
| 779 |
fi; \ |
| 780 |
else \ |
| 781 |
echo "python3 not installed, not comparing test results."; \ |
| 782 |
fi |
| 783 |
endif |
| 784 |
endif |
| 785 |
touch $@ |
| 786 |
|
| 787 |
stamps/install.%: stamps/build.% |
| 788 |
$(checkdir) |
| 789 |
@echo BEGIN $@ |
| 790 |
rm -rf $(D_CROSS) |
| 791 |
env MAKE="$(MAKE) VERSION=$(VERSION)-$*" \ |
| 792 |
$(MAKE) -C builddir-$* DESTDIR=$(CURDIR)/$(D_CROSS) install |
| 793 |
|
| 794 |
rm -rf \ |
| 795 |
$(D_CROSS)/$(PF)/share/info \ |
| 796 |
$(D_CROSS)/$(PF)/share/locale |
| 797 |
|
| 798 |
rm -rf \ |
| 799 |
$(D_CROSS)/$(PF)/etc $(D_CROSS)/etc |
| 800 |
|
| 801 |
mkdir -p $(D_CROSS)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 802 |
set -e; \ |
| 803 |
d_src=$(D_CROSS)/$(PF)/$(DEB_HOST_GNU_TYPE)/$(CROSS_GNU_TYPE)/lib; \ |
| 804 |
d_dst=$(D_CROSS)/$(PF)/lib/$(DEB_HOST_MULTIARCH); \ |
| 805 |
for lib in libbfd libopcodes; do \ |
| 806 |
so=$$(basename $$(echo $$d_src/$$lib*$**.so)); \ |
| 807 |
mv $$d_src/$$so $$d_dst/.; \ |
| 808 |
ln -sf ../../../lib/$(DEB_HOST_MULTIARCH)/$$so $$d_src/$$lib.so; \ |
| 809 |
mv $$d_src/$$lib.a $$d_dst/$${lib}-$(VERSION)-$*.a; \ |
| 810 |
ln -sf ../../../lib/$(DEB_HOST_MULTIARCH)/$$lib-$(VERSION)-$*.a $$d_src/$$lib.a; \ |
| 811 |
done |
| 812 |
mv $(D_CROSS)/$(PF)/lib/$(call _multiarch,$*)/libctf*.so* \ |
| 813 |
$(D_CROSS)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/. |
| 814 |
|
| 815 |
: # replace hard links with soft links |
| 816 |
for i in $(D_CROSS)/usr/$(CROSS_GNU_TYPE)/bin/*; do \ |
| 817 |
ln -sf ../../bin/$(CROSS_GNU_TYPE)-$$(basename $$i) $$i; \ |
| 818 |
done |
| 819 |
ln -sf $(CROSS_GNU_TYPE)-ld.bfd $(D_CROSS)/usr/bin/$(CROSS_GNU_TYPE)-ld |
| 820 |
|
| 821 |
|
| 822 |
|
| 823 |
|
| 824 |
|
| 825 |
|
| 826 |
|
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
|
| 831 |
|
| 832 |
|
| 833 |
|
| 834 |
|
| 835 |
|
| 836 |
|
| 837 |
: # gold symlinks |
| 838 |
$(if $(filter $*, $(gold_targets)), \ |
| 839 |
ln -sf $(CROSS_GNU_TYPE)-ld.gold $(D_CROSS)/usr/bin/$(CROSS_GNU_TYPE)-gold; \ |
| 840 |
ln -sf ../../bin/$(CROSS_GNU_TYPE)-gold $(D_CROSS)/usr/$(CROSS_GNU_TYPE)/bin/gold; \ |
| 841 |
ln -sf ../../bin/$(CROSS_GNU_TYPE)-dwp $(D_CROSS)/usr/$(CROSS_GNU_TYPE)/bin/dwp \ |
| 842 |
) |
| 843 |
|
| 844 |
: # no spu toolchain |
| 845 |
rm -f $(D_CROSS)/$(PF)/bin/*embedspu |
| 846 |
|
| 847 |
: # no gprofng in cross packages |
| 848 |
rm -f $(D_CROSS)/$(PF)/bin/*-gprofng |
| 849 |
rm -f $(D_CROSS)/$(PF)/bin/*-gp-* |
| 850 |
rm -f $(D_CROSS)/$(PF)/bin/*-gprofng-* |
| 851 |
rm -rf $(D_CROSS)/$(PF)/lib/*/gprofng |
| 852 |
rm -f $(D_CROSS)/$(PF)/lib/$(call _multiarch,$*)/libgprofng* |
| 853 |
rm -rf $(D_CROSS)/$(PF)/share/doc/gprofng |
| 854 |
|
| 855 |
rm -f $(D_CROSS)/$(PF)/lib/$(call _multiarch,$*)/libsframe* |
| 856 |
: # symlinks installed without prefix ... |
| 857 |
rm -f $(D_CROSS)/$(PF)/bin/gp-* |
| 858 |
|
| 859 |
: # Remove windows related manpages |
| 860 |
rm -f $(D_CROSS)/$(PF)/share/man/man1/$(CROSS_GNU_TYPE)-{dlltool,nlmconv,windmc,windres}.1 |
| 861 |
|
| 862 |
: # symlink man pages |
| 863 |
mv $(D_CROSS)/$(PF)/share/man/man1/$(CROSS_GNU_TYPE)-ld.1 \ |
| 864 |
$(D_CROSS)/$(PF)/share/man/man1/$(CROSS_GNU_TYPE)-ld.bfd.1 |
| 865 |
gzip -9n $(D_CROSS)/$(PF)/share/man/man1/* |
| 866 |
for i in $(D_CROSS)/$(PF)/share/man/man1/*; do \ |
| 867 |
b=$$(basename $$i | sed 's/$(CROSS_GNU_TYPE)-//'); \ |
| 868 |
ln -sf $$b $$i; \ |
| 869 |
done |
| 870 |
ln -sf $(CROSS_GNU_TYPE)-ld.bfd.1.gz \ |
| 871 |
$(D_CROSS)/$(PF)/share/man/man1/$(CROSS_GNU_TYPE)-ld.1.gz |
| 872 |
|
| 873 |
: # gold man pages |
| 874 |
$(if $(filter $*, $(gold_targets)), \ |
| 875 |
ln -sf ld.gold.1.gz $(D_CROSS)/$(PF)/share/man/man1/$(CROSS_GNU_TYPE)-gold.1.gz; \ |
| 876 |
ln -sf ld.gold.1.gz $(D_CROSS)/$(PF)/share/man/man1/$(CROSS_GNU_TYPE)-ld.gold.1.gz; \ |
| 877 |
ln -sf dwp.1.gz $(D_CROSS)/$(PF)/share/man/man1/$(CROSS_GNU_TYPE)-dwp.1.gz; \ |
| 878 |
) |
| 879 |
|
| 880 |
: # Don't want /usr/<arch>-linux to exist in any package, don't ship development files |
| 881 |
rm -rf $(D_CROSS)/$(PF)/$(DEB_HOST_GNU_TYPE) |
| 882 |
|
| 883 |
rm -f $(D_CROSS)/$(PF)/lib/*.a $(D_CROSS)/$(PF)/lib/*/*.a |
| 884 |
rm -f $(D_CROSS)/$(PF)/lib/*.la $(D_CROSS)/$(PF)/lib/*/*.la |
| 885 |
rm -f $(D_CROSS)/$(PF)/$(DEB_HOST_GNU_TYPE)/$(CROSS_GNU_TYPE)/lib/*.a |
| 886 |
rm -f $(D_CROSS)/$(PF)/$(DEB_HOST_GNU_TYPE)/$(CROSS_GNU_TYPE)/lib/libctf* |
| 887 |
rm -f $(D_CROSS)/$(PF)/lib/$(CROSS_GNU_TYPE)/libctf* |
| 888 |
rm -f $(D_CROSS)/$(PF)/lib/$(CROSS_GNU_TYPE)/libsframe* |
| 889 |
rm -f $(D_CROSS)/$(PF)/include/*.h |
| 890 |
|
| 891 |
: # remove RPATH |
| 892 |
chrpath -k -d $$(file $(D_CROSS)/usr/bin/*|awk -F: '/ ELF/ {print $$1}') |
| 893 |
chrpath -k -d $$(file $(D_CROSS)/usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so*|awk -F: '/ ELF/ {print $$1}') |
| 894 |
|
| 895 |
: # remove non-gold stuff |
| 896 |
rm -rf $(D_CROSS)/$(PF)/$(DEB_HOST_GNU_TYPE) |
| 897 |
rm -rf $(D_CROSS)/$(PF)/lib/$(CROSS_GNU_TYPE) |
| 898 |
rm -rf $(D_CROSS)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 899 |
rm -rf $(D_CROSS)/$(PF)/lib/*/ldscripts |
| 900 |
rm -rf $(D_CROSS)/$(PF)/lib/*/bfd-plugins |
| 901 |
|
| 902 |
for i in $(D_CROSS)/$(PF)/bin/*; do \ |
| 903 |
case $$(basename $$i) in *-ld.gold|*-gold|*-dwp) continue;; esac; \ |
| 904 |
rm -f $$i; \ |
| 905 |
done |
| 906 |
for i in $(D_CROSS)/usr/$(CROSS_GNU_TYPE)/bin/*; do \ |
| 907 |
case $$(basename $$i) in ld.gold|gold|dwp) continue;; esac; \ |
| 908 |
rm -f $$i; \ |
| 909 |
done |
| 910 |
for i in $(D_CROSS)/$(PF)/share/man/man1/*; do \ |
| 911 |
case $$(basename $$i) in *-ld.gold.1*|*-gold.1*|*-dwp.1*) continue;; esac; \ |
| 912 |
rm -f $$i; \ |
| 913 |
done |
| 914 |
|
| 915 |
$(call strip_package, $(P_CROSS),$(D_CROSS),.) |
| 916 |
|
| 917 |
touch $@ |
| 918 |
|
| 919 |
|
| 920 |
|
| 921 |
|
| 922 |
|
| 923 |
|
| 924 |
|
| 925 |
stamps/configure-hppa64: |
| 926 |
$(checkdir) |
| 927 |
@echo BEGIN $@ |
| 928 |
rm -rf stamps/configure-hppa64 \ |
| 929 |
builddir-hppa64 |
| 930 |
mkdir builddir-hppa64 |
| 931 |
cd builddir-hppa64 \ |
| 932 |
&& env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ../configure \ |
| 933 |
$(filter-out --enable-targets=%, $(CONFARGS)) \ |
| 934 |
--libdir=/$(PF)/lib/hppa64-linux-gnu \ |
| 935 |
--target=hppa64-linux-gnu |
| 936 |
@mkdir -p stamps |
| 937 |
touch $@ |
| 938 |
|
| 939 |
stamps/build-hppa64: stamps/configure-hppa64 |
| 940 |
$(checkdir) |
| 941 |
@echo BEGIN $@ |
| 942 |
env BFD_SOVER_EXT="$(HPPA64_VERSION)" CTF_SOVER_EXT="$(HPPA64_VERSION)" \ |
| 943 |
$(MAKE) $(NJOBS) -C builddir-hppa64 \ |
| 944 |
LDFLAGS="-Wl,-z,relro" |
| 945 |
touch $@ |
| 946 |
|
| 947 |
|
| 948 |
|
| 949 |
pre-build: |
| 950 |
|
| 951 |
|
| 952 |
|
| 953 |
Explicitely |
| 954 |
|
| 955 |
|
| 956 |
|
| 957 |
build_stamps = stamps/build-single |
| 958 |
|
| 959 |
ifeq ($(with_multiarch),yes) |
| 960 |
build_stamps += stamps/build-multi |
| 961 |
endif |
| 962 |
ifeq ($(with_hppa64),yes) |
| 963 |
build_stamps += stamps/build-hppa64 |
| 964 |
endif |
| 965 |
ifeq ($(with_cross),yes) |
| 966 |
build_stamps += $(addprefix stamps/build.,$(CROSS_ARCHS)) |
| 967 |
endif |
| 968 |
ifneq (,$(TARGET)) |
| 969 |
ifeq ($(DEB_TARGET_GNU_TYPE),hppa64-linux-gnu) |
| 970 |
build_stamps = stamps/build-hppa64 |
| 971 |
else |
| 972 |
build_stamps = stamps/build.$(DEB_TARGET_ARCH) |
| 973 |
endif |
| 974 |
endif |
| 975 |
ifeq ($(BACKPORT),true) |
| 976 |
build_stamps := |
| 977 |
with_check := no |
| 978 |
endif |
| 979 |
|
| 980 |
build: pre-build stamps/build |
| 981 |
build-arch: pre-build stamps/build |
| 982 |
build-indep: pre-build stamps/build |
| 983 |
stamps/build: $(build_stamps) |
| 984 |
touch $@ |
| 985 |
|
| 986 |
|
| 987 |
|
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
|
| 992 |
install_stamps = |
| 993 |
ifeq ($(with_hppa64),yes) |
| 994 |
install_stamps += stamps/install-hppa64 |
| 995 |
endif |
| 996 |
ifeq ($(with_cross),yes) |
| 997 |
install_stamps += $(addprefix stamps/install.,$(CROSS_ARCHS)) |
| 998 |
endif |
| 999 |
|
| 1000 |
ifneq (,$(TARGET)) |
| 1001 |
ifeq ($(DEB_TARGET_GNU_TYPE),hppa64-linux-gnu) |
| 1002 |
install_stamp = stamps/install-hppa64 |
| 1003 |
else |
| 1004 |
install_stamp = stamps/install.$(DEB_TARGET_ARCH) |
| 1005 |
endif |
| 1006 |
else |
| 1007 |
install_stamp = stamps/install |
| 1008 |
endif |
| 1009 |
ifeq ($(BACKPORT),true) |
| 1010 |
install_stamps := |
| 1011 |
endif |
| 1012 |
install: $(install_stamp) |
| 1013 |
stamps/install: checkroot stamps/build $(install_stamps) |
| 1014 |
$(checkdir) |
| 1015 |
|
| 1016 |
rm -fr $(d_bin) $(d_com) $(d_lib) $(d_nat) $(d_dev) $(d_mul) $(d_mdev) $(d_doc) $(d_src) $(d_bld) $(d_ctf) $(d_ctfn) $(d_gpng) |
| 1017 |
$(install_dir) $(d_bin) $(d_com) $(d_lib) $(d_nat) $(d_dev) $(d_mul) $(d_mdev) $(d_doc) $(d_src) $(d_bld) |
| 1018 |
|
| 1019 |
: # install binutils and -dev stuff |
| 1020 |
env MAKE="$(MAKE) VERSION=$(SINGLE_VERSION)" \ |
| 1021 |
$(MAKE) -C builddir-single \ |
| 1022 |
CFLAGS="$(CFLAGS)" \ |
| 1023 |
CXXFLAGS="$(CXXFLAGS)" \ |
| 1024 |
LDFLAGS="$(LDFLAGS)" \ |
| 1025 |
DESTDIR=$(CURDIR)/$(d_bin) install |
| 1026 |
|
| 1027 |
$(install_dir) $(d_com)/$(PF)/share |
| 1028 |
mv $(d_bin)/$(PF)/share/locale $(d_com)/$(PF)/share/locale |
| 1029 |
|
| 1030 |
$(install_dir) $(d_doc)/$(PF)/share |
| 1031 |
mv $(d_bin)/$(PF)/share/info $(d_doc)/$(PF)/share/info |
| 1032 |
|
| 1033 |
$(install_dir) $(d_nat)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1034 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/bfd-plugins \ |
| 1035 |
$(d_nat)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/. |
| 1036 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/ldscripts \ |
| 1037 |
$(d_nat)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/. |
| 1038 |
|
| 1039 |
$(install_dir) $(d_com)/$(PF)/share/man |
| 1040 |
mv $(d_bin)/$(PF)/share/man/man1 $(d_com)/$(PF)/share/man/. |
| 1041 |
for f in $(d_com)/$(PF)/share/man/man1/*.1; do \ |
| 1042 |
sed -i -e '/^\.TH /s/[0-9]*-[0-9]*-[0-9]*/$(BUILD_DAY)/' $$f; \ |
| 1043 |
done |
| 1044 |
|
| 1045 |
ifeq ($(with_gprofng),yes) |
| 1046 |
$(install_dir) $(d_doc)/$(PF)/share/doc/binutils |
| 1047 |
mv $(d_bin)/$(PF)/share/doc/gprofng $(d_doc)/$(PF)/share/doc/binutils/. |
| 1048 |
$(install_dir) $(d_doc)/$(PF)/share/doc/binutils-doc |
| 1049 |
ln -sf ../binutils/gprofng $(d_doc)/$(PF)/share/doc/binutils-doc/gprofng |
| 1050 |
|
| 1051 |
chrpath -k -d $$(file $(d_bin)/usr/bin/{gprofng,gprofng-*}|awk -F: '/ ELF/ {print $$1}') |
| 1052 |
endif |
| 1053 |
|
| 1054 |
ifeq ($(with_multiarch),yes) |
| 1055 |
: # now install binutils-multiarch stuff |
| 1056 |
env MAKE="$(MAKE) VERSION=$(MULTI_VERSION)" \ |
| 1057 |
$(MAKE) -C builddir-multi \ |
| 1058 |
CFLAGS="$(CFLAGS)" \ |
| 1059 |
CXXFLAGS="$(CXXFLAGS)" \ |
| 1060 |
LDFLAGS="$(LDFLAGS)" \ |
| 1061 |
DESTDIR=$(CURDIR)/$(d_mul) install |
| 1062 |
endif |
| 1063 |
|
| 1064 |
: # fix bfd.h, removing the safety inclusion guard |
| 1065 |
awk '/PR 14072/,/^#endif/ {next} {print}' $(d_bin)/$(PF)/include/bfd.h \ |
| 1066 |
> $(d_bin)/$(PF)/include/bfd.h.new |
| 1067 |
mv $(d_bin)/$(PF)/include/bfd.h.new $(d_bin)/$(PF)/include/bfd.h |
| 1068 |
|
| 1069 |
: # fix multilib conflicts of generated values by __WORDSIZE-based expressions |
| 1070 |
sed -i -e '/^#include "ansidecl.h"/{p;s~^.*$$~#include <bits/wordsize.h>~;}' \ |
| 1071 |
-e 's/^#define BFD_DEFAULT_TARGET_SIZE \(32\|64\) *$$/#define BFD_DEFAULT_TARGET_SIZE __WORDSIZE/' \ |
| 1072 |
-e 's/^#define BFD_HOST_64BIT_LONG [01] *$$/#define BFD_HOST_64BIT_LONG (__WORDSIZE == 64)/' \ |
| 1073 |
-e 's/^#define BFD_HOST_64_BIT \(long \)\?long *$$/#if __WORDSIZE == 32\ |
| 1074 |
|
| 1075 |
|
| 1076 |
|
| 1077 |
|
| 1078 |
-e 's/^#define BFD_HOST_U_64_BIT unsigned \(long \)\?long *$$/#define BFD_HOST_U_64_BIT unsigned BFD_HOST_64_BIT/' \ |
| 1079 |
$(d_bin)/$(PF)/include/bfd.h |
| 1080 |
|
| 1081 |
: # copy plugin-api.h ... |
| 1082 |
cp -f include/plugin-api.h $(d_bin)/$(PF)/include |
| 1083 |
|
| 1084 |
: # We don't need to distribute everything in binutils and -dev |
| 1085 |
rm -f $(d_bin)/$(PF)/include/obstack.h |
| 1086 |
rm -f $(d_doc)/$(PF)/share/info/configure.* $(d_doc)/$(PF)/share/info/standards.* |
| 1087 |
|
| 1088 |
ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64 ppc64el)) |
| 1089 |
rm -f $(d_bin)/$(PF)/bin/embedspu |
| 1090 |
endif |
| 1091 |
|
| 1092 |
ifeq ($(with_multiarch),yes) |
| 1093 |
: # Now get rid of just about everything in binutils-multiarch |
| 1094 |
rm -rf $(d_mul)/$(PF)/man $(d_mul)/$(PF)/info $(d_mul)/$(PF)/include |
| 1095 |
rm -rf $(d_mul)/$(PF)/share/man $(d_mul)/$(PF)/share/info $(d_mul)/$(PF)/share/locale |
| 1096 |
rm -rf $(d_mul)/$(PF)/etc $(d_mul)/etc |
| 1097 |
|
| 1098 |
: # elfedit (even with its --input-mach option) |
| 1099 |
: # is the same for all targets. |
| 1100 |
rm -f $(d_mul)/$(PF)/bin/elfedit |
| 1101 |
|
| 1102 |
: # c++filt does not link to libbfd for anything more than |
| 1103 |
: # the help message, and its behavior does not vary |
| 1104 |
: # between arches aside from the --version message. |
| 1105 |
rm -f $(d_mul)/$(PF)/bin/c++filt |
| 1106 |
|
| 1107 |
: # As gas/README points out (search for --enable-targets), |
| 1108 |
: # multi-arch gas is not ready yet. |
| 1109 |
rm -f $(d_mul)/$(PF)/bin/as |
| 1110 |
rm -f $(d_mul)/$(PF)/bin/ld |
| 1111 |
rm -f $(d_mul)/$(PF)/bin/ld.bfd |
| 1112 |
rm -f $(d_mul)/$(PF)/bin/ld.gold |
| 1113 |
|
| 1114 |
rm -f $(d_mul)/$(PF)/bin/gprofng |
| 1115 |
rm -f $(d_mul)/$(PF)/bin/gp-* |
| 1116 |
rm -f $(d_mul)/$(PF)/bin/gprofng-* |
| 1117 |
rm -rf $(d_mul)/$(PF)/lib/*/gprofng |
| 1118 |
rm -rf $(d_mul)/$(PF)/share/doc/gprofng |
| 1119 |
|
| 1120 |
ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64 ppc64el)) |
| 1121 |
rm -f $(d_mul)/$(PF)/bin/embedspu |
| 1122 |
endif |
| 1123 |
rm -rf $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/ldscripts |
| 1124 |
rm -rf $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/bfd-plugins |
| 1125 |
endif |
| 1126 |
|
| 1127 |
|
| 1128 |
|
| 1129 |
|
| 1130 |
$(install_dir) $(d_dev)/$(PF)/include |
| 1131 |
mv $(d_bin)/$(PF)/include/* $(d_dev)/$(PF)/include/ |
| 1132 |
|
| 1133 |
$(install_dir) $(d_ctf)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1134 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libctf.so.* \ |
| 1135 |
$(d_ctf)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/. |
| 1136 |
$(install_dir) $(d_ctfn)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1137 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libctf-nobfd.so.* \ |
| 1138 |
$(d_ctfn)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/. |
| 1139 |
ifeq ($(with_gprofng),yes) |
| 1140 |
$(install_dir) $(d_gpng)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/gprofng |
| 1141 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libgprofng.so.* \ |
| 1142 |
$(d_gpng)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/. |
| 1143 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/gprofng/libgp-*.so \ |
| 1144 |
$(d_gpng)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/gprofng/. |
| 1145 |
endif |
| 1146 |
|
| 1147 |
$(install_dir) $(d_lib)/$(PF)/lib/$(DEB_HOST_MULTIARCH) $(d_dev)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1148 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.a \ |
| 1149 |
$(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libbfd.so \ |
| 1150 |
$(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libopcodes.so \ |
| 1151 |
$(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libctf*.so \ |
| 1152 |
$(d_dev)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1153 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libsframe.so \ |
| 1154 |
$(d_dev)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1155 |
ifeq (0,1) |
| 1156 |
cp builddir-pic/opcodes/.libs/libopcodes.a \ |
| 1157 |
$(d_dev)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libopcodes_pic.a |
| 1158 |
cp builddir-pic/bfd/.libs/libbfd.a \ |
| 1159 |
$(d_dev)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libbfd_pic.a |
| 1160 |
endif |
| 1161 |
ifeq ($(with_gprofng),yes) |
| 1162 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libgprofng.so \ |
| 1163 |
$(d_dev)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1164 |
$(install_dir) $(d_dev)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/gprofng |
| 1165 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/gprofng/*.a \ |
| 1166 |
$(d_dev)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/gprofng |
| 1167 |
endif |
| 1168 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so \ |
| 1169 |
$(d_lib)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1170 |
$(install_dir) $(d_sfrm)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1171 |
mv $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libsframe.so.* \ |
| 1172 |
$(d_sfrm)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1173 |
|
| 1174 |
ifeq ($(with_multiarch),yes) |
| 1175 |
$(install_dir) $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH) $(d_mdev)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1176 |
mv $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libbfd.so \ |
| 1177 |
$(d_mdev)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libbfd-multiarch.so |
| 1178 |
mv $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libopcodes.so \ |
| 1179 |
$(d_mdev)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libopcodes-multiarch.so |
| 1180 |
mv $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libctf-*.so \ |
| 1181 |
$(d_mdev)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/. |
| 1182 |
rm -f $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libsframe.so* |
| 1183 |
rm -f $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libgprofng.so* |
| 1184 |
rm -f $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.la \ |
| 1185 |
$(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.a |
| 1186 |
rm -f $(d_mul)/$(PF)/lib*/$(DEB_HOST_MULTIARCH)/libiberty* |
| 1187 |
endif |
| 1188 |
|
| 1189 |
: # Get rid of .la files since libtool obviously has no idea about transient paths |
| 1190 |
rm -f $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.la |
| 1191 |
rm -f $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/gprofng/*.la |
| 1192 |
|
| 1193 |
chmod ugo-x $(d_lib)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so |
| 1194 |
chmod ugo-x $(d_ctf)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so.* |
| 1195 |
chmod ugo-x $(d_ctfn)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so.* |
| 1196 |
chmod ugo-x $(d_nat)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/bfd-plugins/*.so |
| 1197 |
ifeq ($(with_gprofng),yes) |
| 1198 |
chmod ugo-x $(d_gpng)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so.* |
| 1199 |
chmod ugo-x $(d_gpng)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/gprofng/*.so |
| 1200 |
endif |
| 1201 |
chmod ugo-x $(d_sfrm)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so.* |
| 1202 |
ifeq ($(with_native),yes) |
| 1203 |
$(call strip_package, $(p_lib), $(d_lib)) |
| 1204 |
$(call strip_package, $(p_ctf), $(d_ctf)) |
| 1205 |
$(call strip_package, $(p_ctfn), $(d_ctfn)) |
| 1206 |
ifeq ($(with_gprofng),yes) |
| 1207 |
$(call strip_package, $(p_gpng), $(d_gpng)) |
| 1208 |
endif |
| 1209 |
$(call strip_package, $(p_sfrm), $(d_sfrm)) |
| 1210 |
endif |
| 1211 |
ifeq ($(with_multiarch),yes) |
| 1212 |
chmod ugo-x $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so |
| 1213 |
chmod ugo-x $(d_mul)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so.* |
| 1214 |
$(call strip_package, $(p_mul), $(d_mul)) |
| 1215 |
endif |
| 1216 |
|
| 1217 |
for i in $(d_dev)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.a; do \ |
| 1218 |
echo "lto-stripping $(basename $$i) ..."; \ |
| 1219 |
$(STRIP_LTO) $$i; \ |
| 1220 |
if which strip-nondeterminism >/dev/null 2>&1; then \ |
| 1221 |
echo "strip-nondeterminism $(basename $$i) ..."; \ |
| 1222 |
strip-nondeterminism $$i; \ |
| 1223 |
fi; \ |
| 1224 |
done |
| 1225 |
|
| 1226 |
: # Don't want /usr/<arch>-linux to exist in any package |
| 1227 |
rm -rf $(d_bin)/$(PF)/$(DEB_HOST_GNU_TYPE) |
| 1228 |
|
| 1229 |
: # Remove windows related manpages |
| 1230 |
rm -f $(d_com)/$(PF)/share/man/man1/{dlltool,nlmconv,windmc,windres}.1 |
| 1231 |
|
| 1232 |
ifeq ($(with_multiarch),yes) |
| 1233 |
rm -rf $(d_mul)/$(PF)/$(DEB_HOST_GNU_TYPE) |
| 1234 |
rm -f $(d_mul)/$(PF)/share/man/man1/{dlltool,nlmconv,windmc,windres}.1 |
| 1235 |
endif |
| 1236 |
|
| 1237 |
rm -f $(d_bin)/$(PF)/bin/ld.bfd |
| 1238 |
mv $(d_bin)/$(PF)/bin/ld $(d_bin)/$(PF)/bin/ld.bfd |
| 1239 |
mv $(d_com)/$(PF)/share/man/man1/ld.1 \ |
| 1240 |
$(d_com)/$(PF)/share/man/man1/ld.bfd.1 |
| 1241 |
ln -sf $(DEB_HOST_GNU_TYPE)-ld.bfd $(d_bin)/$(PF)/bin/ld |
| 1242 |
$(install_dir) $(d_com)/$(PF)/share/man/man1 |
| 1243 |
ln -sf ld.bfd.1.gz $(d_com)/$(PF)/share/man/man1/ld.1.gz |
| 1244 |
ifeq ($(with_gold),yes) |
| 1245 |
ln -s ld.gold $(d_bin)/$(PF)/bin/gold |
| 1246 |
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
| 1247 |
find debian -name '*gold' -o -name '*dwp' |
| 1248 |
if which help2man >/dev/null 2>&1; then \ |
| 1249 |
help2man -N -n 'The GNU ELF linker' \ |
| 1250 |
$(d_bin)/$(PF)/bin/ld.gold \ |
| 1251 |
| sed -e 's,debian/.*-ld.gold,ld.gold,g' \ |
| 1252 |
-e 's/$(DEB_HOST_GNU_TYPE)-//g' \ |
| 1253 |
-e '/supported emulations/d' \ |
| 1254 |
-e '/supported targets/s/.*/Run gold --help for a list of supported targets and emulations./' \ |
| 1255 |
-e '/Keep files mapped across passes/s/passes.*$$/passes (default on 64bit architectures)/' \ |
| 1256 |
-e '/Map whole files to memory/s/memory.*$$/memory (default on 64bit architectures)/' \ |
| 1257 |
-e '/Map relevant file parts to memory/s/memory.*$$/memory (default on 32bit architectures)/' \ |
| 1258 |
-e '/Release mapped files after each pass/s/pass.*$$/pass (default on 32bit architectures)/' \ |
| 1259 |
> debian/ld.gold.1; \ |
| 1260 |
help2man -N -n 'The DWARF packaging utility' \ |
| 1261 |
$(d_bin)/$(PF)/bin/dwp \ |
| 1262 |
| sed -e 's,debian/.*-dwp,dwp,g' \ |
| 1263 |
-e 's/$(DEB_HOST_GNU_TYPE)-//g' \ |
| 1264 |
> debian/dwp.1; \ |
| 1265 |
fi |
| 1266 |
endif |
| 1267 |
cp debian/dwp.1 $(d_com)/$(PF)/share/man/man1/ |
| 1268 |
cp debian/ld.gold.1 $(d_com)/$(PF)/share/man/man1/ |
| 1269 |
ln -s ld.gold.1.gz $(d_com)/$(PF)/share/man/man1/gold.1.gz |
| 1270 |
|
| 1271 |
: # install a symlink for the gold linker |
| 1272 |
$(install_dir) $(d_bin)/$(PF)/lib/gold-ld |
| 1273 |
ln -s ../../bin/ld.gold $(d_bin)/$(PF)/lib/gold-ld/ld |
| 1274 |
endif |
| 1275 |
: # install a symlink for the bfd linker |
| 1276 |
$(install_dir) $(d_bin)/$(PF)/lib/compat-ld |
| 1277 |
ln -s ../../bin/ld.bfd $(d_bin)/$(PF)/lib/compat-ld/ld |
| 1278 |
|
| 1279 |
: # Remove empty directory |
| 1280 |
rmdir $(d_bin)/$(PF)/include/ |
| 1281 |
|
| 1282 |
ifeq ($(with_gprofng),yes) |
| 1283 |
$(install_dir) $(d_com)/etc |
| 1284 |
mv $(d_bin)/etc/gprofng.rc $(d_com)/etc/. |
| 1285 |
endif |
| 1286 |
|
| 1287 |
ifeq ($(with_gprofng),yes) |
| 1288 |
: # Remove the gp-* compat symlinks |
| 1289 |
rm -f $(PF)/bin/gp-* |
| 1290 |
endif |
| 1291 |
: # Rename non-prefixed binaries to $(DEB_HOST_GNU_TYPE)- prefixed binaries |
| 1292 |
: # and provide symlinks to the prefixed binaries. |
| 1293 |
$(install_dir) $(d_nat)/$(PF)/bin $(d_nat)/$(PF)/share/man/man1 |
| 1294 |
for i in $(binutils_programs); do \ |
| 1295 |
mv $(d_bin)/$(PF)/bin/$$i $(d_nat)/$(PF)/bin/$(DEB_HOST_GNU_TYPE)-$$i; \ |
| 1296 |
ln -sf $(DEB_HOST_GNU_TYPE)-$$i $(d_bin)/$(PF)/bin/$$i; \ |
| 1297 |
done |
| 1298 |
ifeq ($(with_gold),yes) |
| 1299 |
ln -sf $(DEB_HOST_GNU_TYPE)-ld.gold $(d_nat)/usr/bin/$(DEB_HOST_GNU_TYPE)-gold |
| 1300 |
endif |
| 1301 |
for i in $(binutils_programs); do \ |
| 1302 |
ln -sf $$i.1.gz $(d_nat)/$(PF)/share/man/man1/$(DEB_HOST_GNU_TYPE)-$$i.1.gz; \ |
| 1303 |
done |
| 1304 |
|
| 1305 |
ifeq ($(DEB_SOURCE),binutils-gold) |
| 1306 |
rm -rf $(d_nat)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1307 |
rm -rf $(d_bin)/etc |
| 1308 |
rm -rf $(d_bin)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1309 |
|
| 1310 |
: # Remove non-gold binaries |
| 1311 |
for i in $(d_nat)/$(PF)/bin/*; do \ |
| 1312 |
case $$(basename $$i) in *-ld.gold|*-gold|*-dwp) continue;; esac; \ |
| 1313 |
rm -f $$i; \ |
| 1314 |
done |
| 1315 |
rm -rf $(d_nat)/$(PF)/lib/*/ldscripts |
| 1316 |
rm -rf $(d_nat)/$(PF)/lib/*/bfd-plugins |
| 1317 |
|
| 1318 |
: # Remove non-gold binaries |
| 1319 |
for i in $(d_bin)/$(PF)/bin/*; do \ |
| 1320 |
case $$(basename $$i) in ld.gold|gold|dwp) continue;; esac; \ |
| 1321 |
echo "Removing $$i"; \ |
| 1322 |
rm -f $$i; \ |
| 1323 |
done |
| 1324 |
rm -rf $(d_bin)/$(PF)/lib/compat-ld |
| 1325 |
rm -rf $(d_bin)/$(PF)/lib/*/gprofng |
| 1326 |
-ls -l $(d_bin)/$(PF)/share/man/man1 $(d_bin)/$(PF)/bin |
| 1327 |
|
| 1328 |
: # gold man pages |
| 1329 |
rm -rf $(d_nat)/$(PF)/share/man/man1 |
| 1330 |
$(install_dir) $(d_nat)/$(PF)/share/man/man1 |
| 1331 |
cp debian/dwp.1 $(d_nat)/$(PF)/share/man/man1/$(DEB_HOST_GNU_TYPE)-dwp.1 |
| 1332 |
cp debian/ld.gold.1 $(d_nat)/$(PF)/share/man/man1/$(DEB_HOST_GNU_TYPE)-ld.gold.1 |
| 1333 |
gzip -9n $(d_nat)/$(PF)/share/man/man1/*.1 |
| 1334 |
ln -s $(DEB_HOST_GNU_TYPE)-ld.gold.1.gz $(d_nat)/$(PF)/share/man/man1/$(DEB_HOST_GNU_TYPE)-gold.1.gz |
| 1335 |
|
| 1336 |
rm -rf $(d_bin)/$(PF)/share/man/man1 |
| 1337 |
$(install_dir) $(d_bin)/$(PF)/share/man/man1 |
| 1338 |
ln -sf $(DEB_HOST_GNU_TYPE)-dwp.1.gz $(d_bin)/$(PF)/share/man/man1/dwp.1.gz |
| 1339 |
ln -sf $(DEB_HOST_GNU_TYPE)-ld.gold.1.gz $(d_bin)/$(PF)/share/man/man1/ld.gold.1.gz |
| 1340 |
ln -s ld.gold.1.gz $(d_bin)/$(PF)/share/man/man1/gold.1.gz |
| 1341 |
|
| 1342 |
: # gold translations |
| 1343 |
(cd debian/binutils-gold-common; tar cf - usr/share/locale/*/LC_MESSAGES/gold.mo) \ |
| 1344 |
| (cd $(d_bin); tar xf -) |
| 1345 |
endif |
| 1346 |
|
| 1347 |
ifeq ($(with_native),yes) |
| 1348 |
$(call strip_package, $(p_nat), $(d_nat)) |
| 1349 |
endif |
| 1350 |
ifeq ($(with_multiarch),yes) |
| 1351 |
for i in \ |
| 1352 |
addr2line ar gprof \ |
| 1353 |
nm objcopy objdump ranlib readelf size strings strip; \ |
| 1354 |
do \ |
| 1355 |
mv $(d_mul)/$(PF)/bin/$$i $(d_mul)/$(PF)/bin/$(DEB_HOST_GNU_TYPE)-$$i; \ |
| 1356 |
done |
| 1357 |
rm -f $(d_mul)/$(PF)/bin/embedspu |
| 1358 |
endif |
| 1359 |
touch $@ |
| 1360 |
|
| 1361 |
stamps/install-hppa64: checkroot stamps/build-hppa64 |
| 1362 |
$(checkdir) |
| 1363 |
|
| 1364 |
rm -fr $(d_hppa64) |
| 1365 |
$(install_dir) $(d_hppa64) |
| 1366 |
$(install_dir) $(d_hppa64)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1367 |
|
| 1368 |
: # install binutils-hppa64 stuff |
| 1369 |
env MAKE="$(MAKE) VERSION=$(HPPA64_VERSION)" \ |
| 1370 |
$(MAKE) -C builddir-hppa64 \ |
| 1371 |
CFLAGS="$(CFLAGS)" \ |
| 1372 |
CXXFLAGS="$(CXXFLAGS)" \ |
| 1373 |
LDFLAGS="$(LDFLAGS)" \ |
| 1374 |
DESTDIR=$(CURDIR)/$(d_hppa64) install |
| 1375 |
|
| 1376 |
: # move shared libs to the standard path |
| 1377 |
mv $(d_hppa64)/$(PF)/$(DEB_HOST_GNU_TYPE)/hppa64-linux-gnu/lib/lib*-*.so \ |
| 1378 |
$(d_hppa64)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/. |
| 1379 |
mv $(d_hppa64)/$(PF)/lib/hppa64-linux-gnu/libctf*.so.* \ |
| 1380 |
$(d_hppa64)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/. |
| 1381 |
|
| 1382 |
: # Now get rid of just about everything in binutils-hppa64 |
| 1383 |
rm -rf $(d_hppa64)/$(PF)/man |
| 1384 |
rm -rf $(d_hppa64)/$(PF)/info |
| 1385 |
rm -rf $(d_hppa64)/$(PF)/include |
| 1386 |
rm -rf $(d_hppa64)/$(PF)/share |
| 1387 |
rm -rf $(d_hppa64)/$(PF)/hppa-linux-gnu |
| 1388 |
rm -rf $(d_hppa64)/$(PF)/lib/libiberty.a |
| 1389 |
rm -rf $(d_hppa64)/$(PF)/lib/hppa64-linux-gnu/libctf* |
| 1390 |
rm -rf $(d_hppa64)/$(PF)/lib/hppa64-linux-gnu/libsframe* |
| 1391 |
|
| 1392 |
: # replace hard links with soft links |
| 1393 |
for i in $(d_hppa64)/usr/hppa64-linux-gnu/bin/*; do \ |
| 1394 |
ln -sf ../../bin/hppa64-linux-gnu-$$(basename $$i) $$i; \ |
| 1395 |
done |
| 1396 |
ln -sf hppa64-linux-gnu-ld.bfd $(d_hppa64)/usr/bin/hppa64-linux-gnu-ld |
| 1397 |
|
| 1398 |
$(call strip_package, $(p_hppa64), $(d_hppa64)) |
| 1399 |
chmod ugo-x $(d_hppa64)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so |
| 1400 |
chmod ugo-x $(d_hppa64)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/*.so.* |
| 1401 |
chmod ugo-x $(d_hppa64)/$(PF)/lib/*/bfd-plugins/*.so |
| 1402 |
|
| 1403 |
: # remove RPATH |
| 1404 |
chrpath -k -d $$(file $(d_hppa64)/usr/bin/*|awk -F: '/ ELF/ {print $$1}') |
| 1405 |
chrpath -k -d $$(file $(d_hppa64)/usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so*|awk -F: '/ ELF/ {print $$1}') |
| 1406 |
|
| 1407 |
: # Don't want /usr/<arch>-linux to exist in any package |
| 1408 |
rm -rf $(d_hppa64)/$(PF)/$(DEB_HOST_GNU_TYPE) |
| 1409 |
|
| 1410 |
touch $@ |
| 1411 |
|
| 1412 |
|
| 1413 |
|
| 1414 |
|
| 1415 |
|
| 1416 |
|
| 1417 |
|
| 1418 |
binary-indep: checkroot build install |
| 1419 |
$(checkdir) |
| 1420 |
|
| 1421 |
rm -f debian/files debian/substvars |
| 1422 |
|
| 1423 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1424 |
|
| 1425 |
ifeq (,$(TARGET)) |
| 1426 |
|
| 1427 |
$(install_dir) $(d_doc)/DEBIAN |
| 1428 |
|
| 1429 |
ifeq ($(GFDL_INVARIANT_FREE),yes) |
| 1430 |
rm -f $(d_doc)/$(PF)/share/info/bfd.info* |
| 1431 |
rm -f $(d_doc)/$(PF)/share/info/bfdint.info* |
| 1432 |
rm -f $(d_doc)/$(PF)/share/info/ldint.info* |
| 1433 |
endif |
| 1434 |
|
| 1435 |
ifneq ($(BACKPORT),true) |
| 1436 |
$(install_dir) $(d_doc)/$(PF)/share/doc/$(p_doc)/ |
| 1437 |
$(install_file) debian/changelog $(d_doc)/$(PF)/share/doc/$(p_doc)/changelog.Debian |
| 1438 |
$(install_file) debian/copyright $(d_doc)/$(PF)/share/doc/$(p_doc)/ |
| 1439 |
for i in bfd gas gprof ld; do \ |
| 1440 |
ln -sf ../$(p_bin)/$$i $(d_doc)/$(PF)/share/doc/$(p_doc)/$$i; \ |
| 1441 |
done |
| 1442 |
find $(d_doc)/$(PF)/share/doc/$(p_doc) -maxdepth 1 -type f ! -name copyright | xargs gzip -9n |
| 1443 |
gzip -9n $(d_doc)/$(PF)/share/info/* |
| 1444 |
|
| 1445 |
dpkg-gencontrol -P$(d_doc) -p$(p_doc) |
| 1446 |
$(CHOWN) -R root:root $(d_doc) |
| 1447 |
chmod -R go=rX $(d_doc) |
| 1448 |
find $(d_doc) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1449 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1450 |
$(DPKG_DEB) --build $(d_doc) .. |
| 1451 |
|
| 1452 |
$(install_dir) $(d_src)/$(PF)/share/doc/$(p_src)/ |
| 1453 |
$(install_file) debian/changelog $(d_src)/$(PF)/share/doc/$(p_src)/changelog.Debian |
| 1454 |
$(install_file) debian/copyright $(d_src)/$(PF)/share/doc/$(p_src)/ |
| 1455 |
find $(d_src)/$(PF)/share/doc/$(p_src) -maxdepth 1 -type f ! -name copyright | xargs gzip -9n |
| 1456 |
endif |
| 1457 |
|
| 1458 |
$(install_dir) $(d_src)/DEBIAN |
| 1459 |
$(install_dir) $(d_src)/$(PF)/src/binutils/patches |
| 1460 |
$(install_file) debian/patches/* $(d_src)/$(PF)/src/binutils/patches/ |
| 1461 |
cd .. && find $(source_files) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1462 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' && \ |
| 1463 |
find $(source_files) -type f -print0 | LC_ALL=C sort -z | \ |
| 1464 |
XZ_OPT=-9 tar --null -T - -c --xz --mode=go=rX,u+rw,a-s \ |
| 1465 |
--owner=0 --group=0 --numeric-owner --sort=name \ |
| 1466 |
--xform='s=^[^/]*\/=binutils-$(VERSION)/=' \ |
| 1467 |
-f $(pwd)/$(d_src)/$(PF)/src/binutils/binutils-$(VERSION).tar.xz \ |
| 1468 |
$(source_files) |
| 1469 |
|
| 1470 |
tar cf - $$(find './debian' -mindepth 1 \( \ |
| 1471 |
-path './debian/binutils*' -type d -prune -o \ |
| 1472 |
-path './debian/libbinutils' -type d -prune -o \ |
| 1473 |
-path './debian/binutils*-dbg' -type d -prune -o \ |
| 1474 |
-path './debian/libbinutils-dbg' -type d -prune -o \ |
| 1475 |
-path './debian/patches' -prune -o \ |
| 1476 |
-path './debian/libctf*' -type d -prune -o \ |
| 1477 |
-path './debian/libgprofng*' -type d -prune -o \ |
| 1478 |
-path './debian/libsframe*' -type d -prune -o \ |
| 1479 |
-path './debian/tmp*' -prune -o \ |
| 1480 |
-path './debian/.bzr*' -prune -o \ |
| 1481 |
-path './debian/files' -prune -o \ |
| 1482 |
-print \) ) \ |
| 1483 |
| tar -x -C $(d_src)/$(PF)/src/binutils -f - |
| 1484 |
-chmod 755 $(d_src)/$(PF)/src/binutils/debian/*.{pre,post}{inst,rm} |
| 1485 |
chmod 755 $(d_src)/$(PF)/src/binutils/debian/test-suite-compare.py |
| 1486 |
|
| 1487 |
dpkg-gencontrol -P$(d_src) -p$(p_src) |
| 1488 |
$(CHOWN) -R root:root $(d_src) |
| 1489 |
chmod -R go=rX $(d_src) |
| 1490 |
find $(d_src) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1491 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1492 |
$(DPKG_DEB) --build $(d_src) .. |
| 1493 |
|
| 1494 |
|
| 1495 |
$(install_dir) $(d_bld)/DEBIAN $(d_bld)/$(PF)/share/doc/ |
| 1496 |
ln -sf $(p_com) $(d_bld)/$(PF)/share/doc/$(p_bld) |
| 1497 |
dpkg-gencontrol -P$(d_bld) -p$(p_bld) -Vbinutils:minver=$(min_ver) |
| 1498 |
$(CHOWN) -R root:root $(d_bld) |
| 1499 |
chmod -R go=rX $(d_bld) |
| 1500 |
find $(d_bld) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1501 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1502 |
$(DPKG_DEB) --build $(d_bld) .. |
| 1503 |
endif |
| 1504 |
endif |
| 1505 |
|
| 1506 |
|
| 1507 |
|
| 1508 |
|
| 1509 |
|
| 1510 |
|
| 1511 |
|
| 1512 |
binary.%: stamps/install.% install |
| 1513 |
rm -rf $(D_CROSS)/$(PF)/share/info |
| 1514 |
|
| 1515 |
rm -rf $(D_CROSS)/DEBIAN $(D_CROSS)-dbg/DEBIAN |
| 1516 |
|
| 1517 |
: # make lintian happy |
| 1518 |
$(install_dir) $(D_CROSS)/$(PF)/share/lintian/overrides |
| 1519 |
sed 's/@PKG@/$(P_CROSS)/' debian/binutils-cross.overrides \ |
| 1520 |
> $(D_CROSS)/$(PF)/share/lintian/overrides/$(P_CROSS) |
| 1521 |
|
| 1522 |
: # install maintainer scripts |
| 1523 |
$(install_dir) $(D_CROSS)/$(PF)/share/doc/$(P_CROSS) |
| 1524 |
$(install_file) debian/changelog \ |
| 1525 |
$(D_CROSS)/$(PF)/share/doc/$(P_CROSS)/changelog.Debian |
| 1526 |
$(install_file) debian/copyright debian/README.cross \ |
| 1527 |
$(D_CROSS)/$(PF)/share/doc/$(P_CROSS)/ |
| 1528 |
gzip -9nf $(D_CROSS)/$(PF)/share/doc/$(P_CROSS)/changelog.Debian |
| 1529 |
|
| 1530 |
ifeq ($(with_check),yes) |
| 1531 |
: # remove user and date from test-summary for reproducible builds |
| 1532 |
sed -i -e '/Test run by/d' test-summary-$* |
| 1533 |
$(install_file) test-summary-$* \ |
| 1534 |
$(D_CROSS)/$(PF)/share/doc/$(P_CROSS)/test-summary |
| 1535 |
gzip -9nf $(D_CROSS)/$(PF)/share/doc/$(P_CROSS)/test-summary |
| 1536 |
$(install_dir) $(D_CROSS)/$(PF)/share/doc/$(p_bin) |
| 1537 |
ln -sf ../$(P_CROSS)/test-summary.gz \ |
| 1538 |
$(D_CROSS)/$(PF)/share/doc/$(p_bin)/test-summary-$*.gz |
| 1539 |
endif |
| 1540 |
|
| 1541 |
for pkg in bfd gas gprof ld; do \ |
| 1542 |
ln -sf ../binutils/$$pkg \ |
| 1543 |
$(D_CROSS)/$(PF)/share/doc/$(P_CROSS)/$$pkg; \ |
| 1544 |
done |
| 1545 |
|
| 1546 |
$(install_dir) $(D_CROSS)/DEBIAN $(D_CROSS)-dbg/DEBIAN |
| 1547 |
if [ "$(is_rc)" = yes ]; then \ |
| 1548 |
nver=$$(echo $(DEB_VERSION_UPSTREAM) | awk -F. '{ OFS="."; NF--; $$NF=$$NF+1; print }'); \ |
| 1549 |
else \ |
| 1550 |
nver=$$(echo $(DEB_VERSION_UPSTREAM) | awk -F. '{ OFS="."; if (NF > 2) $$NF=$$NF+1; else $$++NF=1; print }'); \ |
| 1551 |
fi; \ |
| 1552 |
date_ext=$(DATE_EXT); \ |
| 1553 |
[ "$(is_rc)" = yes ] && date_ext=; \ |
| 1554 |
$(install_file) debian/binutils.triggers $(D_CROSS)/DEBIAN/triggers |
| 1555 |
|
| 1556 |
rm -f debian/substvars |
| 1557 |
dpkg-shlibdeps $(D_CROSS)/$(PF)/bin/* -l$(d_lib)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1558 |
dpkg-gencontrol -P$(D_CROSS) -p$(P_CROSS) \ |
| 1559 |
-VBuilt-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W binutils-source)" |
| 1560 |
cd $(D_CROSS) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1561 |
dpkg-gencontrol -P$(D_CROSS)-dbg -p$(P_CROSS)-dbg |
| 1562 |
cd $(D_CROSS)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1563 |
$(CHOWN) -R root:root $(D_CROSS) $(D_CROSS)-dbg |
| 1564 |
chmod -R go=rX $(D_CROSS) $(D_CROSS)-dbg |
| 1565 |
find $(D_CROSS) $(D_CROSS)-dbg -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1566 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1567 |
$(DPKG_DEB) --build $(D_CROSS) .. |
| 1568 |
$(DPKG_DEB) --build $(D_CROSS)-dbg .. |
| 1569 |
|
| 1570 |
binary-for-host: checkroot |
| 1571 |
$(checkdir) |
| 1572 |
|
| 1573 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1574 |
rm -fr $(d_hst) |
| 1575 |
$(install_dir) $(d_hst)/DEBIAN/ $(d_hst)/$(PF)/share/doc/ |
| 1576 |
ln -sf $(p_com) $(d_hst)/$(PF)/share/doc/$(p_hst) |
| 1577 |
|
| 1578 |
rm -f debian/substvars |
| 1579 |
$(for_target) dpkg-gencontrol -P$(d_hst) -p$(p_hst) \ |
| 1580 |
-Vbinutils:native=$(if $(TARGET),$(p_cross),$(p_nat)) \ |
| 1581 |
-Vbinutils:minver=$(min_ver) |
| 1582 |
|
| 1583 |
$(CHOWN) -R root:root $(d_hst) |
| 1584 |
chmod -R go=rX $(d_hst) |
| 1585 |
|
| 1586 |
find $(d_hst) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1587 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1588 |
$(DPKG_DEB) --build $(d_hst) .. |
| 1589 |
endif |
| 1590 |
|
| 1591 |
binary-arch: checkroot binary-native binary-for-host \ |
| 1592 |
$(if $(filter yes, $(with_cross)),$(addprefix binary.,$(CROSS_ARCHS))) |
| 1593 |
$(checkdir) |
| 1594 |
|
| 1595 |
binary-native: checkroot build install $(checkdir) |
| 1596 |
|
| 1597 |
ifneq ($(BACKPORT),true) |
| 1598 |
|
| 1599 |
ifneq (,$(TARGET)) |
| 1600 |
rm -rf $(d_cross)/$(PF)/share/info $(d_cross)/$(PF)/share/man |
| 1601 |
|
| 1602 |
$(install_dir) $(d_cross)/DEBIAN |
| 1603 |
|
| 1604 |
$(install_dir) $(d_cross)/$(PF)/share/doc/$(p_cross)/ |
| 1605 |
$(install_file) debian/changelog $(d_cross)/$(PF)/share/doc/$(p_cross)/changelog.Debian |
| 1606 |
$(install_file) debian/copyright debian/README.cross $(d_cross)/$(PF)/share/doc/$(p_cross)/ |
| 1607 |
gzip -9nf $(d_cross)/$(PF)/share/doc/$(p_cross)/changelog.Debian |
| 1608 |
|
| 1609 |
for pkg in bfd gas gprof ld; do \ |
| 1610 |
ln -sf ../binutils/$$pkg $(d_cross)/$(PF)/share/doc/$(p_cross)/$$pkg; \ |
| 1611 |
done |
| 1612 |
|
| 1613 |
rm -f debian/substvars |
| 1614 |
dpkg-shlibdeps $(d_cross)/$(PF)/bin/* \ |
| 1615 |
-ldebian/tmp/$(PF)/lib/$(DEB_TARGET_MULTIARCH) -l$(d_lib)/$(PF)/lib/$(DEB_TARGET_MULTIARCH) |
| 1616 |
dpkg-gencontrol -P$(d_cross) -p$(p_cross) \ |
| 1617 |
-VBuilt-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W binutils-source)" |
| 1618 |
find $(d_cross) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1619 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1620 |
$(DPKG_DEB) --build $(d_cross) .. |
| 1621 |
|
| 1622 |
else |
| 1623 |
: # generate some control & helper files |
| 1624 |
if [ "$(is_rc)" = yes ]; then \ |
| 1625 |
nver=$$(echo $(DEB_VERSION_UPSTREAM) | awk -F. '{ OFS="."; NF--; $$NF=$$NF+1; print }'); \ |
| 1626 |
else \ |
| 1627 |
nver=$$(echo $(DEB_VERSION_UPSTREAM) | awk -F. '{ OFS="."; if (NF > 2) $$NF=$$NF+1; else $$++NF=1; print }'); \ |
| 1628 |
fi; \ |
| 1629 |
for i in debian/*.in; do \ |
| 1630 |
case "$$i" in debian/control.in|debian/control.cross.in) continue; esac; \ |
| 1631 |
date_ext=$(DATE_EXT); \ |
| 1632 |
case "$$i" in debian/*.shlibs.in) [ "$(is_rc)" = yes ] && date_ext=; esac; \ |
| 1633 |
sed -e 's/@VER@/$(VERSION)/g' \ |
| 1634 |
-e 's/@DEB_VER@/$(DEB_VERSION)/g' \ |
| 1635 |
-e 's/@DEB_SVER@/$(DEB_SVERSION)/g' \ |
| 1636 |
-e 's/@DEB_UVER@/$(DEB_VERSION_UPSTREAM)/g' \ |
| 1637 |
-e "s/@DEB_NVER@/$$nver/g" \ |
| 1638 |
-e "s/@DATE_EXT@/$$date_ext/g" \ |
| 1639 |
-e 's/@DEB_ARCH@/$(DEB_HOST_ARCH)/g' \ |
| 1640 |
-e 's/@DEB_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \ |
| 1641 |
-e 's/@DEB_TRIPLET@/$(DEB_HOST_GNU_TYPE)/g' \ |
| 1642 |
-e "s/@dpkg_dev@/$(DPKG_DEV)/" \ |
| 1643 |
$$i > $${i%*.in}; \ |
| 1644 |
case "$$i" in *.post*|*.pre*) chmod 755 $${i%*.in}; esac; \ |
| 1645 |
done |
| 1646 |
|
| 1647 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1648 |
: # install bug reporting information |
| 1649 |
$(install_file) -D debian/$(p_bin).presubj \ |
| 1650 |
$(d_bin)/$(PF)/share/bug/$(p_bin)/presubj |
| 1651 |
ifeq ($(with_multiarch),yes) |
| 1652 |
$(install_dir) $(d_mul)/$(PF)/share/bug |
| 1653 |
ln -sf $(p_bin) $(d_mul)/$(PF)/share/bug/$(p_mul) |
| 1654 |
endif |
| 1655 |
ifeq ($(with_hppa64),yes) |
| 1656 |
$(install_dir) $(d_hppa64)/$(PF)/share/bug |
| 1657 |
ln -sf $(p_bin) $(d_hppa64)/$(PF)/share/bug/$(p_hppa64) |
| 1658 |
endif |
| 1659 |
|
| 1660 |
: # make lintian happy |
| 1661 |
$(install_file) -D debian/$(p_com).overrides \ |
| 1662 |
$(d_com)/$(PF)/share/lintian/overrides/$(p_com) |
| 1663 |
$(install_file) -D debian/$(p_lib).overrides \ |
| 1664 |
$(d_lib)/$(PF)/share/lintian/overrides/$(p_lib) |
| 1665 |
$(install_file) -D debian/binutils.overrides \ |
| 1666 |
$(d_bin)/$(PF)/share/lintian/overrides/$(p_bin) |
| 1667 |
$(install_dir) $(d_nat)/$(PF)/share/lintian/overrides |
| 1668 |
sed 's/@PKG@/$(p_nat)/' debian/binutils-triplet.overrides \ |
| 1669 |
> $(d_nat)/$(PF)/share/lintian/overrides/$(p_nat) |
| 1670 |
ifeq ($(with_multiarch),yes) |
| 1671 |
$(install_file) -D debian/$(p_mul).overrides \ |
| 1672 |
$(d_mul)/$(PF)/share/lintian/overrides/$(p_mul) |
| 1673 |
$(install_file) -D debian/$(p_mdev).overrides \ |
| 1674 |
$(d_mdev)/$(PF)/share/lintian/overrides/$(p_mdev) |
| 1675 |
endif |
| 1676 |
ifeq ($(with_hppa64),yes) |
| 1677 |
$(install_file) -D debian/$(p_hppa64).overrides \ |
| 1678 |
$(d_hppa64)/$(PF)/share/lintian/overrides/$(p_hppa64) |
| 1679 |
endif |
| 1680 |
endif |
| 1681 |
|
| 1682 |
: # install maintainer scripts |
| 1683 |
$(install_dir) $(d_bin)/DEBIAN |
| 1684 |
|
| 1685 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1686 |
$(install_dir) $(d_lib)/DEBIAN $(d_lib)-dbg/DEBIAN |
| 1687 |
$(install_file) debian/binutils.triggers $(d_lib)/DEBIAN/triggers |
| 1688 |
$(install_file) debian/libbinutils.shlibs $(d_lib)/DEBIAN/shlibs |
| 1689 |
|
| 1690 |
$(install_dir) $(d_ctf)/DEBIAN $(d_ctf)-dbg/DEBIAN |
| 1691 |
$(install_file) debian/binutils.triggers $(d_ctf)/DEBIAN/triggers |
| 1692 |
$(install_file) debian/libctf0.shlibs $(d_ctf)/DEBIAN/shlibs |
| 1693 |
$(install_file) debian/libctf0.symbols $(d_ctf)/DEBIAN/symbols |
| 1694 |
|
| 1695 |
$(install_dir) $(d_ctfn)/DEBIAN $(d_ctfn)-dbg/DEBIAN |
| 1696 |
$(install_file) debian/binutils.triggers $(d_ctfn)/DEBIAN/triggers |
| 1697 |
$(install_file) debian/libctf-nobfd0.shlibs $(d_ctfn)/DEBIAN/shlibs |
| 1698 |
$(install_file) debian/libctf-nobfd0.symbols $(d_ctfn)/DEBIAN/symbols |
| 1699 |
|
| 1700 |
ifeq ($(with_gprofng),yes) |
| 1701 |
$(install_dir) $(d_gpng)/DEBIAN $(d_gpng)-dbg/DEBIAN |
| 1702 |
$(install_file) debian/binutils.triggers $(d_gpng)/DEBIAN/triggers |
| 1703 |
$(install_file) debian/libgprofng0.shlibs $(d_gpng)/DEBIAN/shlibs |
| 1704 |
|
| 1705 |
$(install_dir) $(d_com)/DEBIAN |
| 1706 |
$(install_file) debian/binutils-common.conffiles $(d_com)/DEBIAN/conffiles |
| 1707 |
endif |
| 1708 |
$(install_dir) $(d_sfrm)/DEBIAN $(d_sfrm)-dbg/DEBIAN |
| 1709 |
$(install_file) debian/binutils.triggers $(d_sfrm)/DEBIAN/triggers |
| 1710 |
$(install_file) debian/libsframe1.shlibs $(d_sfrm)/DEBIAN/shlibs |
| 1711 |
$(install_file) debian/libsframe1.symbols $(d_sfrm)/DEBIAN/symbols |
| 1712 |
endif |
| 1713 |
|
| 1714 |
$(install_dir) $(d_nat)/DEBIAN $(d_nat)-dbg/DEBIAN |
| 1715 |
|
| 1716 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1717 |
$(install_dir) $(d_dev)/DEBIAN |
| 1718 |
|
| 1719 |
ifeq ($(with_multiarch),yes) |
| 1720 |
$(install_dir) $(d_mul)/DEBIAN $(d_mul)-dbg/DEBIAN |
| 1721 |
$(install_script) debian/binutils-multiarch.preinst $(d_mul)/DEBIAN/preinst |
| 1722 |
$(install_script) debian/binutils-multiarch.postinst $(d_mul)/DEBIAN/postinst |
| 1723 |
$(install_script) debian/binutils-multiarch.prerm $(d_mul)/DEBIAN/prerm |
| 1724 |
$(install_script) debian/binutils-multiarch.postrm $(d_mul)/DEBIAN/postrm |
| 1725 |
$(install_file) debian/binutils-multiarch.shlibs $(d_mul)/DEBIAN/shlibs |
| 1726 |
$(install_file) debian/binutils.triggers $(d_mul)/DEBIAN/triggers |
| 1727 |
$(install_dir) $(d_mdev)/DEBIAN |
| 1728 |
endif |
| 1729 |
|
| 1730 |
ifeq ($(with_hppa64),yes) |
| 1731 |
$(install_dir) $(d_hppa64)/DEBIAN $(d_hppa64)-dbg/DEBIAN |
| 1732 |
$(install_file) debian/binutils.triggers $(d_hppa64)/DEBIAN/triggers |
| 1733 |
endif |
| 1734 |
endif |
| 1735 |
|
| 1736 |
: # install docs |
| 1737 |
$(install_dir) $(d_bin)/$(PF)/share/doc/$(p_bin)/ |
| 1738 |
$(install_file) debian/changelog $(d_bin)/$(PF)/share/doc/$(p_bin)/changelog.Debian |
| 1739 |
$(install_file) debian/copyright $(d_bin)/$(PF)/share/doc/$(p_bin)/ |
| 1740 |
|
| 1741 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1742 |
$(install_dir) $(d_com)/$(PF)/share/doc/$(p_com)/ |
| 1743 |
$(install_file) debian/changelog $(d_com)/$(PF)/share/doc/$(p_com)/changelog.Debian |
| 1744 |
$(install_file) debian/copyright $(d_com)/$(PF)/share/doc/$(p_com)/ |
| 1745 |
|
| 1746 |
$(install_dir) $(d_lib)/$(PF)/share/doc/ |
| 1747 |
ln -sf $(p_com) $(d_lib)/$(PF)/share/doc/$(p_lib) |
| 1748 |
|
| 1749 |
$(install_dir) $(d_ctf)/$(PF)/share/doc/ |
| 1750 |
ln -sf $(p_lib) $(d_ctf)/$(PF)/share/doc/$(p_ctf) |
| 1751 |
|
| 1752 |
$(install_dir) $(d_ctfn)/$(PF)/share/doc/$(p_ctfn) |
| 1753 |
$(install_file) debian/changelog $(d_ctfn)/$(PF)/share/doc/$(p_ctfn)/changelog.Debian |
| 1754 |
$(install_file) debian/copyright $(d_ctfn)/$(PF)/share/doc/$(p_ctfn)/ |
| 1755 |
|
| 1756 |
ifeq ($(with_gprofng),yes) |
| 1757 |
$(install_dir) $(d_gpng)/$(PF)/share/doc/ |
| 1758 |
ln -sf $(p_lib) $(d_gpng)/$(PF)/share/doc/$(p_gpng) |
| 1759 |
endif |
| 1760 |
$(install_dir) $(d_sfrm)/$(PF)/share/doc/$(p_sfrm) |
| 1761 |
$(install_file) debian/changelog $(d_sfrm)/$(PF)/share/doc/$(p_sfrm)/changelog.Debian |
| 1762 |
$(install_file) debian/copyright $(d_sfrm)/$(PF)/share/doc/$(p_sfrm)/ |
| 1763 |
endif |
| 1764 |
|
| 1765 |
ifeq ($(DEB_SOURCE),binutils-gold) |
| 1766 |
$(install_dir) $(d_nat)/$(PF)/share/doc/$(p_nat) |
| 1767 |
$(install_file) debian/changelog $(d_nat)/$(PF)/share/doc/$(p_nat)/changelog.Debian |
| 1768 |
$(install_file) debian/copyright $(d_nat)/$(PF)/share/doc/$(p_nat)/ |
| 1769 |
$(install_file) gold/ChangeLog $(d_nat)/$(PF)/share/doc/$(p_nat)/changelog |
| 1770 |
else |
| 1771 |
$(install_dir) $(d_nat)/$(PF)/share/doc/ |
| 1772 |
ln -sf $(p_lib) $(d_nat)/$(PF)/share/doc/$(p_nat) |
| 1773 |
endif |
| 1774 |
|
| 1775 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1776 |
$(install_dir) $(d_dev)/$(PF)/share/doc/ |
| 1777 |
ln -sf $(p_bin) $(d_dev)/$(PF)/share/doc/$(p_dev) |
| 1778 |
ifeq ($(with_multiarch),yes) |
| 1779 |
$(install_dir) $(d_mul)/$(PF)/share/doc/ |
| 1780 |
ln -sf $(p_bin) $(d_mul)/$(PF)/share/doc/$(p_mul) |
| 1781 |
$(install_dir) $(d_mdev)/$(PF)/share/doc/ |
| 1782 |
ln -sf $(p_mul) $(d_mdev)/$(PF)/share/doc/$(p_mdev) |
| 1783 |
endif |
| 1784 |
ifeq ($(with_hppa64),yes) |
| 1785 |
$(install_dir) $(d_hppa64)/$(PF)/share/doc/ |
| 1786 |
ln -sf $(p_bin) $(d_hppa64)/$(PF)/share/doc/$(p_hppa64) |
| 1787 |
endif |
| 1788 |
|
| 1789 |
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
| 1790 |
ifeq ($(with_check),yes) |
| 1791 |
: # remove user and date from test-summary for reproducible builds |
| 1792 |
sed -i -e '/Test run by/d' $(pwd)/test-summary |
| 1793 |
$(install_dir) $(d_nat)/$(PF)/share/doc/$(p_bin) |
| 1794 |
$(install_file) test-summary \ |
| 1795 |
$(d_nat)/$(PF)/share/doc/$(p_bin)/test-summary-$(DEB_HOST_ARCH) |
| 1796 |
gzip -9nf \ |
| 1797 |
$(d_nat)/$(PF)/share/doc/$(p_bin)/test-summary-$(DEB_HOST_ARCH) |
| 1798 |
|
| 1799 |
: # save log and sum files in $(p_dev) |
| 1800 |
$(install_dir) $(d_dev)/$(PF)/share/doc/$(p_bin)/tests |
| 1801 |
for i in $$(find builddir-single -name '*.sum'); do \ |
| 1802 |
b=$$(basename $$i .sum); \ |
| 1803 |
$(install_file) $$i $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.sum; \ |
| 1804 |
sed -i -e '/Test run by/d' $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.sum; \ |
| 1805 |
xz -9v $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.sum; \ |
| 1806 |
$(install_file) $${i%.sum}.log $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.log; \ |
| 1807 |
xz -9v $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.log; \ |
| 1808 |
done |
| 1809 |
endif |
| 1810 |
endif |
| 1811 |
$(install_dir) $(d_com)/$(PF)/share/doc/$(p_bin) |
| 1812 |
$(install_file) binutils/NEWS debian/README.cross \ |
| 1813 |
$(d_com)/$(PF)/share/doc/$(p_bin)/ |
| 1814 |
|
| 1815 |
$(install_file) binutils/ChangeLog $(d_com)/$(PF)/share/doc/$(p_bin)/changelog |
| 1816 |
|
| 1817 |
for pkg in bfd gas gprof ld; do \ |
| 1818 |
$(install_dir) $(d_com)/$(PF)/share/doc/$(p_bin)/$$pkg; \ |
| 1819 |
done |
| 1820 |
$(install_file) bfd/ChangeLog bfd/PORTING bfd/TODO \ |
| 1821 |
$(d_com)/$(PF)/share/doc/$(p_bin)/bfd/ |
| 1822 |
$(install_file) gas/ChangeLog gas/NEWS $(d_com)/$(PF)/share/doc/$(p_bin)/gas/ |
| 1823 |
$(install_file) gprof/ChangeLog gprof/TODO gprof/TEST \ |
| 1824 |
$(d_com)/$(PF)/share/doc/$(p_bin)/gprof/ |
| 1825 |
$(install_file) ld/ChangeLog ld/TODO ld/NEWS \ |
| 1826 |
$(d_com)/$(PF)/share/doc/$(p_bin)/ld/ |
| 1827 |
|
| 1828 |
: # These only exist in H. J. Lu releases not GNU ones. |
| 1829 |
for dir in binutils bfd gas gprof ld; do \ |
| 1830 |
if [ -f $$dir/ChangeLog.linux ]; then \ |
| 1831 |
$(install_file) $$dir/ChangeLog.linux $(d_com)/$(PF)/share/doc/$(p_bin)/$$dir/; \ |
| 1832 |
fi; \ |
| 1833 |
done |
| 1834 |
|
| 1835 |
: # Copy bbconv.pl to the doc dir for use by interested people |
| 1836 |
$(install_file) gprof/bbconv.pl $(d_com)/$(PF)/share/doc/$(p_bin)/gprof/. |
| 1837 |
|
| 1838 |
: # Compress stuff that needs it |
| 1839 |
gzip -9n $(d_ctfn)/$(PF)/share/doc/$(p_ctfn)/changelog.Debian |
| 1840 |
|
| 1841 |
gzip -9n $(d_bin)/$(PF)/share/doc/$(p_bin)/changelog.Debian |
| 1842 |
find $(d_com)/$(PF)/share/doc/$(p_bin)/ -type f ! -name bbconv.pl | xargs gzip -9n |
| 1843 |
gzip -9n $(d_com)/$(PF)/share/doc/$(p_com)/changelog.Debian |
| 1844 |
gzip -9n $(d_com)/$(PF)/share/man/man1/*.1 |
| 1845 |
|
| 1846 |
gzip -9n $(d_sfrm)/$(PF)/share/doc/$(p_sfrm)/changelog.Debian |
| 1847 |
endif |
| 1848 |
find $(d_bin)/$(PF)/share/doc/$(p_bin) -maxdepth 1 -type f ! -name copyright | xargs gzip -9n |
| 1849 |
find $(d_nat)/$(PF)/share/doc/$(p_nat) -maxdepth 1 -type f ! -name copyright | xargs gzip -9n |
| 1850 |
|
| 1851 |
: # Finish it all up |
| 1852 |
dpkg-gencontrol -P$(d_bin) -p$(p_bin) \ |
| 1853 |
$(CONFLICTS_TARGET_$(DEB_HOST_ARCH)) $(gold_provides) \ |
| 1854 |
-Vbinutils:native=$(p_nat) |
| 1855 |
cd $(d_bin) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1856 |
|
| 1857 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1858 |
rm -f debian/substvars |
| 1859 |
find $(d_lib) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps |
| 1860 |
dpkg-gencontrol -P$(d_lib) -p$(p_lib) |
| 1861 |
cd $(d_lib) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1862 |
dpkg-gencontrol -P$(d_lib)-dbg -p$(p_lib)-dbg |
| 1863 |
cd $(d_lib)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1864 |
|
| 1865 |
dpkg-gensymbols -P$(d_ctf) -p$(p_ctf) -l$(d_lib) |
| 1866 |
dpkg-gensymbols -P$(d_ctfn) -p$(p_ctfn) |
| 1867 |
ifeq ($(with_gprofng),yes) |
| 1868 |
-dpkg-gensymbols -P$(d_gpng) -p$(p_gpng) -l$(d_lib) |
| 1869 |
endif |
| 1870 |
dpkg-gensymbols -P$(d_sfrm) -p$(p_sfrm) |
| 1871 |
|
| 1872 |
rm -f debian/substvars |
| 1873 |
find $(d_ctf) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps |
| 1874 |
dpkg-gencontrol -P$(d_ctf) -p$(p_ctf) |
| 1875 |
cd $(d_ctf) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1876 |
dpkg-gencontrol -P$(d_ctf)-dbg -p$(p_ctf)-dbg |
| 1877 |
cd $(d_ctf)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1878 |
|
| 1879 |
rm -f debian/substvars |
| 1880 |
find $(d_ctfn) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps |
| 1881 |
dpkg-gencontrol -P$(d_ctfn) -p$(p_ctfn) |
| 1882 |
cd $(d_ctfn) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1883 |
dpkg-gencontrol -P$(d_ctfn)-dbg -p$(p_ctfn)-dbg |
| 1884 |
cd $(d_ctfn)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1885 |
|
| 1886 |
ifeq ($(with_gprofng),yes) |
| 1887 |
rm -f debian/substvars |
| 1888 |
find $(d_gpng) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps |
| 1889 |
dpkg-gencontrol -P$(d_gpng) -p$(p_gpng) |
| 1890 |
cd $(d_gpng) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1891 |
dpkg-gencontrol -P$(d_gpng)-dbg -p$(p_gpng)-dbg |
| 1892 |
cd $(d_gpng)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1893 |
endif |
| 1894 |
|
| 1895 |
rm -f debian/substvars |
| 1896 |
find $(d_sfrm) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps |
| 1897 |
dpkg-gencontrol -P$(d_sfrm) -p$(p_sfrm) |
| 1898 |
cd $(d_sfrm) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1899 |
dpkg-gencontrol -P$(d_sfrm)-dbg -p$(p_sfrm)-dbg |
| 1900 |
cd $(d_sfrm)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1901 |
|
| 1902 |
rm -f debian/substvars |
| 1903 |
mkdir -p $(d_com)/DEBIAN |
| 1904 |
dpkg-gencontrol -P$(d_com) -p$(p_com) |
| 1905 |
cd $(d_com) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1906 |
endif |
| 1907 |
|
| 1908 |
ifeq ($(DEB_SOURCE),binutils-gold) |
| 1909 |
rm -f debian/substvars |
| 1910 |
find $(d_nat) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps |
| 1911 |
dpkg-gencontrol -P$(d_nat) -p$(p_nat) |
| 1912 |
cd $(d_nat) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1913 |
dpkg-gencontrol -P$(d_nat)-dbg -p$(p_nat)-dbg |
| 1914 |
cd $(d_nat)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1915 |
else |
| 1916 |
rm -f debian/substvars |
| 1917 |
find $(d_nat) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps -l$(d_lib)/$(PF)/lib/$(DEB_HOST_MULTIARCH) |
| 1918 |
dpkg-gencontrol -P$(d_nat) -p$(p_nat) -VextraDepends='libbinutils (= $${binary:Version})' |
| 1919 |
cd $(d_nat) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1920 |
dpkg-gencontrol -P$(d_nat)-dbg -p$(p_nat)-dbg -VextraDepends='libbinutils (= $${binary:Version})' |
| 1921 |
cd $(d_nat)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1922 |
endif |
| 1923 |
|
| 1924 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1925 |
rm -f debian/substvars |
| 1926 |
dpkg-gencontrol -P$(d_dev) -p$(p_dev) |
| 1927 |
cd $(d_dev) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1928 |
|
| 1929 |
ifeq ($(with_multiarch),yes) |
| 1930 |
rm -f debian/substvars |
| 1931 |
find $(d_mul) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps |
| 1932 |
dpkg-gencontrol -P$(d_mul) -p$(p_mul) |
| 1933 |
cd $(d_mul) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1934 |
dpkg-gencontrol -P$(d_mul)-dbg -p$(p_mul)-dbg |
| 1935 |
cd $(d_mul)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1936 |
|
| 1937 |
rm -f debian/substvars |
| 1938 |
mkdir -p $(d_mdev)/DEBIAN |
| 1939 |
dpkg-gencontrol -P$(d_mdev) -p$(p_mdev) |
| 1940 |
cd $(d_mdev) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs -r md5sum > DEBIAN/md5sums |
| 1941 |
endif |
| 1942 |
|
| 1943 |
ifeq ($(with_hppa64),yes) |
| 1944 |
rm -f debian/substvars |
| 1945 |
find $(d_hppa64) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps |
| 1946 |
dpkg-gencontrol -P$(d_hppa64) -p$(p_hppa64) |
| 1947 |
cd $(d_hppa64) && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1948 |
dpkg-gencontrol -P$(d_hppa64)-dbg -p$(p_hppa64)-dbg |
| 1949 |
cd $(d_hppa64)-dbg && find -type f ! -regex './DEBIAN/.*' -printf '%P\n' | LC_ALL=C sort | xargs md5sum > DEBIAN/md5sums |
| 1950 |
endif |
| 1951 |
endif |
| 1952 |
|
| 1953 |
ifeq ($(DEB_SOURCE),binutils-gold) |
| 1954 |
$(CHOWN) -R root:root $(d_bin) $(d_nat) $(d_nat)-dbg |
| 1955 |
chmod -R go=rX $(d_bin) $(d_nat) $(d_nat)-dbg |
| 1956 |
else |
| 1957 |
$(CHOWN) -R root:root $(d_bin) $(d_com) $(d_lib) $(d_lib)-dbg $(d_ctf) $(d_ctf)-dbg $(d_ctfn) $(d_ctfn)-dbg $(d_nat) $(d_nat)-dbg $(d_dev) $(d_sfrm) $(d_sfrm)-dbg |
| 1958 |
chmod -R go=rX $(d_bin) $(d_com) $(d_lib) $(d_lib)-dbg $(d_ctf) $(d_ctf)-dbg $(d_ctfn) $(d_ctfn)-dbg $(d_nat) $(d_nat)-dbg $(d_dev) $(d_sfrm) $(d_sfrm)-dbg |
| 1959 |
endif |
| 1960 |
find $(d_bin) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1961 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1962 |
$(DPKG_DEB) --build $(d_bin) .. |
| 1963 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 1964 |
find $(d_com) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1965 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1966 |
$(DPKG_DEB) --build $(d_com) .. |
| 1967 |
find $(d_ctf) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1968 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1969 |
$(DPKG_DEB) --build $(d_ctf) .. |
| 1970 |
find $(d_ctf)-dbg -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1971 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1972 |
$(DPKG_DEB) --build $(d_ctf)-dbg .. |
| 1973 |
find $(d_ctfn) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1974 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1975 |
$(DPKG_DEB) --build $(d_ctfn) .. |
| 1976 |
find $(d_ctfn)-dbg -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1977 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1978 |
$(DPKG_DEB) --build $(d_ctfn)-dbg .. |
| 1979 |
ifeq ($(with_gprofng),yes) |
| 1980 |
$(CHOWN) -R root:root $(d_gpng) $(d_gpng)-dbg |
| 1981 |
chmod -R go=rX $(d_gpng) $(d_gpng)-dbg |
| 1982 |
find $(d_gpng) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1983 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1984 |
$(DPKG_DEB) --build $(d_gpng) .. |
| 1985 |
find $(d_gpng)-dbg -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1986 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1987 |
$(DPKG_DEB) --build $(d_gpng)-dbg .. |
| 1988 |
endif |
| 1989 |
find $(d_sfrm) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1990 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1991 |
$(DPKG_DEB) --build $(d_sfrm) .. |
| 1992 |
find $(d_sfrm)-dbg -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1993 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1994 |
$(DPKG_DEB) --build $(d_sfrm)-dbg .. |
| 1995 |
find $(d_lib) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1996 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 1997 |
$(DPKG_DEB) --build $(d_lib) .. |
| 1998 |
find $(d_lib)-dbg -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 1999 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 2000 |
$(DPKG_DEB) --build $(d_lib)-dbg .. |
| 2001 |
endif |
| 2002 |
find $(d_nat) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 2003 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 2004 |
$(DPKG_DEB) --build $(d_nat) .. |
| 2005 |
find $(d_nat)-dbg -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 2006 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 2007 |
$(DPKG_DEB) --build $(d_nat)-dbg .. |
| 2008 |
ifneq ($(DEB_SOURCE),binutils-gold) |
| 2009 |
find $(d_dev) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 2010 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 2011 |
$(DPKG_DEB) --build $(d_dev) .. |
| 2012 |
ifeq ($(with_multiarch),yes) |
| 2013 |
$(CHOWN) -R root:root $(d_mul) $(d_mul)-dbg |
| 2014 |
chmod -R go=rX $(d_mul) $(d_mul)-dbg |
| 2015 |
find $(d_mul) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 2016 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 2017 |
$(DPKG_DEB) --build $(d_mul) .. |
| 2018 |
find $(d_mul)-dbg -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 2019 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 2020 |
$(DPKG_DEB) --build $(d_mul)-dbg .. |
| 2021 |
|
| 2022 |
$(CHOWN) -R root:root $(d_mdev) |
| 2023 |
chmod -R go=rX $(d_mdev) |
| 2024 |
find $(d_mdev) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 2025 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 2026 |
$(DPKG_DEB) --build $(d_mdev) .. |
| 2027 |
endif |
| 2028 |
ifeq ($(with_hppa64),yes) |
| 2029 |
$(CHOWN) -R root:root $(d_hppa64)-dbg |
| 2030 |
chmod -R go=rX $(d_hppa64) $(d_hppa64)-dbg |
| 2031 |
find $(d_hppa64) -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 2032 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 2033 |
$(DPKG_DEB) --build $(d_hppa64) .. |
| 2034 |
find $(d_hppa64)-dbg -depth -newermt '$(BUILD_DATE)' -print0 | \ |
| 2035 |
xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 2036 |
$(DPKG_DEB) --build $(d_hppa64)-dbg .. |
| 2037 |
endif |
| 2038 |
endif |
| 2039 |
@echo '==================== Build finished ====================' |
| 2040 |
ps aux |
| 2041 |
|
| 2042 |
endif |
| 2043 |
endif |
| 2044 |
|
| 2045 |
|
| 2046 |
|
| 2047 |
define checkdir |
| 2048 |
test -f bfd/elf32.c -a -f debian/rules |
| 2049 |
endef |
| 2050 |
|
| 2051 |
|
| 2052 |
|
| 2053 |
|
| 2054 |
|
| 2055 |
ifeq ($(with_strip),yes) |
| 2056 |
|
| 2057 |
define strip_package |
| 2058 |
$(install_dir) $(strip $2)-dbg/usr/share/doc/ |
| 2059 |
ln -sf $(strip $1) $(strip $2)-dbg/usr/share/doc/$(strip $1)-dbg |
| 2060 |
: # Strip shared libraries and binaries |
| 2061 |
set -e; \ |
| 2062 |
nfiles=0; \ |
| 2063 |
for i in \ |
| 2064 |
$(strip $2)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libbfd-*so \ |
| 2065 |
$(strip $2)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libopcodes-*so \ |
| 2066 |
$(strip $2)/$(PF)/lib/*/bfd-plugins/libdep.so \ |
| 2067 |
$(strip $2)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libctf*.so.0.0.0 \ |
| 2068 |
$(strip $2)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libgprofng.so.0.0.0 \ |
| 2069 |
$(strip $2)/$(PF)/lib/*/gprofng/libgp-*.so \ |
| 2070 |
$(strip $2)/$(PF)/lib/*/libgprofng.so.0.0 \ |
| 2071 |
$(strip $2)/$(PF)/lib/*/libsframe.so.1.0.0 \ |
| 2072 |
$$(file $(strip $2)/$(PF)/bin/* |awk -F: '$$0 !~ /script/ {print $$1}'); \ |
| 2073 |
do \ |
| 2074 |
test ! -h $$i || continue; test -f $$i || continue; \ |
| 2075 |
files="$$files $$i"; \ |
| 2076 |
nfiles=$$(expr $$nfiles + 1); \ |
| 2077 |
done; \ |
| 2078 |
echo "Strip ($$nfiles): $$files"; \ |
| 2079 |
for i in $$files; do \ |
| 2080 |
id=$$(debugedit --build-id --build-id-seed='$(strip $1)-$(DEB_VERSION)' $$i); \ |
| 2081 |
done; \ |
| 2082 |
mkdir -p $(strip $2)-dbg/usr/lib/debug/.dwz/$(DEB_HOST_MULTIARCH); \ |
| 2083 |
dwz=usr/lib/debug/.dwz/$(DEB_HOST_MULTIARCH)/$(strip $1).debug; \ |
| 2084 |
if [ $$nfiles -eq 0 ]; then \ |
| 2085 |
: ; \ |
| 2086 |
elif [ $$nfiles -gt 1 ]; then \ |
| 2087 |
dwz -m $(strip $2)-dbg/$$dwz -M /$$dwz $$files; \ |
| 2088 |
$(CROSS)objcopy --compress-debug-sections $(strip $2)-dbg/$$dwz; \ |
| 2089 |
else \ |
| 2090 |
dwz $$files; \ |
| 2091 |
fi; \ |
| 2092 |
for i in $$files; do \ |
| 2093 |
b_id=$$(LC_ALL=C $(CROSS)readelf -n $$i | sed -n 's/ *Build ID: *\([0-9a-f][0-9a-f]*\)/\1/p'); \ |
| 2094 |
if [ -z "$$b_id" ]; then \ |
| 2095 |
id=$$(echo $$i | sed -r 's,debian/[^/]+,$2-dbg/usr/lib/debug,'); \ |
| 2096 |
echo strip $$i; \ |
| 2097 |
mkdir -p $$(dirname $$id); \ |
| 2098 |
$(CROSS)objcopy --only-keep-debug $$i $$id; \ |
| 2099 |
chmod 644 $$id; \ |
| 2100 |
$(STRIP) $$i; \ |
| 2101 |
$(CROSS)objcopy --add-gnu-debuglink $$id $$i; \ |
| 2102 |
else \ |
| 2103 |
echo "ID: $${b_id} -> $$(echo $$i | sed 's,$(strip $2),,')"; \ |
| 2104 |
d=usr/lib/debug/.build-id/$${b_id:0:2}; \ |
| 2105 |
f=$${b_id:2}.debug; \ |
| 2106 |
mkdir -p $(strip $2)-dbg/$$d; \ |
| 2107 |
$(CROSS)objcopy --only-keep-debug --compress-debug-sections $$i $(strip $2)-dbg/$$d/$$f; \ |
| 2108 |
chmod 644 $(strip $2)-dbg/$$d/$$f; \ |
| 2109 |
$(STRIP) $$i; \ |
| 2110 |
fi; \ |
| 2111 |
done |
| 2112 |
endef |
| 2113 |
else |
| 2114 |
define strip_package |
| 2115 |
$(install_dir) $(strip $2)-dbg/usr/share/doc/ |
| 2116 |
ln -sf $(strip $1) $(strip $2)-dbg/usr/share/doc/$(strip $1)-dbg |
| 2117 |
endef |
| 2118 |
endif |
| 2119 |
|
| 2120 |
remove-gfdl-files: |
| 2121 |
rm -rf .git* .cvs* gdb* libbacktrace libdecnumber readline sim |
| 2122 |
ifeq ($(GFDL_INVARIANT_FREE),yes) |
| 2123 |
for i in $(gfdl_toplevel_texinfo_files); do \ |
| 2124 |
if [ -f $$i ]; then \ |
| 2125 |
sed "s/@name@/$$(basename $$i)/g" debian/gfdl.texi > $$i; \ |
| 2126 |
fi; \ |
| 2127 |
done |
| 2128 |
rm -f $(gfdl_generated_files) |
| 2129 |
rm -f zlib/contrib/dotzlib/DotZLib.chm |
| 2130 |
endif |
| 2131 |
|
| 2132 |
|
| 2133 |
|
| 2134 |
binary: binary-indep binary-arch |
| 2135 |
|
| 2136 |
checkroot: |
| 2137 |
$(checkdir) |
| 2138 |
ifeq ($(require_root),yes) |
| 2139 |
test root = "`whoami`" |
| 2140 |
endif |
| 2141 |
|
| 2142 |
.PHONY: binary binary-arch binary-indep clean checkroot |
| 2143 |
|
| 2144 |
.PRECIOUS: stamps/configure.% stamps/build.% stamps/install.% |