7ba0a9cfe025b10ffdee0c12bb8bf69bbb95c4f2
[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 ifneq ($(FAKEROOT),)
13 FAKEROOT_INSTALL        := fakeroot -s $(MATRIX_WORKDIR)/meta/fakedb
14 endif
15
16 __MATRIX_BUILD_STYLE_FILE := $(MATRIX_SCRIPTDIR)/styles/$(MATRIX_BUILD_STYLE).mk
17 __MATRIX_BUILD_STYLES = $(patsubst %.mk,%,$(notdir $(wildcard $(MATRIX_SCRIPTDIR)/styles/*.mk)))
18
19 -include $(__MATRIX_BUILD_STYLE_FILE)
20
21 $(__MATRIX_BUILD_STYLE_FILE):
22         @ echo >&2 "MATRIX_BUILD_STYLE not set"
23         @ echo >&2 "Valid values are: $(__MATRIX_BUILD_STYLES)"
24         @ false
25
26 ifeq ("$(MATRIX_COMPILER_OPTIONS)","")
27
28 ifneq ("$(MATRIX_GCC_OPTIONS)","")
29 MATRIX_COMPILER_OPTIONS = $(MATRIX_GCC_OPTIONS)
30 endif
31
32 ifneq ("$(MATRIX_GCC_MCPU)","")
33 MATRIX_COMPILER_OPTIONS += -mcpu=$(MATRIX_GCC_MCPU)
34 endif
35
36 ifneq ("$(MATRIX_GCC_MFPU)","")
37 MATRIX_COMPILER_OPTIONS += -mfpu=$(MATRIX_GCC_MFPU)
38 endif
39
40 endif
41
42 ifneq ("$(MATRIX_COMPILER_EXTRA_OPTIONS)","")
43 MATRIX_COMPILER_OPTIONS += $(MATRIX_COMPILER_EXTRA_OPTIONS)
44 endif
45
46 SBOX_EXTRA_CROSS_COMPILER_ARGS = -march=$(MATRIX_GCC_MARCH)
47
48 ifneq ("$(MATRIX_COMPILER_OPTIONS)","")
49 SBOX_EXTRA_CROSS_COMPILER_ARGS += $(MATRIX_COMPILER_OPTIONS)
50 endif
51
52 export SBOX_EXTRA_CROSS_COMPILER_ARGS