summaryrefslogtreecommitdiff
path: root/makefiles/gmake/platform.mk
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-02-26 09:45:30 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-02-26 09:45:30 +0100
commit8cff71890f72d619162b4b8fac6f96f268deabd6 (patch)
treeb4c94d7455bcc44b0b607198984134e81b0797a0 /makefiles/gmake/platform.mk
parent6a4d7e4836dc9e4b7dba4a39dd0a51e0bea0d1c5 (diff)
downloadwolfbones-8cff71890f72d619162b4b8fac6f96f268deabd6.tar.gz
wolfbones-8cff71890f72d619162b4b8fac6f96f268deabd6.tar.bz2
made the GNU make NMAKE switch as we go to Windows now, also fixed small bugs in the makefiles
Diffstat (limited to 'makefiles/gmake/platform.mk')
-rw-r--r--makefiles/gmake/platform.mk56
1 files changed, 56 insertions, 0 deletions
diff --git a/makefiles/gmake/platform.mk b/makefiles/gmake/platform.mk
new file mode 100644
index 0000000..95843fb
--- /dev/null
+++ b/makefiles/gmake/platform.mk
@@ -0,0 +1,56 @@
+# sets e. g. to LINUX, OS_MAJOR_VERSION to 2 and OS_MINOR_VERSION to 6
+# by calling the 'guess_env' shell script, where the actual probing happens
+# Also sets PLATFORM_COMPILE_FLAGS to be included when compiling C/C++ code
+#
+# requires:
+# - TOPDIR
+#
+# provides:
+# - PLATFORM
+# - OS_MAJOR_VERSION and OS_MINOR_VERSION
+# - GCC_MAJOR_VERSION and GCC_MINOR_VERSION
+# - PLATFORM_COMPILE_FLAGS
+# - EXE
+# - SO
+# - INSTALL
+#
+# author: Andreas Baumann, abaumann at yahoo dot com
+
+PLATFORM = $(shell $(TOPDIR)/makefiles/gmake/guess_env --platform $(CC))
+OS_MAJOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --os-major-version $(CC))
+OS_MINOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --os-minor-version $(CC))
+COMPILER = $(shell $(TOPDIR)/makefiles/gmake/guess_env --compiler $(CC))
+
+PLATFORM_COMPILE_FLAGS = \
+ -D$(PLATFORM) \
+ -DOS_MAJOR_VERSION=$(OS_MAJOR_VERSION) \
+ -DOS_MINOR_VERSION=$(OS_MINOR_VERSION)
+
+# extensions for binaries
+ifeq "$(PLATFORM)" "CYGWIN"
+EXE = .exe
+else
+EXE =
+endif
+
+# extensions for shared libraries
+# (TOOD: HP/Unix has .shlib, Mac/X has .lib, but we can't test it currently)
+SO = .so
+
+# name if the installation program
+# (TODO: use the MIT or openradio install-sh script instead?)
+INSTALL = $(shell $(TOPDIR)/makefiles/gmake/guess_env --install)
+ifeq "$(PLATFORM)" "SUNOS"
+INSTALL = /usr/ucb/install
+else
+INSTALL = install
+endif
+
+# the linker library for dynamically loadable modules
+# (TODO: check for all platforms, as soon we add loadable modules here from
+# old TextWolf)
+ifeq "$(PLATFORM)" "LINUX"
+LIBS_DL = -ldl
+else
+LIBS_DL =
+endif