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