new package shairport-sync
[openadk.git] / rules.mk
blob758a2c163a58b8e8066fe27e9dd2ac1b2899e63c
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_ROOTDEV:= $(strip $(subst ",, $(ADK_TARGET_ROOTDEV)))
81 ADK_TARGET_KARCH:=$(ADK_TARGET_ARCH)
83 # translate toolchain arch to kernel arch
84 ifeq ($(ADK_TARGET_ARCH),aarch64)
85 ADK_TARGET_KARCH:=arm64
86 endif
87 ifeq ($(ADK_TARGET_ARCH),bfin)
88 ADK_TARGET_KARCH:=blackfin
89 endif
90 ifeq ($(ADK_TARGET_ARCH),or1k)
91 ADK_TARGET_KARCH:=openrisc
92 endif
93 ifeq ($(ADK_TARGET_ARCH),ppc)
94 ADK_TARGET_KARCH:=powerpc
95 endif
96 ifeq ($(ADK_TARGET_ARCH),ppc64)
97 ADK_TARGET_KARCH:=powerpc
98 endif
99 ifeq ($(ADK_TARGET_ARCH),mips64)
100 ADK_TARGET_KARCH:=mips
101 endif
102 ifeq ($(ADK_TARGET_ARCH),hppa)
103 ADK_TARGET_KARCH:=parisc
104 endif
105 ifeq ($(ADK_TARGET_ARCH),riscv32)
106 ADK_TARGET_KARCH:=riscv
107 endif
108 ifeq ($(ADK_TARGET_ARCH),riscv64)
109 ADK_TARGET_KARCH:=riscv
110 endif
112 include $(ADK_TOPDIR)/mk/vars.mk
114 ifneq (${show},)
115 .DEFAULT_GOAL:= show
116 show:
117 @$(info ${${show}})
118 else ifneq (${dump},)
119 __shquote= '$(subst ','\'',$(1))'
120 __dumpvar= echo $(call __shquote,$(1)=$(call __shquote,${$(1)}))
121 .DEFAULT_GOAL:= show
122 show:
123 @$(foreach _s,${dump},$(call __dumpvar,${_s});)
124 endif