generate list of valid build styles automatically
authorTimo Savola <tsavola@movial.fi>
Thu, 10 Apr 2008 20:13:57 +0000 (23:13 +0300)
committerTimo Savola <tsavola@movial.fi>
Thu, 10 Apr 2008 20:13:57 +0000 (23:13 +0300)
scripts/matrix.mak

index 2a3569612780099eeb6f070b0dabf2438280bbf5..a8a210742033e34847ff6910055be8bc72449780 100644 (file)
@@ -2,12 +2,23 @@
 # Authors: Lauri Leukkunen
 #          Kalle Vahlman <kalle.vahlman@movial.fi>
 #          Tuomas Kulve <tuomas.kulve@movial.fi>
+#          Timo Savola <tsavola@movial.fi>
 
 #CCTOOL_INSTALL=sb2 -e
 #CCTOOL_BUILD=sb2
 
 include meta/plug
 
+__MATRIX_BUILD_STYLE_FILE := $(MATRIX_SCRIPTDIR)/matrix-$(MATRIX_BUILD_STYLE).mak
+__MATRIX_BUILD_STYLES = $(patsubst $(MATRIX_SCRIPTDIR)/matrix-%.mak,%,$(wildcard $(MATRIX_SCRIPTDIR)/matrix-*.mak))
+
+-include $(__MATRIX_BUILD_STYLE_FILE)
+
+$(__MATRIX_BUILD_STYLE_FILE):
+       @ echo >&2 "MATRIX_BUILD_STYLE not set"
+       @ echo >&2 "Valid values are: $(__MATRIX_BUILD_STYLES)"
+       @ false
+
 ifeq ("$(MATRIX_COMPILER_OPTIONS)","")
 
 ifneq ("$(MATRIX_GCC_OPTIONS)","")
@@ -35,14 +46,3 @@ SBOX_EXTRA_CROSS_COMPILER_ARGS += $(MATRIX_COMPILER_OPTIONS)
 endif
 
 export SBOX_EXTRA_CROSS_COMPILER_ARGS
-
-ifeq ("$(MATRIX_BUILD_STYLE)", "autotools")
-include $(MATRIX_SCRIPTDIR)/matrix-autotools.mak
-endif
-ifeq ("$(MATRIX_BUILD_STYLE)", "custom")
-include $(MATRIX_SCRIPTDIR)/matrix-custom.mak
-endif
-
-ifndef __MATRIX_BUILD_STYLE_LOADED
-$(error "MATRIX_BUILD_STYLE not set, valid values are: autotools custom")
-endif