ifndef JAVA_HOME $(error Set JAVA_HOME environment variable) endif ARCH := x86 ############################################################################################################################ ifeq ($(TARGET),) ifeq ($(shell uname),Darwin) TARGET := darwin endif ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) TARGET := cygwin endif ifeq ($(findstring MINGW,$(shell uname)),MINGW) TARGET := win endif endif ifeq ($(TARGET),) TARGET := linux endif # Windows uses different path separators, because they hate me ifeq ($(TARGET),win) sep := ; else sep := : endif # os=Default is meant to be generic unix/linux linux_CXX := g++ linux_CC := gcc linux_STRIP := strip linux_STATICLIB_EXT := a linux_DYNAMICLIB_EXT := so linux_LIBRARY_PREFIX := lib linux_LDFLAGS := -Wl,-Bsymbolic #Default_LINKFLAGS := -shared # Support10_4 := -isysroot /Developer/SDKs/MacOSX10.4u.sdk darwin_CXX := gcc -arch $(arch) -mmacosx-version-min=10.4 $(Support10_4) darwin_CC := gcc -arch $(arch) -mmacosx-version-min=10.4 $(Support10_4) darwin_STRIP := strip -x #darwin_CPP_FLAGS := strip -x #darwin_LINKFLAGS := -dynamiclib $(Support10_4) win_CXX := i586-mingw32msvc-gcc win_CC := i586-mingw32msvc-gcc win_STRIP := i586-mingw32msvc-strip win_CPP_FLAGS := -D_Windows #win_CFLAGS := -D_JNI_IMPLEMENTATION_ -Ilib/inc_win -I$(JAVA_HOME)/include -O #win_LINKFLAGS := -Wl,--kill-at -shared ############################################################################################################################ ### 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)