2 # Default build settings. Included in project makefile
\r
4 # This makefile also helps to build the examples. It tries to figure out if
\r
5 # it is an in-tree-build or if it is a seperate project (it's then invoked
\r
6 # from the top makefile)
\r
10 $(error PROJECTNAME is not set. . This makefile is invoked the wrong way))
\r
14 $(error ROOTDIR is not set. This makefile is invoked the wrong way)
\r
17 ifneq (${MAKELEVEL},0)
\r
19 #####################################################################
\r
21 #####################################################################
\r
24 inc-y += $(ROOTDIR)/system/kernel/$(objdir)
\r
25 inc-y += $(ROOTDIR)/system/kernel/include
\r
27 # The more precise configuration, the higher preceedance.
\r
28 VPATH := ../config/$(BOARDDIR) ../config $(VPATH)
\r
29 inc-y := ../config/$(BOARDDIR) ../config $(inc-y)
\r
31 ldcmdfile-y = linkscript_$(COMPILER).lcf
\r
32 vpath %.ldf $(ROOTDIR)/$(ARCH_PATH-y)/scripts
\r
34 # What I want to build
\r
35 build-exe-y = $(PROJECTNAME).elf
\r
40 #####################################################################
\r
41 # In-tree-build (for examples)
\r
42 #####################################################################
\r
45 ifneq ($(BOARDDIR),)
\r
46 $(warning BOARDDIR defined in an in-tree-build)
\r
49 # Try to get name of board
\r
50 boardpath=$(realpath $(CURDIR)/../..)
\r
51 boarddir=$(subst $(realpath $(ROOTDIR)/boards)/,,$(boardpath))
\r
53 # Redirect to normal build
\r
56 @echo "==========[ Building \"$(example)\" ]=========="
\r
57 $(Q)$(MAKE) -C $(ROOTDIR) BOARDDIR=$(boarddir) BDIR=$(CURDIR) all
\r
60 @echo Cleaning dir $(boarddir)
\r
61 $(Q)rm -rf obj_$(boarddir)
\r