Skip to content

Instantly share code, notes, and snippets.

@sanderversluys
Last active December 17, 2015 16:58
Show Gist options
  • Save sanderversluys/5642270 to your computer and use it in GitHub Desktop.
Save sanderversluys/5642270 to your computer and use it in GitHub Desktop.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include jni/libobj/Android.mk
include jni/libpng/Android.mk
include jni/libzip/Android.mk
include jni/freetype/Android.mk
include jni/ftgles/Android.mk
include jni/qcar/Android.mk
include jni/imagetargets/Android.mk
# Build both ARMv5TE and ARMv7-A machine code.
APP_ABI := armeabi armeabi-v7a
# Set target Android API level to the application's minimum SDK version.
APP_PLATFORM := android-10
APP_STL := stlport_static
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
# compile in ARM mode, since the glyph loader/renderer is a hotspot
# when loading complex pages in the browser
#
#LOCAL_ARM_MODE := arm
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/builds \
$(LOCAL_PATH)/include
LOCAL_SRC_FILES:= \
src/base/ftbbox.c \
src/base/ftbitmap.c \
src/base/ftglyph.c \
src/base/ftstroke.c \
src/base/ftxf86.c \
src/base/ftbase.c \
src/base/ftsystem.c \
src/base/ftinit.c \
src/base/ftgasp.c \
src/raster/raster.c \
src/sfnt/sfnt.c \
src/smooth/smooth.c \
src/autofit/autofit.c \
src/truetype/truetype.c \
src/cff/cff.c \
src/psnames/psnames.c \
src/pshinter/pshinter.c \
src/type1/type1.c \
src/cid/type1cid.c \
src/pfr/pfr.c \
src/type42/type42.c \
src/winfonts/winfnt.c \
src/pcf/pcf.c \
src/psaux/psaux.c \
src/bdf/bdf.c \
src/gzip/ftgzip.c \
src/lzw/ftlzw.c
LOCAL_CFLAGS += -DFT2_BUILD_LIBRARY
LOCAL_MODULE := freetype
LOCAL_LDLIBS := -ldl -llog
include $(BUILD_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
###########################
#
# FTGLES shared library
#
###########################
include $(CLEAR_VARS)
LOCAL_MODULE := FTGLES
LOCAL_CFLAGS := -I$(LOCAL_PATH)/../freetype/include
LOCAL_C_INCLUDES := $(LOCAL_PATH)/src \
$(LOCAL_PATH)/src/iGLU-1.0.0/include
LOCAL_SRC_FILES := \
src/FTBuffer.cpp \
src/FTCharmap.cpp \
src/FTContour.cpp \
src/FTFace.cpp \
src/FTFont/FTBitmapFont.cpp \
src/FTFont/FTBufferFont.cpp \
src/FTFont/FTFont.cpp \
src/FTFont/FTFontGlue.cpp \
src/FTFont/FTOutlineFont.cpp \
src/FTFont/FTPixmapFont.cpp \
src/FTFont/FTPolygonFont.cpp \
src/FTFont/FTTextureFont.cpp \
src/FTGL/ftglesGlue.cpp \
src/FTGlyph/FTBitmapGlyph.cpp \
src/FTGlyph/FTBufferGlyph.cpp \
src/FTGlyph/FTGlyph.cpp \
src/FTGlyph/FTGlyphGlue.cpp \
src/FTGlyph/FTOutlineGlyph.cpp \
src/FTGlyph/FTPixmapGlyph.cpp \
src/FTGlyph/FTPolygonGlyph.cpp \
src/FTGlyph/FTTextureGlyph.cpp \
src/FTGlyphContainer.cpp \
src/FTLayout/FTLayout.cpp \
src/FTLayout/FTLayoutGlue.cpp \
src/FTLayout/FTSimpleLayout.cpp \
src/FTLibrary.cpp \
src/FTPoint.cpp \
src/FTSize.cpp \
src/FTVectoriser.cpp \
src/iGLU-1.0.0/libtess/dict.c \
src/iGLU-1.0.0/libtess/geom.c \
src/iGLU-1.0.0/libtess/memalloc.c \
src/iGLU-1.0.0/libtess/mesh.c \
src/iGLU-1.0.0/libtess/normal.c \
src/iGLU-1.0.0/libtess/priorityq.c \
src/iGLU-1.0.0/libtess/render.c \
src/iGLU-1.0.0/libtess/sweep.c \
src/iGLU-1.0.0/libtess/tess.c \
src/iGLU-1.0.0/libtess/tessmono.c \
src/iGLU-1.0.0/libutil/error.c \
src/iGLU-1.0.0/libutil/glue.c \
src/iGLU-1.0.0/libutil/project.c \
src/iGLU-1.0.0/libutil/registry.c
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DFTGL_LIBRARY_STATIC
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog
LOCAL_STATIC_LIBRARIES := freetype
#include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# The LOCAL_MODULE variable must be defined to identify each module you
# describe in your Android.mk. The name must be *unique* and not contain
# any spaces. Note that the build system will automatically add proper
# prefix and suffix to the corresponding generated file. In other words,
# a shared library module named 'foo' will generate 'libfoo.so'.
LOCAL_MODULE := ImageTargets
# The variable USE_OPENGL_ES_1_1 determines the OpenGL ES API version
# to use. If set to true, OpenGL ES 1.1 is used, otherwise OpenGL ES 2.0.
USE_OPENGL_ES_1_1 := true
# Set OpenGL ES version-specific settings.
ifeq ($(USE_OPENGL_ES_1_1), true)
OPENGLES_LIB := -lGLESv1_CM
OPENGLES_DEF := -DUSE_OPENGL_ES_1_1
else
OPENGLES_LIB := -lGLESv2
OPENGLES_DEF := -DUSE_OPENGL_ES_2_0
endif
# An optional set of compiler flags that will be passed when building
# C and C++ source files.
#
# The flag "-Wno-write-strings" removes warnings about deprecated conversion
# from string constant to 'char*'.
# The flag "-Wno-psabi" removes warning about "mangling of 'va_list' has
# changed in GCC 4.4" when compiled with certain Android NDK versions.
LOCAL_CFLAGS := -Wno-write-strings -Wno-psabi $(OPENGLES_DEF)
# The list of additional linker flags to be used when building your
# module. Use the "-l" prefix in front of the name of libraries you want to
# link to your module.
LOCAL_LDLIBS += $(OPENGLES_LIB)
LOCAL_LDLIBS += -llog
LOCAL_LDLIBS += -landroid
LOCAL_LDLIBS += -ldl
LOCAL_LDLIBS += -lz
LOCAL_STATIC_LIBRARIES := libobj libzip libpng
# The list of shared libraries this module depends on at runtime.
# This information is used at link time to embed the corresponding information
# in the generated file. Here we reference the prebuilt library defined earlier
# in this makefile.
LOCAL_SHARED_LIBRARIES := QCAR-prebuilt FTGLES
# The LOCAL_SRC_FILES variables must contain a list of C/C++ source files
# that will be built and assembled into a module. Note that you should not
# list header file and included files here because the build system will
# compute dependencies automatically for you, just list the source files
# that will be passed directly to a compiler.
LOCAL_SRC_FILES := ImageTargets.cpp SampleUtils.cpp Texture.cpp
# By default, ARM target binaries will be generated in 'thumb' mode, where
# each instruction is 16-bit wide. You can set this variable to 'arm' to
# set the generation of the module's object files to 'arm' (32-bit
# instructions) mode, resulting in potentially faster yet somewhat larger
# binary code.
LOCAL_ARM_MODE := arm
# BUILD_SHARED_LIBRARY is a variable provided by the build system that
# points to a GNU Makefile script being in charge of collecting all the
# information you have defined in LOCAL_XXX variables since the latest
# 'include $(CLEAR_VARS)' statement, determining what and how to build.
# Replace it with the statement BUILD_STATIC_LIBRARY to generate a static
# library instead.
include $(BUILD_SHARED_LIBRARY)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE:= libobj
LOCAL_MODULE_FILENAME := libobj
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../
LOCAL_CFLAGS := -Werror -Wall -O4
LOCAL_SRC_FILES := Mesh.cpp MeshUtil.cpp zip_fgets.cpp
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lz
include $(BUILD_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS :=
LOCAL_MODULE := libpng
LOCAL_SRC_FILES :=\
png.c \
pngerror.c \
pngget.c \
pngmem.c \
pngpread.c \
pngread.c \
pngrio.c \
pngrtran.c \
pngrutil.c \
pngset.c \
pngtrans.c \
pngwio.c \
pngwrite.c \
pngwtran.c \
pngwutil.c
LOCAL_LDLIBS := -lz
#include $(BUILD_SHARED_LIBRARY)
include $(BUILD_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libzip
LOCAL_SRC_FILES :=\
zip_add.c \
zip_add_dir.c \
zip_close.c \
zip_delete.c \
zip_dirent.c \
zip_entry_free.c \
zip_entry_new.c \
zip_err_str.c \
zip_error.c \
zip_error_clear.c \
zip_error_get.c \
zip_error_get_sys_type.c \
zip_error_strerror.c \
zip_error_to_str.c \
zip_fclose.c \
zip_file_error_clear.c \
zip_file_error_get.c \
zip_file_get_offset.c \
zip_file_strerror.c \
zip_filerange_crc.c \
zip_fopen.c \
zip_fopen_index.c \
zip_fread.c \
zip_free.c \
zip_get_archive_comment.c \
zip_get_archive_flag.c \
zip_get_file_comment.c \
zip_get_num_files.c \
zip_get_name.c \
zip_memdup.c \
zip_name_locate.c \
zip_new.c \
zip_open.c \
zip_rename.c \
zip_replace.c \
zip_set_archive_comment.c \
zip_set_archive_flag.c \
zip_set_file_comment.c \
zip_source_buffer.c \
zip_source_file.c \
zip_source_filep.c \
zip_source_free.c \
zip_source_function.c \
zip_source_zip.c \
zip_set_name.c \
zip_stat.c \
zip_stat_index.c \
zip_stat_init.c \
zip_strerror.c \
zip_unchange.c \
zip_unchange_all.c \
zip_unchange_archive.c \
zip_unchange_data.c
LOCAL_LDLIBS := -lz
include $(BUILD_STATIC_LIBRARY)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := QCAR-prebuilt
LOCAL_SRC_FILES = ../../../../Development/libs/vuforia/vuforia-sdk-android-2-0-31/build/lib/$(TARGET_ARCH_ABI)/libQCAR.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../Development/libs/vuforia/vuforia-sdk-android-2-0-31/build/include
include $(PREBUILT_SHARED_LIBRARY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment