OsmAnd/Osmand-kernel/osmand/Makefile

50 lines
1.4 KiB
Makefile
Raw Normal View History

2012-05-01 00:30:31 +02:00
LOCAL_PATH := .
PREBUILT_DIR = ../jni-prebuilt/linux-x86/
2012-04-30 15:58:02 +02:00
LIBNAME := osmand.lib
2012-05-01 01:43:09 +02:00
RUNFILE := osmand_main
include ./Common.mk
LOCAL_SRC_FILES += src/osmand_main.cpp
2012-04-30 15:58:02 +02:00
#LDFLAGS = -Wl,--hash-style=both -fPIC
LDFLAGS = -Wall -fPIC -Wl,-Bsymbolic
2012-05-01 01:43:09 +02:00
LDRUNFLAGS = -Wl,--hash-style=both
# --trace -Bsymbolic -Bsymbolic-functions
2012-05-01 01:43:09 +02:00
LDLIBS = -L$(PREBUILT_DIR) -lskia -lproto -lpthread -lrt -lft2 -lexpat -lz -lpng
2012-05-01 00:30:31 +02:00
CPP_FILE_EXTENSION = cpp
OBJECTS = $(LOCAL_SRC_FILES:src/%.$(CPP_FILE_EXTENSION)=build/obj/%.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
CPPFLAGS := \
-DGOOGLE_PROTOBUF_NO_RTTI \
-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0 \
-DSK_RELEASE \
-DGR_RELEASE=1 \
2012-05-12 18:27:59 +02:00
-c -fPIC -I$(JAVA_HOME)/include \
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-09 13:31:58 +02:00
target : $(PREBUILT_DIR)/$(LIBNAME)
#target : $(PREBUILT_DIR)/$(LIBNAME) ../$(RUNFILE)
2012-05-01 01:43:09 +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
$(PREBUILT_DIR)/$(LIBNAME) : build/$(LIBNAME)
2012-05-01 00:30:31 +02:00
cp build/$(LIBNAME) $(PREBUILT_DIR)/$(LIBNAME)
2012-04-30 15:58:02 +02:00
build/$(LIBNAME): $(OBJECTS) $(PREBUILT_DIR)/libskia.a $(PREBUILT_DIR)/libproto.a Makefile
$(CXX) -shared -o build/$(LIBNAME) $(OBJECTS) $(LDFLAGS) $(LDLIBS)
2012-05-01 00:30:31 +02:00
build/obj/%.o : src/%.$(CPP_FILE_EXTENSION) $(LOCAL_C_INCLUDES)
@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)