Date: Thursday, January 4, 2007 @ 20:41:34
  Author: marc
    Path: /cvsroot/carob/carob

   Added: make-includes/main.mk (1.1)
Modified: GNUmakefile (1.14 -> 1.15) make-includes/gnu-linker.mk (1.1 ->
          1.2) test/GNUmakefile (1.29 -> 1.30)

Extracted make-includes/main.mk from root GNUmakefile so it can be shared with 
tests.
Renamed BUILD_SHARED_FLAGS to SHARED_LDFLAGS


-----------------------------+
 GNUmakefile                 |   23 ++---------------------
 make-includes/gnu-linker.mk |    7 ++++---
 make-includes/main.mk       |   21 +++++++++++++++++++++
 test/GNUmakefile            |   10 ++++++++--
 4 files changed, 35 insertions(+), 26 deletions(-)


Index: carob/GNUmakefile
diff -u carob/GNUmakefile:1.14 carob/GNUmakefile:1.15
--- carob/GNUmakefile:1.14      Thu Jan  4 20:00:38 2007
+++ carob/GNUmakefile   Thu Jan  4 20:41:34 2007
@@ -26,26 +26,7 @@
 
 MKINCLUDES=make-includes
 
-# Defaults
-COMPILER?=gcc
-LINKER?=gnu
-# OS?=linux # we may need this in the future?
-
-include ${MKINCLUDES}/${COMPILER}-compiler.mk
-include ${MKINCLUDES}/${LINKER}-linker.mk
-# include ${MKINCLUDES}/${OS}-os.mk
-
-# e.g. :           -soname          ${LIB_CAROB_LIB}
-#     => "-Xlinker -soname -Xlinker ${LIB_CAROB_LIB}"
-override LDFLAGS += ${INDIRECT_LDFLAGS:%=${LD_FORWARDER} %}
-
-
-
-ifneq ($(origin CUSTOM), undefined)
-custom_files=${CUSTOM:%=${MKINCLUDES}/%.mk}
-include $(custom_files)
-endif
-
+include ${MKINCLUDES}/main.mk
 
 #General
 LIB_MAJOR_VERSION       = 1
@@ -127,7 +108,7 @@
        $(MAKE) -C test
 
 ${LIB_CAROB_LIB}: ${OBJS}
-       ${CXX} ${CXXFLAGS} ${OBJS} ${BUILD_SHARED_FLAGS} ${LDFLAGS} ${LDLIBS} 
-o ${LIB_CAROB_LIB}
+       ${CXX} ${CXXFLAGS} ${OBJS} ${SHARED_LDFLAGS} ${LDFLAGS} ${LDLIBS} -o 
${LIB_CAROB_LIB}
        - ${LN} -f ${LIB_CAROB_LIB} ${LIB_CAROB_LIB_SHORT}
 
 ${LIB_CAROB_STATIC}: ${OBJS}
Index: carob/make-includes/gnu-linker.mk
diff -u carob/make-includes/gnu-linker.mk:1.1 
carob/make-includes/gnu-linker.mk:1.2
--- carob/make-includes/gnu-linker.mk:1.1       Thu Jan  4 20:00:38 2007
+++ carob/make-includes/gnu-linker.mk   Thu Jan  4 20:41:34 2007
@@ -1,6 +1,7 @@
 
 # mandatory LDFLAGS
-BUILD_SHARED_FLAGS += -shared
-
-INDIRECT_LDFLAGS += -soname ${LIB_CAROB_LIB}
+SHARED_LDFLAGS += -shared
 
+# passed from the compiler to the GNU linker using "-Xlinker" or alike
+SHARED_INDIRECT_LDFLAGS += -soname ${LIB_CAROB_LIB}
+TEST_INDIRECT_LDFLAGS += -rpath ${CAROB_ROOT} -export-dynamic
Index: carob/make-includes/main.mk
diff -u /dev/null carob/make-includes/main.mk:1.1
--- /dev/null   Thu Jan  4 20:41:34 2007
+++ carob/make-includes/main.mk Thu Jan  4 20:41:34 2007
@@ -0,0 +1,21 @@
+# Defaults
+COMPILER?=gcc
+LINKER?=gnu
+# OS?=linux # we may need this in the future?
+
+include ${MKINCLUDES}/${COMPILER}-compiler.mk
+include ${MKINCLUDES}/${LINKER}-linker.mk
+# include ${MKINCLUDES}/${OS}-os.mk
+
+# e.g. :           -soname          ${LIB_CAROB_LIB}
+#     => "-Xlinker -soname -Xlinker ${LIB_CAROB_LIB}"
+override LDFLAGS += ${INDIRECT_LDFLAGS:%=${LD_FORWARDER} %}
+override SHARED_LDFLAGS += ${SHARED_INDIRECT_LDFLAGS:%=${LD_FORWARDER} %}
+override TEST_LDFLAGS += ${TEST_INDIRECT_LDFLAGS:%=${LD_FORWARDER} %}
+
+
+ifneq ($(origin CUSTOM), undefined)
+custom_files=${CUSTOM:%=${MKINCLUDES}/%.mk}
+include $(custom_files)
+endif
+
Index: carob/test/GNUmakefile
diff -u carob/test/GNUmakefile:1.29 carob/test/GNUmakefile:1.30
--- carob/test/GNUmakefile:1.29 Thu Jan  4 17:45:43 2007
+++ carob/test/GNUmakefile      Thu Jan  4 20:41:34 2007
@@ -22,6 +22,12 @@
 # Makefile for the Carob C++ API and tests
 #
 
+
+MKINCLUDES=../make-includes
+
+include ${MKINCLUDES}/main.mk
+
+
 # Put an absolute path in here to be able to run from any directory
 CAROB_ROOT              = ..
 
@@ -53,7 +59,7 @@
 
 ## mandatory LDFLAGS
 # for libcarob
-override LDFLAGS        += -Wl,-rpath,${CAROB_ROOT} -L${CAROB_ROOT} 
-l${LIB_CAROB}  -rdynamic
+override LDFLAGS        += -L${CAROB_ROOT} -l${LIB_CAROB}
 # for libcppunit
 override LDLIBS        += -l${LIB_CPPUNIT}
 
@@ -71,7 +77,7 @@
 #CXXFLAGS                += -DCAROB_TEST_USE_MYSQL
 
 ${EXE}: ${TESTOBJS} CarobTestLauncher.o ${LIB_CAROB_SO}
-       ${CXX} ${CXXFLAGS} $^ ${LDFLAGS} ${LDLIBS} -o $@
+       ${CXX} ${CXXFLAGS} $^ ${LDFLAGS} ${TEST_LDFLAGS} ${LDLIBS} -o $@
 
 ${LIB_CAROB_FILE}:
        ${MAKE} -C ${CAROB_ROOT}

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to