aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-29 08:21:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-29 08:21:40 +0200
commit649df540e853838c51167c8cf02b17fc65fc807d (patch)
tree216c12f4ad75138bca1d128c47c911355e2d05a3
parent4f9bd5a46df045f9bd5774125233cf4ac11ae184 (diff)
New, makefile-based bundled build implementation
-rwxr-xr-xbuild.sh108
-rw-r--r--libbackend-elements/build/cxx/configuration-dynamic.make4
-rw-r--r--libbackend-elements/build/import/libcult/configuration-dynamic.make5
-rw-r--r--libcult/build/cxx/configuration-dynamic.make4
-rw-r--r--libfrontend-elements/build/cxx/configuration-dynamic.make4
-rw-r--r--libfrontend-elements/build/import/libcult/configuration-dynamic.make5
-rw-r--r--libxsd-frontend/build/cxx/configuration-dynamic.make4
-rw-r--r--libxsd-frontend/build/import/libcult/configuration-dynamic.make5
-rw-r--r--libxsd-frontend/build/import/libfrontend-elements/configuration-dynamic.make5
-rw-r--r--makefile72
-rw-r--r--xsde/build/c/configuration-dynamic.make4
-rw-r--r--xsde/build/cxx/configuration-dynamic.make4
-rw-r--r--xsde/build/import/libbackend-elements/configuration-dynamic.make5
-rw-r--r--xsde/build/import/libcult/configuration-dynamic.make5
-rw-r--r--xsde/build/import/libxsd-frontend/configuration-dynamic.make5
15 files changed, 112 insertions, 127 deletions
diff --git a/build.sh b/build.sh
deleted file mode 100755
index 237e92e..0000000
--- a/build.sh
+++ /dev/null
@@ -1,108 +0,0 @@
-#! /usr/bin/env bash
-
-trap 'exit 1' ERR
-
-build=build
-libcult=libcult
-libfe=libfrontend-elements
-libbe=libbackend-elements
-libxsd_fe=libxsd-frontend
-xsde=xsde
-
-pwd=`pwd`
-
-MAKEFLAGS="-I$pwd/stage/include $MAKEFLAGS"
-
-target=$1
-
-if [ "$target" = "dist" ]; then
- # Since we only want to package XSD/e, we will handle
- # this target at the end.
- target=
-fi
-
-
-# build
-#
-if [ ! -d $pwd/stage/include/build-* ]; then
- make -C $build install_prefix=$pwd/stage install
-fi
-
-
-# libcult
-#
-make $MAKEFLAGS -C $libcult/cult $target
-
-if [ "$target" = "clean" ]; then
- rm -f $pwd/stage/include/cult
- rm -f $pwd/stage/lib/libcult.a
- rm -f $libcult/build/system/configuration-dynamic.make
-else
- if [ ! -d $pwd/stage/include/cult ]; then
- ln -s ../../$libcult/cult stage/include/
- ln -s ../../$libcult/cult/libcult.a stage/lib/
- fi
-fi
-
-
-# libfrontend-elements
-#
-make $MAKEFLAGS -C $libfe/frontend-elements $target
-
-if [ "$target" = "clean" ]; then
- rm -f $pwd/stage/include/frontend-elements
- rm -f $pwd/stage/lib/libfrontend-elements.a
-else
- if [ ! -d $pwd/stage/include/frontend-elements ]; then
- ln -s ../../$libfe/frontend-elements stage/include/
- ln -s ../../$libfe/frontend-elements/libfrontend-elements.a stage/lib/
- fi
-fi
-
-
-# libbackend-elements
-#
-make $MAKEFLAGS -C $libbe/backend-elements $target
-
-if [ "$target" = "clean" ]; then
- rm -f $pwd/stage/include/backend-elements
-else
- if [ ! -d $pwd/stage/include/backend-elements ]; then
- ln -s ../../$libbe/backend-elements stage/include/
- fi
-fi
-
-
-# libxsd-frontend
-#
-make $MAKEFLAGS -C $libxsd_fe/xsd-frontend $target
-
-if [ "$target" = "clean" ]; then
- rm -f $pwd/stage/include/xsd-frontend
- rm -f $pwd/stage/lib/libxsd-frontend.a
-else
- if [ ! -d $pwd/stage/include/xsd-frontend ]; then
- ln -s ../../$libxsd_fe/xsd-frontend stage/include/
- ln -s ../../$libxsd_fe/xsd-frontend/libxsd-frontend.a stage/lib/
- fi
-fi
-
-
-# xsde
-#
-if [ "$target" = "clean" ]; then
- make $MAKEFLAGS -C $xsde clean
- rm -fr $pwd/dist
-else
- make $MAKEFLAGS -C $xsde/xsde $target
-fi
-
-if [ "$1" = "dist" ]; then
-make $MAKEFLAGS -C $xsde dist_prefix=$pwd/dist/$xsde dist
-fi
-
-# build (clean)
-#
-if [ "$target" = "clean" ]; then
- rm -rf $pwd/stage/include/build-*
-fi
diff --git a/libbackend-elements/build/cxx/configuration-dynamic.make b/libbackend-elements/build/cxx/configuration-dynamic.make
index 7485fe9..568ab40 100644
--- a/libbackend-elements/build/cxx/configuration-dynamic.make
+++ b/libbackend-elements/build/cxx/configuration-dynamic.make
@@ -2,7 +2,7 @@ cxx_id := gnu
cxx_optimize := n
cxx_debug := n
cxx_rpath := n
-cxx_pp_extra_options := $(CPPFLAGS) -I$(out_root)/../stage/include
+cxx_pp_extra_options := $(CPPFLAGS)
cxx_extra_options := $(CXXFLAGS)
cxx_ld_extra_options := $(LDFLAGS)
cxx_extra_libs := $(LIBS)
@@ -11,4 +11,4 @@ r := $(shell echo $(LDFLAGS) | sed -e 's/-L *\([^ ]*\)/-L\1/g')
r := $(patsubst -L%,%,$(filter -L%,$(r)))
r := $(shell echo $(r) | sed -e 's/ /:/g')
-cxx_extra_lib_paths := $(out_root)/../stage/lib $(r)
+cxx_extra_lib_paths := $(r)
diff --git a/libbackend-elements/build/import/libcult/configuration-dynamic.make b/libbackend-elements/build/import/libcult/configuration-dynamic.make
index 78c41d3..73c92bb 100644
--- a/libbackend-elements/build/import/libcult/configuration-dynamic.make
+++ b/libbackend-elements/build/import/libcult/configuration-dynamic.make
@@ -1 +1,4 @@
-libcult_installed := y
+libcult_installed := n
+src_root := $(abspath $(src_root)/../libcult)
+scf_root := $(src_root)/build
+out_root := $(src_root)
diff --git a/libcult/build/cxx/configuration-dynamic.make b/libcult/build/cxx/configuration-dynamic.make
index 7485fe9..568ab40 100644
--- a/libcult/build/cxx/configuration-dynamic.make
+++ b/libcult/build/cxx/configuration-dynamic.make
@@ -2,7 +2,7 @@ cxx_id := gnu
cxx_optimize := n
cxx_debug := n
cxx_rpath := n
-cxx_pp_extra_options := $(CPPFLAGS) -I$(out_root)/../stage/include
+cxx_pp_extra_options := $(CPPFLAGS)
cxx_extra_options := $(CXXFLAGS)
cxx_ld_extra_options := $(LDFLAGS)
cxx_extra_libs := $(LIBS)
@@ -11,4 +11,4 @@ r := $(shell echo $(LDFLAGS) | sed -e 's/-L *\([^ ]*\)/-L\1/g')
r := $(patsubst -L%,%,$(filter -L%,$(r)))
r := $(shell echo $(r) | sed -e 's/ /:/g')
-cxx_extra_lib_paths := $(out_root)/../stage/lib $(r)
+cxx_extra_lib_paths := $(r)
diff --git a/libfrontend-elements/build/cxx/configuration-dynamic.make b/libfrontend-elements/build/cxx/configuration-dynamic.make
index 7485fe9..568ab40 100644
--- a/libfrontend-elements/build/cxx/configuration-dynamic.make
+++ b/libfrontend-elements/build/cxx/configuration-dynamic.make
@@ -2,7 +2,7 @@ cxx_id := gnu
cxx_optimize := n
cxx_debug := n
cxx_rpath := n
-cxx_pp_extra_options := $(CPPFLAGS) -I$(out_root)/../stage/include
+cxx_pp_extra_options := $(CPPFLAGS)
cxx_extra_options := $(CXXFLAGS)
cxx_ld_extra_options := $(LDFLAGS)
cxx_extra_libs := $(LIBS)
@@ -11,4 +11,4 @@ r := $(shell echo $(LDFLAGS) | sed -e 's/-L *\([^ ]*\)/-L\1/g')
r := $(patsubst -L%,%,$(filter -L%,$(r)))
r := $(shell echo $(r) | sed -e 's/ /:/g')
-cxx_extra_lib_paths := $(out_root)/../stage/lib $(r)
+cxx_extra_lib_paths := $(r)
diff --git a/libfrontend-elements/build/import/libcult/configuration-dynamic.make b/libfrontend-elements/build/import/libcult/configuration-dynamic.make
index 78c41d3..73c92bb 100644
--- a/libfrontend-elements/build/import/libcult/configuration-dynamic.make
+++ b/libfrontend-elements/build/import/libcult/configuration-dynamic.make
@@ -1 +1,4 @@
-libcult_installed := y
+libcult_installed := n
+src_root := $(abspath $(src_root)/../libcult)
+scf_root := $(src_root)/build
+out_root := $(src_root)
diff --git a/libxsd-frontend/build/cxx/configuration-dynamic.make b/libxsd-frontend/build/cxx/configuration-dynamic.make
index 7485fe9..568ab40 100644
--- a/libxsd-frontend/build/cxx/configuration-dynamic.make
+++ b/libxsd-frontend/build/cxx/configuration-dynamic.make
@@ -2,7 +2,7 @@ cxx_id := gnu
cxx_optimize := n
cxx_debug := n
cxx_rpath := n
-cxx_pp_extra_options := $(CPPFLAGS) -I$(out_root)/../stage/include
+cxx_pp_extra_options := $(CPPFLAGS)
cxx_extra_options := $(CXXFLAGS)
cxx_ld_extra_options := $(LDFLAGS)
cxx_extra_libs := $(LIBS)
@@ -11,4 +11,4 @@ r := $(shell echo $(LDFLAGS) | sed -e 's/-L *\([^ ]*\)/-L\1/g')
r := $(patsubst -L%,%,$(filter -L%,$(r)))
r := $(shell echo $(r) | sed -e 's/ /:/g')
-cxx_extra_lib_paths := $(out_root)/../stage/lib $(r)
+cxx_extra_lib_paths := $(r)
diff --git a/libxsd-frontend/build/import/libcult/configuration-dynamic.make b/libxsd-frontend/build/import/libcult/configuration-dynamic.make
index 78c41d3..73c92bb 100644
--- a/libxsd-frontend/build/import/libcult/configuration-dynamic.make
+++ b/libxsd-frontend/build/import/libcult/configuration-dynamic.make
@@ -1 +1,4 @@
-libcult_installed := y
+libcult_installed := n
+src_root := $(abspath $(src_root)/../libcult)
+scf_root := $(src_root)/build
+out_root := $(src_root)
diff --git a/libxsd-frontend/build/import/libfrontend-elements/configuration-dynamic.make b/libxsd-frontend/build/import/libfrontend-elements/configuration-dynamic.make
index 6583182..70d0da6 100644
--- a/libxsd-frontend/build/import/libfrontend-elements/configuration-dynamic.make
+++ b/libxsd-frontend/build/import/libfrontend-elements/configuration-dynamic.make
@@ -1 +1,4 @@
-libfrontend_elements_installed := y
+libfrontend_elements_installed := n
+src_root := $(abspath $(src_root)/../libfrontend-elements)
+scf_root := $(src_root)/build
+out_root := $(src_root)
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..85c41fb
--- /dev/null
+++ b/makefile
@@ -0,0 +1,72 @@
+# file : makefile
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009 Code Synthesis Tools CC
+# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+include $(dir $(lastword $(MAKEFILE_LIST)))/build-0.3/bootstrap.make
+
+default := $(out_base)/
+
+.PHONY: $(default) test install clean
+
+# Build.
+#
+$(default): $(out_base)/xsde/xsde/
+
+# Test.
+#
+test: $(out_base)/xsde/.test
+
+# Install.
+#
+install: $(out_base)/xsde/.install
+
+# Clean.
+#
+clean: $(out_base)/libcult/.clean \
+ $(out_base)/libfrontend-elements/.clean \
+ $(out_base)/libbackend-elements/.clean \
+ $(out_base)/libxsd-frontend/.clean \
+ $(out_base)/xsde/.clean
+
+# Reset pattern-specific variables because GNU make will use the
+# first match instead of the most specific match. Here out_root
+# and out_base are the same.
+#
+$(out_root)/%: out_root :=
+$(out_root)/%: out_base :=
+$(out_root)/%: src_root :=
+$(out_root)/%: src_base :=
+$(out_root)/%: scf_root :=
+$(out_root)/%: dcf_root :=
+$(out_root)/%: project_name :=
+
+src_root := $(src_base)/libcult
+scf_root := $(src_root)/build
+out_root := $(src_root)
+$(call import,$(src_base)/libcult/makefile)
+
+src_root := $(src_base)/libfrontend-elements
+scf_root := $(src_root)/build
+out_root := $(src_root)
+$(call import,$(src_base)/libfrontend-elements/makefile)
+
+src_root := $(src_base)/libbackend-elements
+scf_root := $(src_root)/build
+out_root := $(src_root)
+$(call import,$(src_base)/libbackend-elements/makefile)
+
+src_root := $(src_base)/libxsd-frontend
+scf_root := $(src_root)/build
+out_root := $(src_root)
+$(call import,$(src_base)/libxsd-frontend/makefile)
+
+src_root := $(src_base)/xsde
+scf_root := $(src_root)/build
+out_root := $(src_root)
+
+ifneq ($(filter $(MAKECMDGOALS),clean test install),)
+$(call import,$(src_base)/xsde/makefile)
+else
+$(call import,$(src_base)/xsde/xsde/makefile)
+endif
diff --git a/xsde/build/c/configuration-dynamic.make b/xsde/build/c/configuration-dynamic.make
index c86b863..2003d76 100644
--- a/xsde/build/c/configuration-dynamic.make
+++ b/xsde/build/c/configuration-dynamic.make
@@ -2,7 +2,7 @@ c_id := gnu
c_optimize := n
c_debug := n
c_rpath := n
-c_pp_extra_options := $(CPPFLAGS) -I$(out_root)/../stage/include
+c_pp_extra_options := $(CPPFLAGS)
c_extra_options := $(CFLAGS)
c_ld_extra_options := $(LDFLAGS)
c_extra_libs := $(LIBS)
@@ -11,4 +11,4 @@ r := $(shell echo $(LDFLAGS) | sed -e 's/-L *\([^ ]*\)/-L\1/g')
r := $(patsubst -L%,%,$(filter -L%,$(r)))
r := $(shell echo $(r) | sed -e 's/ /:/g')
-c_extra_lib_paths := $(out_root)/../stage/lib $(r)
+c_extra_lib_paths := $(r)
diff --git a/xsde/build/cxx/configuration-dynamic.make b/xsde/build/cxx/configuration-dynamic.make
index 7485fe9..568ab40 100644
--- a/xsde/build/cxx/configuration-dynamic.make
+++ b/xsde/build/cxx/configuration-dynamic.make
@@ -2,7 +2,7 @@ cxx_id := gnu
cxx_optimize := n
cxx_debug := n
cxx_rpath := n
-cxx_pp_extra_options := $(CPPFLAGS) -I$(out_root)/../stage/include
+cxx_pp_extra_options := $(CPPFLAGS)
cxx_extra_options := $(CXXFLAGS)
cxx_ld_extra_options := $(LDFLAGS)
cxx_extra_libs := $(LIBS)
@@ -11,4 +11,4 @@ r := $(shell echo $(LDFLAGS) | sed -e 's/-L *\([^ ]*\)/-L\1/g')
r := $(patsubst -L%,%,$(filter -L%,$(r)))
r := $(shell echo $(r) | sed -e 's/ /:/g')
-cxx_extra_lib_paths := $(out_root)/../stage/lib $(r)
+cxx_extra_lib_paths := $(r)
diff --git a/xsde/build/import/libbackend-elements/configuration-dynamic.make b/xsde/build/import/libbackend-elements/configuration-dynamic.make
index fd03110..8a6f091 100644
--- a/xsde/build/import/libbackend-elements/configuration-dynamic.make
+++ b/xsde/build/import/libbackend-elements/configuration-dynamic.make
@@ -1 +1,4 @@
-libbackend_elements_installed := y
+libbackend_elements_installed := n
+src_root := $(abspath $(src_root)/../libbackend-elements)
+scf_root := $(src_root)/build
+out_root := $(src_root)
diff --git a/xsde/build/import/libcult/configuration-dynamic.make b/xsde/build/import/libcult/configuration-dynamic.make
index 78c41d3..73c92bb 100644
--- a/xsde/build/import/libcult/configuration-dynamic.make
+++ b/xsde/build/import/libcult/configuration-dynamic.make
@@ -1 +1,4 @@
-libcult_installed := y
+libcult_installed := n
+src_root := $(abspath $(src_root)/../libcult)
+scf_root := $(src_root)/build
+out_root := $(src_root)
diff --git a/xsde/build/import/libxsd-frontend/configuration-dynamic.make b/xsde/build/import/libxsd-frontend/configuration-dynamic.make
index 1b2d3ca..5033ade 100644
--- a/xsde/build/import/libxsd-frontend/configuration-dynamic.make
+++ b/xsde/build/import/libxsd-frontend/configuration-dynamic.make
@@ -1 +1,4 @@
-libxsd_frontend_installed := y
+libxsd_frontend_installed := n
+src_root := $(abspath $(src_root)/../libxsd-frontend)
+scf_root := $(src_root)/build
+out_root := $(src_root)