# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

LOCAL_PATH := $(call my-dir)


include $(CLEAR_VARS)
LOCAL_MODULE	:= zlib
OCAL_SRC_FILES := $(subst jni/, , $(wildcard $(LOCAL_PATH)/libzip/*.c)))
LOCAL_EXPORT_C_INCLUDES	:= $(LOCAL_PATH)/libzip
include $(BUILD_STATIC_LIBRARY)


include $(CLEAR_VARS)
LOCAL_MODULE	:= png
LOCAL_SRC_FILES := $(subst jni/, , $(wildcard $(LOCAL_PATH)/libpng/*.c)))
LOCAL_EXPORT_C_INCLUDES	:= $(LOCAL_PATH)/libpng
LOCAL_STATIC_LIBRARIES := zlib
include $(BUILD_STATIC_LIBRARY)


include $(CLEAR_VARS)
FREETYPE_SRC_PATH := freetype2/
LOCAL_MODULE := freetype2-static
LOCAL_CFLAGS := -DANDROID_NDK -DFT2_BUILD_LIBRARY=1
LOCAL_C_INCLUDES := \
	$(LOCAL_PATH)/$(FREETYPE_SRC_PATH)/include \
	$(LOCAL_PATH)/$(FREETYPE_SRC_PATH)/src
LOCAL_SRC_FILES := \
	$(FREETYPE_SRC_PATH)src/autofit/autofit.c \
	$(FREETYPE_SRC_PATH)src/base/basepic.c \
	$(FREETYPE_SRC_PATH)src/base/ftapi.c \
	$(FREETYPE_SRC_PATH)src/base/ftbase.c \
	$(FREETYPE_SRC_PATH)src/base/ftbbox.c \
	$(FREETYPE_SRC_PATH)src/base/ftbitmap.c \
	$(FREETYPE_SRC_PATH)src/base/ftdbgmem.c \
	$(FREETYPE_SRC_PATH)src/base/ftdebug.c \
	$(FREETYPE_SRC_PATH)src/base/ftglyph.c \
	$(FREETYPE_SRC_PATH)src/base/ftinit.c \
	$(FREETYPE_SRC_PATH)src/base/ftpic.c \
	$(FREETYPE_SRC_PATH)src/base/ftstroke.c \
	$(FREETYPE_SRC_PATH)src/base/ftsynth.c \
	$(FREETYPE_SRC_PATH)src/base/ftsystem.c \
	$(FREETYPE_SRC_PATH)src/cff/cff.c \
	$(FREETYPE_SRC_PATH)src/pshinter/pshinter.c \
	$(FREETYPE_SRC_PATH)src/psnames/psnames.c \
	$(FREETYPE_SRC_PATH)src/raster/raster.c \
	$(FREETYPE_SRC_PATH)src/sfnt/sfnt.c \
	$(FREETYPE_SRC_PATH)src/smooth/smooth.c \
	$(FREETYPE_SRC_PATH)src/truetype/truetype.c
LOCAL_LDLIBS := -ldl -llog
include $(BUILD_STATIC_LIBRARY)


include $(CLEAR_VARS)
LOCAL_MODULE    := sposmroute
LOCAL_CFLAGS := -DANDROID -DSPOSMROUTE -I$(LOCAL_PATH)/base -I$(LOCAL_PATH)/gui \
	-I$(LOCAL_PATH)/mapsys -I$(LOCAL_PATH)/main -I$(LOCAL_PATH)/draw \
	-I$(LOCAL_PATH)/libpng/ \
	-I$(LOCAL_PATH)/freetype2/include 
LOCAL_SRC_FILES := \
		main.c android_gfx.c android_font.c \
		base/config.c base/memoryleak.c base/system.c  base/vector.c \
		mapsys/map_area.c mapsys/map_hash.c mapsys/map_nodepois.c \
		mapsys/map_webload.c mapsys/map_searchhash.c\
		mapsys/map.c mapsys/map_loadsave.c mapsys/map_way.c \
		gui/gui.c \
		draw/draw.c draw/draw_favorites.c draw/draw_gps.c draw/draw_gui.c draw/draw_route.c \
		main/favorites.c main/gui_buttons.c main/gui_mainmenu.c main/guiw_gpsfile.c \
		main/main.c main/routing.c main/gps.c main/gui_favorites.c \
		main/gui_search.c main/linux_gps.c
# LOCAL_LDLIBS    := -shared -llog -landroid -lEGL -lGLESv1_CM -lz
LOCAL_LDLIBS    := -shared -llog -landroid -lEGL -lGLESv2 -lz
LOCAL_STATIC_LIBRARIES := android_native_app_glue zlib png freetype2-static
include $(BUILD_SHARED_LIBRARY)

$(call import-module,android/native_app_glue)

