OsmAnd/Osmand-kernel/Makefile.vars

129 lines
3.5 KiB
Text
Raw Normal View History

2012-06-04 09:13:33 +02:00
ifeq ($(TARGET),nacl)
ifndef NACL_SDK_ROOT
$(error Set NACL_SDK_ROOT environment variable)
2012-05-15 20:48:06 +02:00
endif
2012-06-04 09:13:33 +02:00
#
# Disable DOS PATH warning when using Cygwin based tools Windows
#
CYGWIN ?= nodosfilewarning
export CYGWIN
OSNAME:=$(shell python $(NACL_SDK_ROOT)/tools/getos.py)
# Turns on warnings (-Wxxx), builds with zero optimization (-O0) and adds debug
# information (-g) for correctness and ease of debugging.
WARNINGS:=-Wno-long-long -Wall
TC_PATH:=$(abspath $(NACL_SDK_ROOT)/toolchain/$(OSNAME)_x86_newlib)
2012-05-15 20:48:06 +02:00
2012-06-04 09:13:33 +02:00
nacl_CFLAGS:=-pthread $(WARNINGS)
nacl_CXXFLAGS:=-pthread -std=gnu++98 $(WARNINGS)
nacl_CXX:=$(TC_PATH)/bin/i686-nacl-g++
nacl_CC:=$(TC_PATH)/bin/i686-nacl-gcc
nacl_STATICLIB_EXT := a
nacl_DYNAMICLIB_EXT := nexe
nacl_LIBRARY_PREFIX := lib
nacl_LDFLAGS := -lppapi
nacl_GLOBAL_INCLUDES=-I$(TC_PATH)/i686-nacl/usr/include
ifeq ($(ARCH),)
2012-05-31 21:01:27 +02:00
ARCH := x86
2012-06-04 09:13:33 +02:00
endif
ifeq ($(ARCH),x86)
nacl_CFLAGS += -m32
nacl_CXXFLAGS += -m32
nacl_LDFLAGS += -m32
else ifeq ($(ARCH),x64)
nacl_CFLAGS += -m64
nacl_CXXFLAGS += -m64
nacl_LDFLAGS += -m64
else
$(error Undefined ARCH $(ARCH))
endif
2012-05-15 20:48:06 +02:00
2012-06-04 09:13:33 +02:00
else
ifndef JAVA_HOME
$(error Set JAVA_HOME environment variable)
endif
ARCH := x86
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
2012-06-04 09:13:33 +02:00
endif
2012-05-15 20:48:06 +02:00
2012-06-04 09:13:33 +02:00
###########################################
2012-05-15 20:48:06 +02:00
# 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
2012-05-31 23:14:56 +02:00
linux_STATICLIB_EXT := a
linux_DYNAMICLIB_EXT := so
linux_LIBRARY_PREFIX := lib
2012-06-04 09:13:33 +02:00
linux_LDFLAGS := -shared -Wl,-Bsymbolic
2012-05-15 20:48:06 +02:00
#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
2012-06-04 21:18:50 +02:00
win_STATICLIB_EXT := a
win_DYNAMICLIB_EXT := dll
win_LIBRARY_PREFIX := lib
win_LDFLAGS := -shared -Wl,-Bsymbolic
2012-05-15 21:32:29 +02:00
#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
2012-06-04 09:13:33 +02:00
cygwin_LDFLAGS := -shared -Wl,--kill-at
2012-05-31 21:01:27 +02:00
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)
2012-06-04 09:13:33 +02:00
LDFLAGS := $($(TARGET)_LDFLAGS)
GLOBAL_INCLUDES=$($(TARGET)_GLOBAL_INCLUDES)
2012-05-31 21:01:27 +02:00
STATICLIB_EXT := $($(TARGET)_STATICLIB_EXT)
DYNAMICLIB_EXT := $($(TARGET)_DYNAMICLIB_EXT)
LIBRARY_PREFIX := $($(TARGET)_LIBRARY_PREFIX)