File: architecture.mk

package info (click to toggle)
rustc 1.48.0+dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, experimental, sid
  • size: 275,960 kB
  • sloc: xml: 147,652; ansic: 16,929; sh: 16,839; javascript: 6,817; python: 6,021; cpp: 4,663; makefile: 3,284; asm: 1,437; ruby: 68; awk: 12
file content (18 lines) | stat: -rw-r--r-- 684 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# This Makefile snippet defines DEB_*_RUST_TYPE triples based on DEB_*_GNU_TYPE

include /usr/share/dpkg/architecture.mk

rust_cpu = $(subst i586,i686,\
$(if $(findstring -riscv64-,-$(2)-),$(subst riscv64,riscv64gc,$(1)),\
$(if $(findstring -armhf-,-$(2)-),$(subst arm,armv7,$(1)),\
$(if $(findstring -armel-,-$(2)-),$(subst arm,armv5te,$(1)),\
$(1)))))
rust_type_setvar = $(1)_RUST_TYPE ?= $(call rust_cpu,$($(1)_GNU_CPU),$($(1)_ARCH))-unknown-$($(1)_GNU_SYSTEM)

$(foreach machine,BUILD HOST TARGET,\
  $(eval $(call rust_type_setvar,DEB_$(machine))))

# fallback for older dpkg versions
ifeq ($(DEB_TARGET_RUST_TYPE),-unknown-)
  DEB_TARGET_RUST_TYPE = $(DEB_HOST_RUST_TYPE)
endif