Merge branch 'master' of git+ssh://openadk.org/git/openadk
[openadk.git] / rules.mk
blob40d98186b0d246d227632461fdf46e6b1cb6be60
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 HOSTCFLAGS MAKE LANGUAGE LC_ALL OStype PATH
50 HOSTCPPFLAGS?=
51 HOSTLDFLAGS?=
52 TARGET_CFLAGS:= $(strip -fno-ident ${TARGET_CFLAGS})
53 TARGET_CC:= $(strip ${TARGET_CC})
54 TARGET_CXX:= $(strip ${TARGET_CXX})
56 ifneq (${show},)
57 .DEFAULT_GOAL:= show
58 show:
59 @$(info ${${show}})
60 else ifneq (${dump},)
61 __shquote= '$(subst ','\'',$(1))'
62 __dumpvar= echo $(call __shquote,$(1)=$(call __shquote,${$(1)}))
63 .DEFAULT_GOAL:= show
64 show:
65 @$(foreach _s,${dump},$(call __dumpvar,${_s});)
66 endif