c37b60131f31b14615e684dd38bb96d10b517363
[matrix.git] / scripts / matrix.mk
1 # Copyright (C) 2006-2008 Movial Oy
2 # Authors: Lauri Leukkunen
3 #          Kalle Vahlman <kalle.vahlman@movial.fi>
4 #          Tuomas Kulve <tuomas.kulve@movial.fi>
5 #          Timo Savola <tsavola@movial.fi>
6
7 #CCTOOL_INSTALL=sb2 -e
8 #CCTOOL_BUILD=sb2
9
10 include meta/plug
11
12 __MATRIX_BUILD_STYLE_FILE := $(MATRIX_SCRIPTDIR)/styles/$(MATRIX_BUILD_STYLE).mk
13 __MATRIX_BUILD_STYLES = $(patsubst %.mk,%,$(notdir $(wildcard $(MATRIX_SCRIPTDIR)/styles/*.mk)))
14
15 -include $(__MATRIX_BUILD_STYLE_FILE)
16
17 $(__MATRIX_BUILD_STYLE_FILE):
18         @ echo >&2 "MATRIX_BUILD_STYLE not set"
19         @ echo >&2 "Valid values are: $(__MATRIX_BUILD_STYLES)"
20         @ false
21
22 ifeq ("$(MATRIX_COMPILER_OPTIONS)","")
23
24 ifneq ("$(MATRIX_GCC_OPTIONS)","")
25 MATRIX_COMPILER_OPTIONS = $(MATRIX_GCC_OPTIONS)
26 endif
27
28 ifneq ("$(MATRIX_GCC_MCPU)","")
29 MATRIX_COMPILER_OPTIONS += -mcpu=$(MATRIX_GCC_MCPU)
30 endif
31
32 ifneq ("$(MATRIX_GCC_MFPU)","")
33 MATRIX_COMPILER_OPTIONS += -mfpu=$(MATRIX_GCC_MFPU)
34 endif
35
36 endif
37
38 ifneq ("$(MATRIX_COMPILER_EXTRA_OPTIONS)","")
39 MATRIX_COMPILER_OPTIONS += $(MATRIX_COMPILER_EXTRA_OPTIONS)
40 endif
41
42 SBOX_EXTRA_CROSS_COMPILER_ARGS = -march=$(MATRIX_GCC_MARCH)
43
44 ifneq ("$(MATRIX_COMPILER_OPTIONS)","")
45 SBOX_EXTRA_CROSS_COMPILER_ARGS += $(MATRIX_COMPILER_OPTIONS)
46 endif
47
48 export SBOX_EXTRA_CROSS_COMPILER_ARGS