2012-05-01 00:30:31 +02:00
|
|
|
LOCAL_PATH := .
|
2012-05-15 20:48:06 +02:00
|
|
|
include ../Makefile.vars
|
|
|
|
include ./Common.mk
|
2012-05-28 20:56:12 +02:00
|
|
|
PREBUILT_DIR = ../jni-prebuilt/$(os)-$(arch)
|
2012-04-30 15:58:02 +02:00
|
|
|
LIBNAME := osmand.lib
|
2012-05-15 21:32:29 +02:00
|
|
|
LIBOSNAME := osmand-$(os)-$(arch).lib
|
|
|
|
|
2012-05-01 01:43:09 +02:00
|
|
|
RUNFILE := osmand_main
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES += src/osmand_main.cpp
|
2012-04-30 15:58:02 +02:00
|
|
|
|
2012-05-11 00:35:08 +02:00
|
|
|
#LDFLAGS = -Wl,--hash-style=both -fPIC
|
|
|
|
LDFLAGS = -Wall -fPIC -Wl,-Bsymbolic
|
2012-05-28 20:56:12 +02:00
|
|
|
#LDRUNFLAGS = -Wl,--hash-style=both
|
2012-05-11 00:35:08 +02:00
|
|
|
# --trace -Bsymbolic -Bsymbolic-functions
|
2012-05-01 01:43:09 +02:00
|
|
|
|
2012-05-27 21:10:44 +02:00
|
|
|
LDLIBS = -L$(PREBUILT_DIR) -lskia -lproto -lpthread -lrt -lft2 -lexpat -lpng -lz
|
2012-05-01 00:30:31 +02:00
|
|
|
CPP_FILE_EXTENSION = cpp
|
2012-05-15 20:48:06 +02:00
|
|
|
OBJECTS = $(LOCAL_SRC_FILES:src/%.$(CPP_FILE_EXTENSION)=build/obj-$(os)-$(arch)/%.o)
|
2012-04-30 15:58:02 +02:00
|
|
|
|
2012-05-01 00:30:31 +02:00
|
|
|
C_INCLUDES := $(addprefix -I, $(LOCAL_C_INCLUDES))
|
2012-04-30 15:58:02 +02:00
|
|
|
|
2012-05-28 20:56:12 +02:00
|
|
|
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
|
|
|
|
FIXED_JAVA_HOME := $(shell cygpath -u "$(JAVA_HOME)")
|
|
|
|
else
|
|
|
|
FIXED_JAVA_HOME := $(JAVA_HOME)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(java_os),)
|
|
|
|
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
|
|
|
|
java_os := linux
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
|
|
|
|
java_os := win32
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(os),)
|
|
|
|
java_os := linux
|
|
|
|
endif
|
|
|
|
|
2012-04-30 15:58:02 +02:00
|
|
|
CPPFLAGS := \
|
|
|
|
-DGOOGLE_PROTOBUF_NO_RTTI \
|
|
|
|
-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0 \
|
|
|
|
-DSK_RELEASE \
|
|
|
|
-DGR_RELEASE=1 \
|
2012-05-28 20:56:12 +02:00
|
|
|
-c -fPIC -I"$(FIXED_JAVA_HOME)/include" -I"$(FIXED_JAVA_HOME)/include/$(java_os)" \
|
2012-05-01 20:49:45 +02:00
|
|
|
-DHASH_MAP_GNU \
|
2012-05-01 00:30:31 +02:00
|
|
|
$(C_INCLUDES)
|
2012-05-01 01:43:09 +02:00
|
|
|
|
2012-05-09 09:47:48 +02:00
|
|
|
#target : ../$(RUNFILE)
|
2012-05-27 21:10:44 +02:00
|
|
|
#target : $(PREBUILT_DIR)/$(LIBNAME)
|
|
|
|
target : $(PREBUILT_DIR)/$(LIBNAME) ../$(RUNFILE)
|
2012-05-01 01:43:09 +02:00
|
|
|
|
2012-05-11 00:35:08 +02:00
|
|
|
../$(RUNFILE) : $(OBJECTS) $(PREBUILT_DIR)/libskia.a $(PREBUILT_DIR)/libproto.a Makefile
|
2012-05-01 01:43:09 +02:00
|
|
|
$(CXX) $(LDRUNFLAGS) -o ../$(RUNFILE) $(OBJECTS) $(LDLIBS)
|
|
|
|
@chmod +x ../$(RUNFILE)
|
2012-04-30 15:58:02 +02:00
|
|
|
|
2012-05-15 21:32:29 +02:00
|
|
|
$(PREBUILT_DIR)/$(LIBNAME) : build/$(LIBOSNAME)
|
2012-05-28 20:56:12 +02:00
|
|
|
mkdir -p $(PREBUILT_DIR)
|
|
|
|
cp build/$(LIBOSNAME) $(PREBUILT_DIR)
|
2012-04-30 15:58:02 +02:00
|
|
|
|
2012-05-15 21:32:29 +02:00
|
|
|
build/$(LIBOSNAME): $(OBJECTS) $(PREBUILT_DIR)/libskia.a $(PREBUILT_DIR)/libproto.a Makefile
|
|
|
|
$(CXX) -shared -o build/$(LIBOSNAME) $(OBJECTS) $(LDFLAGS) $(LDLIBS)
|
2012-05-01 00:30:31 +02:00
|
|
|
|
2012-05-27 21:10:44 +02:00
|
|
|
build/obj-$(os)-$(arch)/%.o : src/%.$(CPP_FILE_EXTENSION) $(LOCAL_C_INCLUDES) src/textdraw.cpp
|
2012-05-01 00:30:31 +02:00
|
|
|
@mkdir -p `dirname $@`
|
|
|
|
$(CXX) -o $@ -c src/$*.$(CPP_FILE_EXTENSION) $(CPPFLAGS)
|
2012-04-30 15:58:02 +02:00
|
|
|
|
|
|
|
clean:
|
2012-05-01 00:30:31 +02:00
|
|
|
$(RM) $(OBJECTS) build/$(LIBNAME)
|