rename makefiles for automatic syntax highlight etc.
authorTimo Savola <tsavola@movial.fi>
Thu, 10 Apr 2008 20:23:31 +0000 (23:23 +0300)
committerTimo Savola <tsavola@movial.fi>
Thu, 10 Apr 2008 20:23:31 +0000 (23:23 +0300)
bin/matrix
scripts/matrix-autotools.mak [deleted file]
scripts/matrix-custom.mak [deleted file]
scripts/matrix.mak [deleted file]
scripts/matrix.mk [new file with mode: 0644]
scripts/run.sh
scripts/styles/autotools.mk [new file with mode: 0644]
scripts/styles/custom.mk [new file with mode: 0644]
setup.py

index 3ac8fb2..f216a46 100755 (executable)
@@ -11,7 +11,7 @@ if os.path.sep in sys.argv[0] and os.path.exists(sys.argv[0]):
 
 from matrix import matrix, config, log
 
-if path and os.path.exists(os.path.join(path, 'scripts', 'matrix.mak')):
+if path and os.path.exists(os.path.join(path, 'scripts', 'matrix.mk')):
        config.script_dir = os.path.join(path, 'scripts')
 else:
        config.script_dir = os.path.join(sys.prefix, 'share', 'matrix', 'scripts')
diff --git a/scripts/matrix-autotools.mak b/scripts/matrix-autotools.mak
deleted file mode 100644 (file)
index aa0f8f6..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright (C) 2006-2008 Movial Oy
-# Authors: Lauri Leukkunen
-#          Kalle Vahlman <kalle.vahlman@movial.fi>
-#
-# Provides the necessary targets to build a component using
-# standard autotools in the normal 
-# autogen.sh + configure + make + make install way.
-
-__MATRIX_BUILD_STYLE_LOADED=1
-
-t := $(shell if [ -d /usr/share/aclocal ]; then echo yes; else echo no; fi)
-ifeq (yes,$(t))
-ACLOCAL_ARGS := -I /usr/share/aclocal $(ACLOCAL_ARGS)
-endif
-
-ACLOCAL := aclocal $(ACLOCAL_ARGS)
-PKG_CONFIG_PATH := /usr/lib/pkgconfig:/usr/share/pkgconfig:$(PKG_CONFIG_PATH)
-
-export ACLOCAL PKG_CONFIG_PATH
-
-has_configure := $(shell if [ -e ./configure ]; then echo "yes"; else echo "no"; fi)
-
-ifdef no-docs
-MATRIX_CONFIG_FLAGS += --disable-gtk-doc --disable-xml-docs --disable-doxygen-docs --disable-docbook --disable-docs
-endif
-
-ifdef no-examples
-MATRIX_CONFIG_FLAGS += --disable-demos --disable-examples
-endif
-
-ifdef no-tests
-MATRIX_CONFIG_FLAGS += --disable-tests
-endif
-
-ifdef debug
-MATRIX_CONFIG_FLAGS += --enable-debug
-else
-MATRIX_CONFIG_FLAGS += --disable-debug
-endif
-
-ifndef MATRIX_CONFIGURE_ARGS
-MATRIX_CONFIGURE_ARGS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
-                        $(MATRIX_CONFIG_FLAGS) \
-                        $(MATRIX_CONFIGURE_EXTRA_ARGS)
-endif
-
-ifneq ($(has_configure),yes)
-MATRIX_AUTOGEN = __autogen
-else
-MATRIX_AUTOGEN = 
-endif
-
-__matrix_build: $(MATRIX_PREPARE_TARGET) $(MATRIX_AUTOGEN) __configure __build
-       @echo "[$(MATRIX_COMPONENT)] Build completed"
-
-__matrix_install: __install
-       @echo "[$(MATRIX_COMPONENT)] Install completed"
-
-__autogen: $(MATRIX_PREPARE_TARGET)
-       @$(MATRIX_AUTOGEN_ENV) ./autogen.sh $(MATRIX_AUTOGEN_ARGS)
-
-__configure: $(MATRIX_AUTOGEN)
-ifdef MATRIX_OBJ_DIR
-       rm -rf $(MATRIX_OBJ_DIR)
-       mkdir -p $(MATRIX_OBJ_DIR)
-       @cd $(MATRIX_OBJ_DIR) && $(MATRIX_CONFIGURE_ENV) $(MATRIX_TOPDIR)/src/$(MATRIX_COMPONENT)/configure --build=$(MATRIX_AUTOTOOLS_BUILD_ARCH) --host=$(MATRIX_AUTOTOOLS_HOST_ARCH) $(MATRIX_CONFIGURE_ARGS)
-else   
-       @$(MATRIX_CONFIGURE_ENV) $(CCTOOL_BUILD) ./configure $(MATRIX_CONFIGURE_ARGS)
-endif
-
-__build: __configure
-ifdef MATRIX_OBJ_DIR
-       @cd $(MATRIX_OBJ_DIR) && $(MATRIX_BUILD_ENV) $(CCTOOL_BUILD) $(MAKE) $(MATRIX_BUILD_ARGS)
-else
-       @$(MATRIX_BUILD_ENV) $(CCTOOL_BUILD) $(MAKE) $(MATRIX_BUILD_ARGS)
-endif
-
-
-# this can't have any requisites as that would trigger a rebuild
-
-__install:
-ifdef MATRIX_OBJ_DIR
-       @cd $(MATRIX_OBJ_DIR) && $(MATRIX_INSTALL_ENV) $(CCTOOL_INSTALL) $(MAKE) install $(MATRIX_INSTALL_ARGS)
-else
-       @$(MATRIX_INSTALL_ENV) $(CCTOOL_INSTALL) $(MAKE) install $(MATRIX_INSTALL_ARGS)
-endif
-
-
diff --git a/scripts/matrix-custom.mak b/scripts/matrix-custom.mak
deleted file mode 100644 (file)
index 6ee2b36..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2006-2008 Movial Oy
-# Authors: Lauri Leukkunen
-
-
-__MATRIX_BUILD_STYLE_LOADED=1
-
-.PHONY: configure build install __configure __build __install
-
-__matrix_build: __configure __build
-__matrix_install: __install
-
-__configure: configure
-       @$(CCTOOL_BUILD) $(MAKE) -f meta/plug configure
-
-__build: __configure build
-       @$(CCTOOL_BUILD) $(MAKE) -f meta/plug build
-
-# this can't have any requisites as that would trigger a rebuild
-__install:
-       @$(CCTOOL_INSTALL) $(MAKE) -f meta/plug install
diff --git a/scripts/matrix.mak b/scripts/matrix.mak
deleted file mode 100644 (file)
index a8a2107..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2006-2008 Movial Oy
-# 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)","")
-MATRIX_COMPILER_OPTIONS = $(MATRIX_GCC_OPTIONS)
-endif
-
-ifneq ("$(MATRIX_GCC_MCPU)","")
-MATRIX_COMPILER_OPTIONS += -mcpu=$(MATRIX_GCC_MCPU)
-endif
-
-ifneq ("$(MATRIX_GCC_MFPU)","")
-MATRIX_COMPILER_OPTIONS += -mfpu=$(MATRIX_GCC_MFPU)
-endif
-
-endif
-
-ifneq ("$(MATRIX_COMPILER_EXTRA_OPTIONS)","")
-MATRIX_COMPILER_OPTIONS += $(MATRIX_COMPILER_EXTRA_OPTIONS)
-endif
-
-SBOX_EXTRA_CROSS_COMPILER_ARGS = -march=$(MATRIX_GCC_MARCH)
-
-ifneq ("$(MATRIX_COMPILER_OPTIONS)","")
-SBOX_EXTRA_CROSS_COMPILER_ARGS += $(MATRIX_COMPILER_OPTIONS)
-endif
-
-export SBOX_EXTRA_CROSS_COMPILER_ARGS
diff --git a/scripts/matrix.mk b/scripts/matrix.mk
new file mode 100644 (file)
index 0000000..c37b601
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright (C) 2006-2008 Movial Oy
+# 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)/styles/$(MATRIX_BUILD_STYLE).mk
+__MATRIX_BUILD_STYLES = $(patsubst %.mk,%,$(notdir $(wildcard $(MATRIX_SCRIPTDIR)/styles/*.mk)))
+
+-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)","")
+MATRIX_COMPILER_OPTIONS = $(MATRIX_GCC_OPTIONS)
+endif
+
+ifneq ("$(MATRIX_GCC_MCPU)","")
+MATRIX_COMPILER_OPTIONS += -mcpu=$(MATRIX_GCC_MCPU)
+endif
+
+ifneq ("$(MATRIX_GCC_MFPU)","")
+MATRIX_COMPILER_OPTIONS += -mfpu=$(MATRIX_GCC_MFPU)
+endif
+
+endif
+
+ifneq ("$(MATRIX_COMPILER_EXTRA_OPTIONS)","")
+MATRIX_COMPILER_OPTIONS += $(MATRIX_COMPILER_EXTRA_OPTIONS)
+endif
+
+SBOX_EXTRA_CROSS_COMPILER_ARGS = -march=$(MATRIX_GCC_MARCH)
+
+ifneq ("$(MATRIX_COMPILER_OPTIONS)","")
+SBOX_EXTRA_CROSS_COMPILER_ARGS += $(MATRIX_COMPILER_OPTIONS)
+endif
+
+export SBOX_EXTRA_CROSS_COMPILER_ARGS
index 9754633..486bd57 100644 (file)
@@ -8,7 +8,7 @@ then
        MAKE="make"
 fi
 
-MAKEFILE="$MATRIX_SCRIPTDIR/matrix.mak"
+MAKEFILE="$MATRIX_SCRIPTDIR/matrix.mk"
 TARGET="__matrix_$MATRIX_ACTION"
 
 if [ x"$MATRIX_VERBOSE" = x1 ]
diff --git a/scripts/styles/autotools.mk b/scripts/styles/autotools.mk
new file mode 100644 (file)
index 0000000..aa0f8f6
--- /dev/null
@@ -0,0 +1,88 @@
+# Copyright (C) 2006-2008 Movial Oy
+# Authors: Lauri Leukkunen
+#          Kalle Vahlman <kalle.vahlman@movial.fi>
+#
+# Provides the necessary targets to build a component using
+# standard autotools in the normal 
+# autogen.sh + configure + make + make install way.
+
+__MATRIX_BUILD_STYLE_LOADED=1
+
+t := $(shell if [ -d /usr/share/aclocal ]; then echo yes; else echo no; fi)
+ifeq (yes,$(t))
+ACLOCAL_ARGS := -I /usr/share/aclocal $(ACLOCAL_ARGS)
+endif
+
+ACLOCAL := aclocal $(ACLOCAL_ARGS)
+PKG_CONFIG_PATH := /usr/lib/pkgconfig:/usr/share/pkgconfig:$(PKG_CONFIG_PATH)
+
+export ACLOCAL PKG_CONFIG_PATH
+
+has_configure := $(shell if [ -e ./configure ]; then echo "yes"; else echo "no"; fi)
+
+ifdef no-docs
+MATRIX_CONFIG_FLAGS += --disable-gtk-doc --disable-xml-docs --disable-doxygen-docs --disable-docbook --disable-docs
+endif
+
+ifdef no-examples
+MATRIX_CONFIG_FLAGS += --disable-demos --disable-examples
+endif
+
+ifdef no-tests
+MATRIX_CONFIG_FLAGS += --disable-tests
+endif
+
+ifdef debug
+MATRIX_CONFIG_FLAGS += --enable-debug
+else
+MATRIX_CONFIG_FLAGS += --disable-debug
+endif
+
+ifndef MATRIX_CONFIGURE_ARGS
+MATRIX_CONFIGURE_ARGS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
+                        $(MATRIX_CONFIG_FLAGS) \
+                        $(MATRIX_CONFIGURE_EXTRA_ARGS)
+endif
+
+ifneq ($(has_configure),yes)
+MATRIX_AUTOGEN = __autogen
+else
+MATRIX_AUTOGEN = 
+endif
+
+__matrix_build: $(MATRIX_PREPARE_TARGET) $(MATRIX_AUTOGEN) __configure __build
+       @echo "[$(MATRIX_COMPONENT)] Build completed"
+
+__matrix_install: __install
+       @echo "[$(MATRIX_COMPONENT)] Install completed"
+
+__autogen: $(MATRIX_PREPARE_TARGET)
+       @$(MATRIX_AUTOGEN_ENV) ./autogen.sh $(MATRIX_AUTOGEN_ARGS)
+
+__configure: $(MATRIX_AUTOGEN)
+ifdef MATRIX_OBJ_DIR
+       rm -rf $(MATRIX_OBJ_DIR)
+       mkdir -p $(MATRIX_OBJ_DIR)
+       @cd $(MATRIX_OBJ_DIR) && $(MATRIX_CONFIGURE_ENV) $(MATRIX_TOPDIR)/src/$(MATRIX_COMPONENT)/configure --build=$(MATRIX_AUTOTOOLS_BUILD_ARCH) --host=$(MATRIX_AUTOTOOLS_HOST_ARCH) $(MATRIX_CONFIGURE_ARGS)
+else   
+       @$(MATRIX_CONFIGURE_ENV) $(CCTOOL_BUILD) ./configure $(MATRIX_CONFIGURE_ARGS)
+endif
+
+__build: __configure
+ifdef MATRIX_OBJ_DIR
+       @cd $(MATRIX_OBJ_DIR) && $(MATRIX_BUILD_ENV) $(CCTOOL_BUILD) $(MAKE) $(MATRIX_BUILD_ARGS)
+else
+       @$(MATRIX_BUILD_ENV) $(CCTOOL_BUILD) $(MAKE) $(MATRIX_BUILD_ARGS)
+endif
+
+
+# this can't have any requisites as that would trigger a rebuild
+
+__install:
+ifdef MATRIX_OBJ_DIR
+       @cd $(MATRIX_OBJ_DIR) && $(MATRIX_INSTALL_ENV) $(CCTOOL_INSTALL) $(MAKE) install $(MATRIX_INSTALL_ARGS)
+else
+       @$(MATRIX_INSTALL_ENV) $(CCTOOL_INSTALL) $(MAKE) install $(MATRIX_INSTALL_ARGS)
+endif
+
+
diff --git a/scripts/styles/custom.mk b/scripts/styles/custom.mk
new file mode 100644 (file)
index 0000000..6ee2b36
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (C) 2006-2008 Movial Oy
+# Authors: Lauri Leukkunen
+
+
+__MATRIX_BUILD_STYLE_LOADED=1
+
+.PHONY: configure build install __configure __build __install
+
+__matrix_build: __configure __build
+__matrix_install: __install
+
+__configure: configure
+       @$(CCTOOL_BUILD) $(MAKE) -f meta/plug configure
+
+__build: __configure build
+       @$(CCTOOL_BUILD) $(MAKE) -f meta/plug build
+
+# this can't have any requisites as that would trigger a rebuild
+__install:
+       @$(CCTOOL_INSTALL) $(MAKE) -f meta/plug install
index 4149de8..deb8e73 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -9,6 +9,6 @@ setup(
        license='GPL',
        packages=['matrix'],
        scripts=['bin/matrix', 'bin/matrix-graph'],
-       data_files=[('share/scripts', glob('scripts/*.mak') +
+       data_files=[('share/scripts', glob('scripts/*.mk') +
                                      glob('scripts/*.sh'))],
 )