OsmAnd/Osmand-kernel/osmand/Makefile

48 lines
1.3 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
2012-05-01 00:30:31 +02:00
LDFLAGS = -Wl,--hash-style=both -shared
2012-05-01 01:43:09 +02:00
LDRUNFLAGS = -Wl,--hash-style=both
2012-05-08 10:47:42 +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
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-01 20:49:45 +02:00
-c -Fpic -I$(JAVA_HOME)/include \
-DHASH_MAP_GNU \
2012-05-01 00:30:31 +02:00
$(C_INCLUDES)
2012-05-01 01:43:09 +02:00
target : ../$(RUNFILE)
#target : $(PREBUILT_DIR)/$(LIBNAME) ../$(RUNFILE)
../$(RUNFILE) : $(OBJECTS) $(PREBUILT_DIR)/libskia.a $(PREBUILT_DIR)/libproto.a
$(CXX) $(LDRUNFLAGS) -o ../$(RUNFILE) $(OBJECTS) $(LDLIBS)
@chmod +x ../$(RUNFILE)
2012-04-30 15:58:02 +02:00
2012-05-01 01:43:09 +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
2012-05-01 00:30:31 +02:00
build/$(LIBNAME): $(OBJECTS) $(PREBUILT_DIR)/libskia.a $(PREBUILT_DIR)/libproto.a
$(CXX) $(LDFLAGS) -o build/$(LIBNAME) $(OBJECTS) $(LDLIBS)
strip build/$(LIBNAME)
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)