]> rtime.felk.cvut.cz Git - arc.git/blob - scripts/project_defaults.mk
Fee, changed type on for flag used to force garbage collection. Aborting job if memif...
[arc.git] / scripts / project_defaults.mk
1 #\r
2 # Default build settings. Included in project makefile\r
3 #\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
7 #\r
8 \r
9 ifndef PROJECTNAME\r
10 $(error PROJECTNAME is not set. . This makefile is invoked the wrong way))\r
11 endif\r
12 \r
13 ifndef ROOTDIR\r
14 $(error ROOTDIR is not set. This makefile is invoked the wrong way)\r
15 endif\r
16 \r
17 ifneq (${MAKELEVEL},0)\r
18 \r
19 #####################################################################\r
20 # Default settings\r
21 #####################################################################\r
22 \r
23         VPATH += ..\r
24         inc-y += $(ROOTDIR)/system/kernel/$(objdir)\r
25         inc-y += $(ROOTDIR)/system/kernel/include\r
26         \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
30 \r
31         ldcmdfile-y = linkscript_$(COMPILER).lcf\r
32         vpath %.ldf $(ROOTDIR)/$(ARCH_PATH-y)/scripts\r
33 \r
34         # What I want to build\r
35         build-exe-y = $(PROJECTNAME).elf\r
36 \r
37 \r
38 else\r
39 \r
40 #####################################################################\r
41 # In-tree-build (for examples)\r
42 #####################################################################\r
43 \r
44     ifneq ($(BOARDDIR),)\r
45     $(warning BOARDDIR defined in an in-tree-build)\r
46     endif\r
47 \r
48         BUILD_IN_TREE=y\r
49 \r
50 \r
51         # Try to get name of board\r
52         ifeq ($(boarddir),)\r
53       boardpath=$(realpath $(CURDIR)/../..)\r
54       boarddir=$(subst $(realpath $(ROOTDIR)/boards)/,,$(boardpath))\r
55     endif\r
56 \r
57         # Redirect to normal build\r
58 .PHONY: all clean\r
59 all:\r
60         @echo "==========[ Building \"$(example)\" ]=========="\r
61         $(Q)$(MAKE) -C $(ROOTDIR) BOARDDIR=$(boarddir) BDIR=$(CURDIR) all\r
62         \r
63 clean:  \r
64         @echo Cleaning dir $(boarddir) \r
65         $(Q)rm -rf obj_$(boarddir)\r
66         @echo done!\r
67 \r
68 endif\r
69 \r