summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.Linux18
-rw-r--r--Makefile.SunOS18
-rw-r--r--Makefile.common29
-rw-r--r--Makefile.rules29
4 files changed, 60 insertions, 34 deletions
diff --git a/Makefile.Linux b/Makefile.Linux
new file mode 100644
index 0000000000..2a3e4a6335
--- /dev/null
+++ b/Makefile.Linux
@@ -0,0 +1,18 @@
+#===-- Makefile.Linux - Linux specific makefile options ---*- makefile -*--====#
+#
+# This file is included by all other files, through Makefile.common, but only
+# when compiling on a Linux based platform.
+#
+#===-----------------------------------------------------------------------====#
+
+# MakeSharedObjectOption - This option is passed to the linker by
+# Makefile.common when compiling a shared object.
+#
+MakeSharedObjectOption := -shared
+
+# ExportSymbols - This is used by tools that need to make sure that all of their
+# symbols are exported for use at runtime by dlsym.
+#
+ExportSymbols := -Wl,--export-dynamic
+
+
diff --git a/Makefile.SunOS b/Makefile.SunOS
new file mode 100644
index 0000000000..9afae8a176
--- /dev/null
+++ b/Makefile.SunOS
@@ -0,0 +1,18 @@
+#===-- Makefile.SunOS - SunOS specific makefile options ---*- makefile -*--====#
+#
+# This file is included by all other files, through Makefile.common, but only
+# when compiling on a solaris based platform.
+#
+#===-----------------------------------------------------------------------====#
+
+# MakeSharedObjectOption - This option is passed to the linker by
+# Makefile.common when compiling a shared object.
+#
+MakeSharedObjectOption := -G
+
+# ExportSymbols - This is used by tools that need to make sure that all of their
+# symbols are exported for use at runtime by dlsym.
+#
+ExportSymbols :=
+
+
diff --git a/Makefile.common b/Makefile.common
index ba24c10dc6..38a4e66cf6 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -46,6 +46,14 @@ include $(LEVEL)/Makefile.config
#
#ENABLE_OPTIMIZED = 1
+
+# Figure out how to do platform specific stuff on this platform. This is really
+# gross and should be autoconfiscated (automake actually), but should hopefully
+# work on Linux and solaris (SunOS).
+#
+UNAME := $(shell uname)
+include $(LEVEL)/Makefile.$(UNAME)
+
ifdef SHARED_LIBRARY
# if SHARED_LIBRARY is specified, the default is to build the dynamic lib
dynamic ::
@@ -142,6 +150,10 @@ LinkO := $(Link) -O3 -L $(LIBRELEASE)
# Create one .o file from a bunch of .o files...
Relink = ld -r
+# MakeSO - Create a .so file from a .o files...
+MakeSO := $(CXX) $(MakeSharedObjectOption) $(PROFILE)
+MakeSOO := $(MakeSO) -O3
+
# Create dependancy file from CPP file, send to stdout.
Depend := $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
@@ -194,23 +206,6 @@ endif
ifdef LIBRARYNAME
-# Figure out how to make a .so file on this platform. This is really gross and
-# should be autoconfiscated (automake actually), but should hopefully work on
-# linux and solaris.
-#
-
-# Create a .so file from a .o files...
-UNAME := $(shell uname)
-
-ifeq ($(UNAME), SunOS)
-MakeSO := $(CXX) -G $(PROFILE)
-else
-MakeSO := $(CXX) -shared $(PROFILE)
-endif
-
-MakeSOO := $(MakeSO) -O3
-
-
LIBNAME_O := $(LIBRELEASE)/lib$(LIBRARYNAME).so
LIBNAME_G := $(LIBDEBUG)/lib$(LIBRARYNAME).so
LIBNAME_AO := $(LIBRELEASE)/lib$(LIBRARYNAME).a
diff --git a/Makefile.rules b/Makefile.rules
index ba24c10dc6..38a4e66cf6 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -46,6 +46,14 @@ include $(LEVEL)/Makefile.config
#
#ENABLE_OPTIMIZED = 1
+
+# Figure out how to do platform specific stuff on this platform. This is really
+# gross and should be autoconfiscated (automake actually), but should hopefully
+# work on Linux and solaris (SunOS).
+#
+UNAME := $(shell uname)
+include $(LEVEL)/Makefile.$(UNAME)
+
ifdef SHARED_LIBRARY
# if SHARED_LIBRARY is specified, the default is to build the dynamic lib
dynamic ::
@@ -142,6 +150,10 @@ LinkO := $(Link) -O3 -L $(LIBRELEASE)
# Create one .o file from a bunch of .o files...
Relink = ld -r
+# MakeSO - Create a .so file from a .o files...
+MakeSO := $(CXX) $(MakeSharedObjectOption) $(PROFILE)
+MakeSOO := $(MakeSO) -O3
+
# Create dependancy file from CPP file, send to stdout.
Depend := $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
@@ -194,23 +206,6 @@ endif
ifdef LIBRARYNAME
-# Figure out how to make a .so file on this platform. This is really gross and
-# should be autoconfiscated (automake actually), but should hopefully work on
-# linux and solaris.
-#
-
-# Create a .so file from a .o files...
-UNAME := $(shell uname)
-
-ifeq ($(UNAME), SunOS)
-MakeSO := $(CXX) -G $(PROFILE)
-else
-MakeSO := $(CXX) -shared $(PROFILE)
-endif
-
-MakeSOO := $(MakeSO) -O3
-
-
LIBNAME_O := $(LIBRELEASE)/lib$(LIBRARYNAME).so
LIBNAME_G := $(LIBDEBUG)/lib$(LIBRARYNAME).so
LIBNAME_AO := $(LIBRELEASE)/lib$(LIBRARYNAME).a