2012-05-15 20:48:06 +02:00
|
|
|
ifndef JAVA_HOME
|
|
|
|
$(error Set JAVA_HOME environment variable)
|
|
|
|
endif
|
|
|
|
|
2012-05-31 21:01:27 +02:00
|
|
|
ARCH := x86
|
2012-05-15 20:48:06 +02:00
|
|
|
|
2012-05-31 21:01:27 +02:00
|
|
|
############################################################################################################################
|
2012-05-15 20:48:06 +02:00
|
|
|
|
2012-05-31 21:01:27 +02:00
|
|
|
ifeq ($(TARGET),)
|
2012-05-15 20:48:06 +02:00
|
|
|
ifeq ($(shell uname),Darwin)
|
2012-05-31 21:01:27 +02:00
|
|
|
TARGET := darwin
|
2012-05-15 20:48:06 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
|
2012-05-31 21:01:27 +02:00
|
|
|
TARGET := cygwin
|
2012-05-15 20:48:06 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
|
2012-05-31 21:01:27 +02:00
|
|
|
TARGET := win
|
2012-05-15 20:48:06 +02:00
|
|
|
endif
|
|
|
|
endif
|
2012-05-31 21:01:27 +02:00
|
|
|
ifeq ($(TARGET),)
|
|
|
|
TARGET := linux
|
2012-05-15 20:48:06 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Windows uses different path separators, because they hate me
|
2012-05-31 21:01:27 +02:00
|
|
|
ifeq ($(TARGET),win)
|
2012-05-15 20:48:06 +02:00
|
|
|
sep := ;
|
|
|
|
else
|
|
|
|
sep := :
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# os=Default is meant to be generic unix/linux
|
2012-05-27 21:10:44 +02:00
|
|
|
linux_CXX := g++
|
2012-05-28 20:56:12 +02:00
|
|
|
linux_CC := gcc
|
2012-05-15 20:48:06 +02:00
|
|
|
linux_STRIP := strip
|
|
|
|
#Default_LINKFLAGS := -shared
|
|
|
|
|
|
|
|
#
|
|
|
|
Support10_4 := -isysroot /Developer/SDKs/MacOSX10.4u.sdk
|
|
|
|
darwin_CXX := gcc -arch $(arch) -mmacosx-version-min=10.4 $(Support10_4)
|
2012-05-28 20:56:12 +02:00
|
|
|
darwin_CC := gcc -arch $(arch) -mmacosx-version-min=10.4 $(Support10_4)
|
2012-05-15 20:48:06 +02:00
|
|
|
darwin_STRIP := strip -x
|
2012-05-15 21:32:29 +02:00
|
|
|
#darwin_CPP_FLAGS := strip -x
|
|
|
|
#darwin_LINKFLAGS := -dynamiclib $(Support10_4)
|
2012-05-15 20:48:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
win_CXX := i586-mingw32msvc-gcc
|
2012-05-28 20:56:12 +02:00
|
|
|
win_CC := i586-mingw32msvc-gcc
|
2012-05-15 20:48:06 +02:00
|
|
|
win_STRIP := i586-mingw32msvc-strip
|
2012-05-15 21:32:29 +02:00
|
|
|
win_CPP_FLAGS := -D_Windows
|
|
|
|
#win_CFLAGS := -D_JNI_IMPLEMENTATION_ -Ilib/inc_win -I$(JAVA_HOME)/include -O
|
|
|
|
#win_LINKFLAGS := -Wl,--kill-at -shared
|
2012-05-31 21:01:27 +02:00
|
|
|
############################################################################################################################
|
2012-05-15 20:48:06 +02:00
|
|
|
|
2012-05-31 21:01:27 +02:00
|
|
|
### Cygwin target ###
|
|
|
|
cygwin_CXX := i686-pc-cygwin-g++
|
|
|
|
cygwin_CC := i686-pc-cygwin-gcc
|
|
|
|
cygwin_STRIP := i686-pc-cygwin-strip
|
|
|
|
cygwin_LDFLAGS := -Wl,--kill-at
|
|
|
|
cygwin_CFLAGS := -D__int64="long long" -D_JNI_IMPLEMENTATION -D_REENTRANT -D_GNU_SOURCE
|
|
|
|
cygwin_CXXFLAGS := -D__int64="long long" -D_JNI_IMPLEMENTATION -D_REENTRANT -D_GNU_SOURCE
|
|
|
|
cygwin_STATICLIB_EXT := lib
|
|
|
|
cygwin_DYNAMICLIB_EXT := dll
|
|
|
|
cygwin_LIBRARY_PREFIX := # empty
|
|
|
|
|
|
|
|
# Publish chosen settings as global
|
|
|
|
CXX := $($(TARGET)_CXX)
|
|
|
|
CC := $($(TARGET)_CC)
|
|
|
|
STRIP := $($(TARGET)_STRIP)
|
|
|
|
CFLAGS := $($(TARGET)_CFLAGS)
|
|
|
|
CXXFLAGS := $($(TARGET)_CXXFLAGS)
|
|
|
|
LDFLAGS := $($(TARGET)_LDFLAGS)
|
|
|
|
STATICLIB_EXT := $($(TARGET)_STATICLIB_EXT)
|
|
|
|
DYNAMICLIB_EXT := $($(TARGET)_DYNAMICLIB_EXT)
|
|
|
|
LIBRARY_PREFIX := $($(TARGET)_LIBRARY_PREFIX)
|