binutils: update to 2.43.1
[openadk.git] / rules.mk
blob234f5e345dccf1eca4caddf16f9d5ef4a316948d
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR)/prereq.mk
5 -include $(ADK_TOPDIR)/.config
7 ifeq ($(ADK_VERBOSE),1)
8 START_TRACE:= :
9 END_TRACE:= :
10 TRACE:= :
11 CMD_TRACE:= :
12 PKG_TRACE:= :
13 MAKE_TRACE:=
14 DL_TRACE:=
15 EXTRA_MAKEFLAGS:=
16 SET_DASHX:= set -x
17 else
18 START_TRACE:= echo -n " ---> "
19 END_TRACE:= echo
20 TRACE:= echo " ---> "
21 CMD_TRACE:= echo -n
22 PKG_TRACE:= echo "------> "
23 EXTRA_MAKEFLAGS:= -s
24 MAKE_TRACE:= >/dev/null 2>&1 || { echo "Build failed. Please re-run make with v to see what's going on"; false; }
25 DL_TRACE:= >/dev/null 2>&1
26 SET_DASHX:= :
27 endif
29 # Strip off the annoying quoting
30 ADK_TARGET_OS:= $(strip $(subst ",, $(ADK_TARGET_OS)))
31 ADK_TARGET_ARCH:= $(strip $(subst ",, $(ADK_TARGET_ARCH)))
32 ADK_TARGET_SYSTEM:= $(strip $(subst ",, $(ADK_TARGET_SYSTEM)))
33 ADK_TARGET_BOARD:= $(strip $(subst ",, $(ADK_TARGET_BOARD)))
34 ADK_TARGET_CPU_ARCH:= $(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
35 ADK_TARGET_CPU_TYPE:= $(strip $(subst ",, $(ADK_TARGET_CPU_TYPE)))
36 ADK_TARGET_KERNEL:= $(strip $(subst ",, $(ADK_TARGET_KERNEL)))
37 ADK_TARGET_LIBC:= $(strip $(subst ",, $(ADK_TARGET_LIBC)))
38 ADK_TARGET_LIBC_PATH:= $(strip $(subst ",, $(ADK_TARGET_LIBC_PATH)))
39 ADK_TARGET_LIBC_ABI_PATH:= $(strip $(subst ",, $(ADK_TARGET_LIBC_ABI_PATH)))
40 ADK_TARGET_ENDIAN:= $(strip $(subst ",, $(ADK_TARGET_ENDIAN)))
41 ADK_TARGET_ENDIAN_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_ENDIAN_SUFFIX)))
42 ADK_TARGET_GCC_CPU:= $(strip $(subst ",, $(ADK_TARGET_GCC_CPU)))
43 ADK_TARGET_GCC_ARCH:= $(strip $(subst ",, $(ADK_TARGET_GCC_ARCH)))
44 ADK_TARGET_BINFMT:= $(strip $(subst ",, $(ADK_TARGET_BINFMT)))
45 ADK_TARGET_FLOAT:= $(strip $(subst ",, $(ADK_TARGET_FLOAT)))
46 ADK_TARGET_FPU:= $(strip $(subst ",, $(ADK_TARGET_FPU)))
47 ADK_TARGET_INSTRUCTION_SET:= $(strip $(subst ",, $(ADK_TARGET_INSTRUCTION_SET)))
48 ADK_TARGET_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS)))
49 ADK_TARGET_CPU_FLAGS:= $(strip $(subst ",, $(ADK_TARGET_CPU_FLAGS)))
50 ADK_TARGET_CFLAGS_OPT:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS_OPT)))
51 ADK_TARGET_ABI_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_CFLAGS)))
52 ADK_TARGET_ABI:= $(strip $(subst ",, $(ADK_TARGET_ABI)))
53 ADK_TARGET_ABI_MIPS64:= $(strip $(subst ",, $(ADK_TARGET_ABI_MIPS64)))
54 ADK_TARGET_ABI_RISCV:= $(strip $(subst ",, $(ADK_TARGET_ABI_RISCV)))
55 ADK_TARGET_IP:= $(strip $(subst ",, $(ADK_TARGET_IP)))
56 ADK_TARGET_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_SUFFIX)))
57 ADK_TARGET_CMDLINE:= $(strip $(subst ",, $(ADK_TARGET_CMDLINE)))
58 ADK_TOOLCHAIN_LLVM_VERSION:= $(strip $(subst ",, $(ADK_TOOLCHAIN_LLVM_VERSION)))
59 ADK_QEMU_ARGS:= $(strip $(subst ",, $(ADK_QEMU_ARGS)))
60 ADK_RUNTIME_TMPFS_SIZE:= $(strip $(subst ",, $(ADK_RUNTIME_TMPFS_SIZE)))
61 ADK_RUNTIME_CONSOLE_SERIAL_SPEED:= $(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)))
62 ADK_RUNTIME_CONSOLE_SERIAL_DEVICE:= $(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE)))
63 ADK_RUNTIME_CONSOLE_VGA_DEVICE:= $(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_VGA_DEVICE)))
64 ADK_RUNTIME_DEFAULT_LOCALE:= $(strip $(subst ",, $(ADK_RUNTIME_DEFAULT_LOCALE)))
65 ADK_HOST:= $(strip $(subst ",, $(ADK_HOST)))
66 ADK_VENDOR:= $(strip $(subst ",, $(ADK_VENDOR)))
67 ADK_DL_DIR:= $(strip $(subst ",, $(ADK_DL_DIR)))
68 ADK_COMPRESSION_TOOL:= $(strip $(subst ",, $(ADK_COMPRESSION_TOOL)))
69 ADK_LIBC_VERSION:= $(strip $(subst ",, $(ADK_LIBC_VERSION)))
70 ADK_PARAMETER_NETCONSOLE_SRC_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE_SRC_IP)))
71 ADK_PARAMETER_NETCONSOLE_DST_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE_DST_IP)))
72 ADK_JFFS2_OPTS:= $(strip $(subst ",, $(ADK_JFFS2_OPTS)))
73 ADK_TARGET_LINUX_KERNEL_VERSION:= $(strip $(subst ",, $(ADK_TARGET_LINUX_KERNEL_VERSION)))
74 ADK_TARGET_LINUX_KERNEL_GIT:= $(strip $(subst ",, $(ADK_TARGET_LINUX_KERNEL_GIT)))
75 ADK_TARGET_LINUX_KERNEL_GIT_VER:= $(strip $(subst ",, $(ADK_TARGET_LINUX_KERNEL_GIT_VER)))
76 ADK_TARGET_LINUX_KERNEL_GIT_TYPE:= $(strip $(subst ",, $(ADK_TARGET_LINUX_KERNEL_GIT_TYPE)))
77 ADK_TARGET_LINUX_KERNEL_DEFCONFIG:= $(strip $(subst ",, $(ADK_TARGET_LINUX_KERNEL_DEFCONFIG)))
78 ADK_TARGET_GENIMAGE_FILENAME:= $(strip $(subst ",, $(ADK_TARGET_GENIMAGE_FILENAME)))
79 ADK_TARGET_EXTLINUX_FILENAME:= $(strip $(subst ",, $(ADK_TARGET_EXTLINUX_FILENAME)))
80 ADK_TARGET_ROOTDEV:= $(strip $(subst ",, $(ADK_TARGET_ROOTDEV)))
82 ADK_TARGET_KARCH:=$(ADK_TARGET_ARCH)
84 # translate toolchain arch to kernel arch
85 ifeq ($(ADK_TARGET_ARCH),aarch64)
86 ADK_TARGET_KARCH:=arm64
87 endif
88 ifeq ($(ADK_TARGET_ARCH),bfin)
89 ADK_TARGET_KARCH:=blackfin
90 endif
91 ifeq ($(ADK_TARGET_ARCH),or1k)
92 ADK_TARGET_KARCH:=openrisc
93 endif
94 ifeq ($(ADK_TARGET_ARCH),ppc)
95 ADK_TARGET_KARCH:=powerpc
96 endif
97 ifeq ($(ADK_TARGET_ARCH),ppc64)
98 ADK_TARGET_KARCH:=powerpc
99 endif
100 ifeq ($(ADK_TARGET_ARCH),mips64)
101 ADK_TARGET_KARCH:=mips
102 endif
103 ifeq ($(ADK_TARGET_ARCH),hppa)
104 ADK_TARGET_KARCH:=parisc
105 endif
106 ifeq ($(ADK_TARGET_ARCH),riscv32)
107 ADK_TARGET_KARCH:=riscv
108 endif
109 ifeq ($(ADK_TARGET_ARCH),riscv64)
110 ADK_TARGET_KARCH:=riscv
111 endif
113 include $(ADK_TOPDIR)/mk/vars.mk
115 ifneq (${show},)
116 .DEFAULT_GOAL:= show
117 show:
118 @$(info ${${show}})
119 else ifneq (${dump},)
120 __shquote= '$(subst ','\'',$(1))'
121 __dumpvar= echo $(call __shquote,$(1)=$(call __shquote,${$(1)}))
122 .DEFAULT_GOAL:= show
123 show:
124 @$(foreach _s,${dump},$(call __dumpvar,${_s});)
125 endif