libpng library Makefile

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LS_C=$(subst $(1)/,,$(wildcard $(1)/*.c))

LOCAL_MODULE := png
LOCAL_SRC_FILES := \
$(filter-out example.c pngtest.c,$(call LS_C,$(LOCAL_PATH)))
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_LDLIBS := -lz include $(BUILD_STATIC_LIBRARY)

Here, the libpng library Makefile selects all the C files with the help of a custom macro LS_C. This macro is invoked from the LOCAL_SRC_FILES directive. We exclude example.c and pngtest.c, which are just test files, using the standard "Make" function filter-out().

All the prerequisites include files that are made available to client modules with the directive LOCAL_EXPORT_C_INCLUDES, which refers to the source directory LOCAL_PATH here. The prerequisite libraries like libzip (op on -lz) are also provided to the client modules using the LOCAL_EXPORT_LDLIBS directive this time. All directives containing the _EXPORT_ term exports directives that are appended to the client module's own directives.

[注] 在 Properties->C/C++ General->Paths and Symbols->Add $ANDROID_NDK/sources/libpng/ 时需加上 "is a workspace path" 选择框,否则会出现诸如 Function png_read_image can not resoloved 这样的 sematic error。

Box2D Makefile

 LOCAL_PATH:= $(call my-dir)

 LS_CPP=$(subst $(1)/,,$(wildcard $(1)/$(2)/*.cpp))
BOX2D_CPP:= $(call LS_CPP,$(LOCAL_PATH),Box2D/Collision) \
$(call LS_CPP,$(LOCAL_PATH),Box2D/Collision/Shapes) \
$(call LS_CPP,$(LOCAL_PATH),Box2D/Common) \
$(call LS_CPP,$(LOCAL_PATH),Box2D/Dynamics) \
$(call LS_CPP,$(LOCAL_PATH),Box2D/Dynamics/Contacts) \
$(call LS_CPP,$(LOCAL_PATH),Box2D/Dynamics/Joints) \
$(call LS_CPP,$(LOCAL_PATH),Box2D/Rope) include $(CLEAR_VARS) LOCAL_MODULE := box2d_static
LOCAL_SRC_FILES := $(BOX2D_CPP)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_C_INCLUDES := $(LOCAL_EXPORT_C_INCLUDES) include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := box2d_shared
LOCAL_SRC_FILES := $(BOX2D_CPP)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_C_INCLUDES := $(LOCAL_EXPORT_C_INCLUDES) include $(BUILD_SHARED_LIBRARY)

[注] 编译 Box2D 前需在 Box2D/Common/b2GrowableStack.h 文件中加上 #include <string.h>

Boost  修正后的 user-config.jam

 # Copyright ,  Douglas Gregor
# Copyright John Maddock
# Copyright , , , Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # This file is used to configure your Boost.Build installation. You can modify
# this file in place, or you can place it in a permanent location so that it
# does not get overwritten should you get a new version of Boost.Build. See:
#
# http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html
#
# for documentation about possible permanent locations. # This file specifies which toolsets (C++ compilers), libraries, and other
# tools are available. Often, you should be able to just uncomment existing
# example lines and adjust them to taste. The complete list of supported tools,
# and configuration instructions can be found at:
#
# http://boost.org/boost-build2/doc/html/bbv2/reference/tools.html
# # This file uses Jam language syntax to describe available tools. Mostly,
# there are 'using' lines, that contain the name of the used tools, and
# parameters to pass to those tools -- where paremeters are separated by
# semicolons. Important syntax notes:
#
# - Both ':' and ';' must be separated from other tokens by whitespace
# - The '\' symbol is a quote character, so when specifying Windows paths you
# should use '/' or '\\' instead.
#
# More details about the syntax can be found at:
#
# http://boost.org/boost-build2/doc/html/bbv2/advanced.html#bbv2.advanced.jam_language
# # ------------------
# GCC configuration.
# ------------------ # Configure gcc (default version).
# using gcc ; # Configure specific gcc version, giving alternative name to use.
# using gcc : 3.2 : g++-3.2 ; # -------------------
# MSVC configuration.
# ------------------- # Configure msvc (default version, searched for in standard locations and PATH).
# using msvc ; # Configure specific msvc version (searched for in standard locations and PATH).
# using msvc : 8.0 ; # ----------------------
# Borland configuration.
# ----------------------
# using borland ; # ----------------------
# STLPort configuration.
# ---------------------- # Configure specifying location of STLPort headers. Libraries must be either
# not needed or available to the compiler by default.
# using stlport : : /usr/include/stlport ; # Configure specifying location of both headers and libraries explicitly.
# using stlport : : /usr/include/stlport /usr/lib ; # -----------------
# QT configuration.
# ----------------- # Configure assuming QTDIR gives the installation prefix.
# using qt ; # Configure with an explicit installation prefix.
# using qt : /usr/opt/qt ; # ---------------------
# Python configuration.
# --------------------- # Configure specific Python version.
# using python : 3.1 : /usr/bin/python3 : /usr/include/python3. : /usr/lib ; import feature ;
import os ; if [ os.name ] = CYGWIN || [ os.name ] = NT {
androidPlatform = windows ;
} else if [ os.name ] = LINUX {
if [ os.platform ] = X86_64 {
androidPlatform = linux-x86_64 ;
} else {
androidPlatform = linux-x86 ;
}
} else if [ os.name ] = MACOSX {
androidPlatform = darwin-x86_64 ;
} modules.poke : NO_BZIP2 : ;
android_ndk = [ os.environ ANDROID_NDK ] ; # Compilation: ./b2 --without-python toolset=gcc-android4.9_armeabi link=static runtime-link=static target-os=linux architecture=arm --stagedir=android-armeabi threading=multi
using gcc : android4.9_armeabi :
$(android_ndk)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-g++ :
<archiver>$(android_ndk)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ar
<ranlib>$(android_ndk)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ranlib
<compileflags>--sysroot=$(android_ndk)/platforms/android-/arch-arm
<compileflags>-I$(android_ndk)/sources/cxx-stl/gnu-libstdc++/4.9/include
<compileflags>-I$(android_ndk)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include
<compileflags>-fexceptions
<compileflags>-frtti
<compileflags>-march=armv5te
<compileflags>-mthumb
<compileflags>-mtune=xscale
<compileflags>-msoft-float
<compileflags>-fno-strict-aliasing
<compileflags>-finline-limit=
<compileflags>-D__arm__
<compileflags>-D__ARM_ARCH_5__
<compileflags>-D__ARM_ARCH_5T__
<compileflags>-D__ARM_ARCH_5E__
<compileflags>-D__ARM_ARCH_5TE__
<compileflags>-MMD
<compileflags>-MP
<compileflags>-MF
<compileflags>-fpic
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-fstack-protector
<compileflags>-no-canonical-prefixes
<compileflags>-Os
<compileflags>-fomit-frame-pointer
<compileflags>-fno-omit-frame-pointer
<compileflags>-DANDROID
<compileflags>-D__ANDROID__
<compileflags>-DNDEBUG
<compileflags>-D__GLIBC__
<compileflags>-DBOOST_ASIO_DISABLE_STD_ATOMIC
<compileflags>-D_GLIBCXX__PTHREADS
<compileflags>-Wa,--noexecstack
<compileflags>-Wformat
<compileflags>-Werror=format-security
<compileflags>-lstdc++
<compileflags>-Wno-long-long
; # Compilation: ./b2 --without-python toolset=gcc-android4.6_armeabiv7a link=static runtime-link=static target-os=linux architecture=arm --stagedir=android-armeabi-v7a threading=multi
using gcc : android4.6_armeabiv7a :
$(android_ndk)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-g++ :
<archiver>$(android_ndk)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ar
<ranlib>$(android_ndk)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ranlib
<compileflags>--sysroot=$(android_ndk)/platforms/android-/arch-arm
<compileflags>-I$(android_ndk)/sources/cxx-stl/gnu-libstdc++/4.9/include
<compileflags>-I$(android_ndk)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include
<compileflags>-fexceptions
<compileflags>-frtti
<compileflags>-march=armv7-a
<compileflags>-marm
<compileflags>-mthumb
<compileflags>-mfpu=vfpv3-d16
<compileflags>-mfloat-abi=softfp
<compileflags>-fno-strict-aliasing
<compileflags>-finline-limit=
<compileflags>-D__arm__
<compileflags>-D__ARM_ARCH_7__
<compileflags>-D__ARM_ARCH_7A__
<compileflags>-D__ARM_ARCH_7R__
<compileflags>-D__ARM_ARCH_7M__
<compileflags>-D__ARM_ARCH_7EM__
<compileflags>-D__ARM_ARCH_7S__
<compileflags>-MMD
<compileflags>-MP
<compileflags>-MF
<compileflags>-fpic
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-fstack-protector
<compileflags>-no-canonical-prefixes
<compileflags>-Os
<compileflags>-fomit-frame-pointer
<compileflags>-fno-omit-frame-pointer
<compileflags>-DANDROID
<compileflags>-D__ANDROID__
<compileflags>-DNDEBUG
<compileflags>-D__GLIBC__
<compileflags>-DBOOST_ASIO_DISABLE_STD_ATOMIC
<compileflags>-D_GLIBCXX__PTHREADS
<compileflags>-Wa,--noexecstack
<compileflags>-Wformat
<compileflags>-Werror=format-security
<compileflags>-lstdc++
<compileflags>-Wno-long-long
; # Compilation: ./b2 --without-python toolset=gcc-android4.9_x86 link=static runtime-link=static target-os=linux architecture=x86 --stagedir=android-x86 threading=multi
using gcc : android4.9_x86 :
$(android_ndk)/toolchains/x86-4.9/prebuilt/$(androidPlatform)/bin/i686-linux-android-g++ :
<archiver>$(android_ndk)/toolchains/x86-4.9/prebuilt/$(androidPlatform)/bin/i686-linux-android-ar
<ranlib>$(android_ndk)/toolchains/x86-4.9/prebuilt/$(androidPlatform)/bin/i686-linux-android-ranlib
<compileflags>--sysroot=$(android_ndk)/platforms/android-/arch-x86
<compileflags>-I$(android_ndk)/sources/cxx-stl/gnu-libstdc++/4.9/include
<compileflags>-I$(android_ndk)/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include
<compileflags>-fexceptions
<compileflags>-frtti
<compileflags>-fstrict-aliasing
<compileflags>-funswitch-loops
<compileflags>-finline-limit=
<compileflags>-MMD
<compileflags>-MP
<compileflags>-MF
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-fstack-protector
<compileflags>-no-canonical-prefixes
<compileflags>-Os
<compileflags>-fomit-frame-pointer
<compileflags>-fno-omit-frame-pointer
<compileflags>-DANDROID
<compileflags>-D__ANDROID__
<compileflags>-DNDEBUG
<compileflags>-D__GLIBC__
<compileflags>-DBOOST_ASIO_DISABLE_STD_ATOMIC
<compileflags>-D_GLIBCXX__PTHREADS
<compileflags>-Wa,--noexecstack
<compileflags>-Wformat
<compileflags>-Werror=format-security
<compileflags>-lstdc++
<compileflags>-Wno-long-long
;

library Makefiles的更多相关文章

  1. Objective-C关于数据处理

    本文介绍如何在Objective-C中操作数据.我们将使用数组.指针.字符串等. 数组是数据项的一个集合,这些数据项叫做元素,我们可以用一个数组索引来引用元素.例如,如果把数字存储在一个名为array ...

  2. [Objective-C语言教程]开发环境设置(2)

    如果要安装自己的Objective-C编程语言编程环境,则需要在计算机上安装文本编辑器和GCC编译器. 1. 文本编辑器 文本编辑器用于编写程序代码.一些常见的编辑器如:Windows Notepad ...

  3. Makefiles 介绍

    http://www-personal.umich.edu/~ppannuto/writings/makefiles.html Makefiles Makefiles (or, the GNU aut ...

  4. Linux Kernel Makefiles Kbuild en

    来自Linux kernel docs,顺便整理了一下排版 Linux Kernel Makefiles This document describes the Linux kernel Makefi ...

  5. 记一个mvn奇怪错误: Archive for required library: 'D:/mvn/repos/junit/junit/3.8.1/junit-3.8.1.jar' in project 'xxx' cannot be read or is not a valid ZIP file

    我的maven 项目有一个红色感叹号, 而且Problems 存在 errors : Description Resource Path Location Type Archive for requi ...

  6. 代码的坏味道(22)——不完美的库类(Incomplete Library Class)

    坏味道--不完美的库类(Incomplete Library Class) 特征 当一个类库已经不能满足实际需要时,你就不得不改变这个库(如果这个库是只读的,那就没辙了). 问题原因 许多编程技术都建 ...

  7. 笔记:Memory Notification: Library Cache Object loaded into SGA

    笔记:Memory Notification: Library Cache Object loaded into SGA在警告日志中发现一些这样的警告信息:Mon Nov 21 14:24:22 20 ...

  8. Android Studio2.1.2 Java8环境下引用Java Library编译出错

    转载请注明出处:http://www.cnblogs.com/LT5505/p/5685242.html 问题:在Android Studio2.1.2+Java8的环境下,引用Java Librar ...

  9. 在数据库访问项目中使用微软企业库Enterprise Library,实现多种数据库的支持

    在我们开发很多项目中,数据访问都是必不可少的,有的需要访问Oracle.SQLServer.Mysql这些常规的数据库,也有可能访问SQLite.Access,或者一些我们可能不常用的PostgreS ...

随机推荐

  1. 简述Python入门小知识

    如今的Python开发工程师很受企业和朋友们的青睐,现在学习Python开发的小伙伴也很多,本篇文章就和大家探讨一下Python入门小知识都有哪些. 扣丁学堂简述Python入门小知识Python培训 ...

  2. [网络流]Farm Tour(费用流

    Farm Tour 题目描述 When FJ's friends visit him on the farm, he likes to show them around. His farm compr ...

  3. Available Captures for Rook LT999

    On an 8 x 8 chessboard, there is one white rook.  There also may be empty squares, white bishops, an ...

  4. linux虚拟机配置上网(静态IP)和配置tomcat服务环境

    常用命令:vi或者vim编辑 ,按i编辑模式,按ecs进入基本模式,按 :w  保存:按 :wq  退出并保存:mv移动::q退出 :ln -sv apache-tomcat-8.0.24 tomca ...

  5. C# Form Chart X刻度左右多余一格怎么去掉

    如上图所示:形成的chart,1和8时y没有值,我实际给的也是2~7的数,可视1和8的刻度却在,怎么去掉,谢谢. 解决方法:chart1.ChartAreas[0].AxisX.IsMarginVis ...

  6. 第四次spring会议

    昨天:对TXT的字体颜色和背景进行了代码编写. 出现的问题:在网上找到如何编写代码后,自己打进去了,输出不出来.少打了一个空格在EventArgs e之间. 今天将做之事: 我设置上换肤和透明度等功能 ...

  7. AX_SysExcel

    void KTL_CPeng_ImportCustStamp()  {      str                 file;      FileNameFilter      filter = ...

  8. python_day12_css

    目录: 简介 选择器(selecttor) 常用属性 页面布局 一.简介 1.CSS 定义 CSS是Cascading Style Sheets的简称,中文称为层叠样式表. CSS 规则由两个主要的部 ...

  9. 学习:java集合

    java是一种可以撰写跨平台应用软件的面向对象的程序设计语言,是由Sun Microsystems公司于1995年5月推出的Java程序设计语言和Java平台(即JavaEE, JavaME, Jav ...

  10. 2019.02.17 spoj Query on a tree VI(链分治)

    传送门 题意简述:给你一棵nnn个黑白点的树,支持改一个点的颜色,询问跟某个点颜色相同的连通块大小. 思路: 还是链分治 233 记fi,0/1f_{i,0/1}fi,0/1​表示iii的所有颜色为0 ...