OsmAnd/Osmand-kernel/Makefile.vars

98 lines
2.4 KiB
Text
Raw Normal View History

# Make default definitions
2012-06-05 09:30:57 +02:00
ifndef $(ARCH)
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
# Cygwin returns 'unknown'
ARCH := i386
else
ARCH := $(shell uname -i)
endif
2012-06-04 23:49:39 +02:00
endif
2012-06-05 09:30:57 +02:00
2012-06-04 23:49:39 +02:00
############################################
############# NACL ### TARGET
2012-06-04 09:13:33 +02:00
ifeq ($(TARGET),nacl)
ifndef NACL_SDK_ROOT
$(error Set NACL_SDK_ROOT environment variable)
endif
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
NACL_SDK_ROOT := $(shell cygpath -u "$(NACL_SDK_ROOT)")
endif
OSNAME:=$(shell python $(NACL_SDK_ROOT)/tools/getos.py)
NACL_TOOLCHAIN:=$(abspath $(NACL_SDK_ROOT)/toolchain/$(OSNAME)_x86_newlib)
CXX := $(NACL_TOOLCHAIN)/bin/i686-nacl-g++
CC := $(NACL_TOOLCHAIN)/bin/i686-nacl-gcc
AR := $(NACL_TOOLCHAIN)/bin/i686-nacl-ar
STATICLIB_EXT := a
DYNAMICLIB_EXT := nexe
LIBRARY_PREFIX := lib
LDLIBS += -lppapi_cpp -lppapi
GLOBAL_INCLUDES := -I../zlib/zlib_library -I$(NACL_TOOLCHAIN)/i686-nacl/usr/include
ZLIB_BUILD := defined
CFLAGS := -D__int64="long long"
CXXFLAGS := -D__int64="long long"
2012-05-15 20:48:06 +02:00
2012-06-04 09:13:33 +02:00
else
2012-06-04 23:49:39 +02:00
############################################
### EVERYTHING ELSE REQUIRES JAVA_HOME #####
2012-06-04 09:13:33 +02:00
ifndef JAVA_HOME
$(error Set JAVA_HOME environment variable)
2012-06-04 09:13:33 +02:00
endif
2012-06-04 23:49:39 +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 ($(shell uname),Linux)
TARGET := linux
endif
2012-05-15 20:48:06 +02:00
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
TARGET := windows
2012-05-15 20:48:06 +02:00
endif
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
TARGET := windows
2012-05-15 20:48:06 +02:00
endif
endif
2012-06-04 23:49:39 +02:00
############################################
####### Windows via MinGW/Linux and MinGW/Cygwin target
ifeq ($(TARGET),windows)
CXX := i686-w64-mingw32-g++
CC := i686-w64-mingw32-gcc
AR := i686-w64-mingw32-ar
GLOBAL_INCLUDES := -I../zlib/zlib_library
ZLIB_BUILD := defined
STATICLIB_EXT := lib
DYNAMICLIB_EXT := dll
LIBRARY_PREFIX := # empty
LDFLAGS := -Wl,--kill-at -static-libstdc++ -static-libgcc
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
# Latest MinGW compiler under Cygwin needs this
CFLAGS := -D__int64="long long"
CXXFLAGS := -D__int64="long long"
endif
2012-06-04 23:49:39 +02:00
############################################
####### DEFAULT LINUX ########## TARGET
else
CXX := g++
CC := gcc
STRIP := strip
STATICLIB_EXT := a
DYNAMICLIB_EXT := so
LIBRARY_PREFIX := lib
2012-06-04 09:13:33 +02:00
endif
2012-06-18 21:19:51 +02:00
ifeq ($(ARCH),i386)
CFLAGS += -m32
CXXFLAGS += -m32
LDFLAGS += -m32
else ifeq ($(ARCH),x86_64)
CFLAGS += -m64
CXXFLAGS += -m64
LDFLAGS += -m64
else
$(error Undefined ARCH $(ARCH))
endif
2012-06-04 23:49:39 +02:00
endif