variable name cleanup
[openadk.git] / rules.mk
blob12ba160f22c995703c2fa1e127d6a433fca2b072
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 $(TOPDIR)/prereq.mk
5 -include $(TOPDIR)/.config
7 ifeq ($(VERBOSE),1)
8 START_TRACE:= :
9 END_TRACE:= :
10 TRACE:= :
11 CMD_TRACE:= :
12 PKG_TRACE:= :
13 MAKE_TRACE:=
14 EXTRA_MAKEFLAGS:=
15 SET_DASHX:= set -x
16 else
17 START_TRACE:= echo -n "---> "
18 END_TRACE:= echo
19 TRACE:= echo "---> "
20 CMD_TRACE:= echo -n
21 PKG_TRACE:= echo "------> "
22 EXTRA_MAKEFLAGS:= -s
23 MAKE_TRACE:= >/dev/null 2>&1 || { echo "Build failed. Please re-run make with v to see what's going on"; false; }
24 SET_DASHX:= :
25 endif
27 # Strip off the annoying quoting
28 ADK_TARGET_ARCH:= $(strip $(subst ",, $(ADK_TARGET_ARCH)))
29 ADK_TARGET_SYSTEM:= $(strip $(subst ",, $(ADK_TARGET_SYSTEM)))
30 ADK_TARGET_LIBC:= $(strip $(subst ",, $(ADK_TARGET_LIBC)))
31 ADK_TARGET_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS)))
32 ADK_TARGET_IP:= $(strip $(subst ",, $(ADK_TARGET_IP)))
33 ADK_TARGET_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_SUFFIX)))
34 ADK_TARGET_CMDLINE:= $(strip $(subst ",, $(ADK_TARGET_CMDLINE)))
35 ADK_RUNTIME_TMPFS_SIZE:= $(strip $(subst ",, $(ADK_RUNTIME_TMPFS_SIZE)))
36 ADK_RUNTIME_CONSOLE_SERIAL_SPEED:= $(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)))
37 ADK_HOST:= $(strip $(subst ",, $(ADK_HOST)))
38 ADK_VENDOR:= $(strip $(subst ",, $(ADK_VENDOR)))
40 ifeq ($(strip ${ADK_HAVE_DOT_CONFIG}),y)
41 ifneq ($(strip $(wildcard $(TOPDIR)/target/$(ADK_TARGET_ARCH)/target.mk)),)
42 include $(TOPDIR)/target/$(ADK_TARGET_ARCH)/target.mk
43 endif
44 endif
46 include $(TOPDIR)/mk/vars.mk
48 export BASH HOSTCC HOSTCXX MAKE LANGUAGE LC_ALL OStype PATH
50 HOSTCFLAGS?= -O2
51 HOSTCXXFLAGS?= -O2
52 HOSTCPPFLAGS?=
53 HOSTLDFLAGS?=
54 TARGET_CFLAGS:= $(strip ${TARGET_CFLAGS} -fno-ident -fhonour-copts)
55 TARGET_CC:= $(strip ${TARGET_CC})
56 TARGET_CXX:= $(strip ${TARGET_CXX})
58 ifneq (${show},)
59 .DEFAULT_GOAL:= show
60 show:
61 @$(info ${${show}})
62 else ifneq (${dump},)
63 __shquote= '$(subst ','\'',$(1))'
64 __dumpvar= echo $(call __shquote,$(1)=$(call __shquote,${$(1)}))
65 .DEFAULT_GOAL:= show
66 show:
67 @$(foreach _s,${dump},$(call __dumpvar,${_s});)
68 endif