summaryrefslogtreecommitdiff
path: root/rbutil/libtools.make
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/libtools.make')
-rw-r--r--rbutil/libtools.make23
1 files changed, 14 insertions, 9 deletions
diff --git a/rbutil/libtools.make b/rbutil/libtools.make
index 77142355c6..44ed5fef3d 100644
--- a/rbutil/libtools.make
+++ b/rbutil/libtools.make
@@ -25,31 +25,37 @@ TOP := $(dir $(lastword $(MAKEFILE_LIST)))
25# overwrite for releases 25# overwrite for releases
26APPVERSION ?= $(shell $(TOP)/../tools/version.sh $(TOP)/..) 26APPVERSION ?= $(shell $(TOP)/../tools/version.sh $(TOP)/..)
27CFLAGS += -DVERSION=\""$(APPVERSION)"\" 27CFLAGS += -DVERSION=\""$(APPVERSION)"\"
28TARGET_DIR ?= $(shell pwd)/ 28TARGET_DIR ?= $(abspath .)/
29 29
30CPPDEFINES=$(shell echo foo | $(CROSS)$(CC) -dM -E -)
30# use POSIX/C99 printf on windows 31# use POSIX/C99 printf on windows
31CFLAGS += -D__USE_MINGW_ANSI_STDIO=1 32CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
32 33
33BINARY = $(OUTPUT) 34BINARY = $(OUTPUT)
34# when building a Windows binary add the correct file suffix 35# when building a Windows binary add the correct file suffix
35ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) 36ifeq ($(findstring CYGWIN,$(CPPDEFINES)),CYGWIN)
36BINARY = $(OUTPUT).exe 37BINARY = $(OUTPUT).exe
37CFLAGS+=-mno-cygwin 38CFLAGS+=-mno-cygwin
39COMPILETARGET = cygwin
38else 40else
39ifeq ($(findstring MINGW,$(shell uname)),MINGW) 41ifeq ($(findstring MINGW,$(CPPDEFINES)),MINGW)
40BINARY = $(OUTPUT).exe 42BINARY = $(OUTPUT).exe
43COMPILETARGET = mingw
41else 44else
42ifeq ($(findstring mingw,$(CROSS)$(CC)),mingw) 45ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE)
43BINARY = $(OUTPUT).exe 46COMPILETARGET = darwin
47LDOPTS += $(LDFLAGS_OSX)
48else
49COMPILETARGET = posix
44endif 50endif
45endif 51endif
46endif 52endif
53$(info Compiler creates $(COMPILETARGET) binaries)
47 54
48NATIVECC ?= gcc 55NATIVECC ?= gcc
49CC ?= gcc 56CC ?= gcc
50# OS X specifics. Needs to consider cross compiling for Windows. 57# OS X specifics. Needs to consider cross compiling for Windows.
51ifeq ($(findstring Darwin,$(shell uname)),Darwin) 58ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE)
52ifneq ($(findstring mingw,$(CROSS)$(CC)),mingw)
53# when building libs for OS X build for both i386 and ppc at the same time. 59# when building libs for OS X build for both i386 and ppc at the same time.
54# This creates fat objects, and ar can only create the archive but not operate 60# This creates fat objects, and ar can only create the archive but not operate
55# on it. As a result the ar call must NOT use the u (update) flag. 61# on it. As a result the ar call must NOT use the u (update) flag.
@@ -60,10 +66,9 @@ CC ?= gcc-4.0
60CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 66CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
61NATIVECC ?= gcc-4.0 67NATIVECC ?= gcc-4.0
62endif 68endif
63endif
64WINDRES = windres 69WINDRES = windres
65 70
66BUILD_DIR ?= $(TARGET_DIR)build 71BUILD_DIR ?= $(TARGET_DIR)build$(COMPILETARGET)
67OBJDIR = $(abspath $(BUILD_DIR)/$(RBARCH))/ 72OBJDIR = $(abspath $(BUILD_DIR)/$(RBARCH))/
68 73
69ifdef RBARCH 74ifdef RBARCH