library Makefiles
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的更多相关文章
- Objective-C关于数据处理
本文介绍如何在Objective-C中操作数据.我们将使用数组.指针.字符串等. 数组是数据项的一个集合,这些数据项叫做元素,我们可以用一个数组索引来引用元素.例如,如果把数字存储在一个名为array ...
- [Objective-C语言教程]开发环境设置(2)
如果要安装自己的Objective-C编程语言编程环境,则需要在计算机上安装文本编辑器和GCC编译器. 1. 文本编辑器 文本编辑器用于编写程序代码.一些常见的编辑器如:Windows Notepad ...
- Makefiles 介绍
http://www-personal.umich.edu/~ppannuto/writings/makefiles.html Makefiles Makefiles (or, the GNU aut ...
- Linux Kernel Makefiles Kbuild en
来自Linux kernel docs,顺便整理了一下排版 Linux Kernel Makefiles This document describes the Linux kernel Makefi ...
- 记一个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 ...
- 代码的坏味道(22)——不完美的库类(Incomplete Library Class)
坏味道--不完美的库类(Incomplete Library Class) 特征 当一个类库已经不能满足实际需要时,你就不得不改变这个库(如果这个库是只读的,那就没辙了). 问题原因 许多编程技术都建 ...
- 笔记:Memory Notification: Library Cache Object loaded into SGA
笔记:Memory Notification: Library Cache Object loaded into SGA在警告日志中发现一些这样的警告信息:Mon Nov 21 14:24:22 20 ...
- Android Studio2.1.2 Java8环境下引用Java Library编译出错
转载请注明出处:http://www.cnblogs.com/LT5505/p/5685242.html 问题:在Android Studio2.1.2+Java8的环境下,引用Java Librar ...
- 在数据库访问项目中使用微软企业库Enterprise Library,实现多种数据库的支持
在我们开发很多项目中,数据访问都是必不可少的,有的需要访问Oracle.SQLServer.Mysql这些常规的数据库,也有可能访问SQLite.Access,或者一些我们可能不常用的PostgreS ...
随机推荐
- Linux移植之tag参数列表解析过程分析
在Linux移植之内核启动过程start_kernel函数简析中已经指出了start_kernel函数的调用层次,这篇主要是对具体的tag参数列表进行解析. 1.内存参数ATAG_MEM参数解析 2. ...
- Linux系统中的tar命令
时间一长什么东西都容易忘记,尤其是一些不常用的东西忘记的更快,所以避免忘记,就记录下来,可以方面使用的时候查询.Tar命令在linux系统中算是一个比较重要的命令,今天就针对该命令进行总结一下. 1. ...
- nginx配置备忘
一.本地测试环境配置 upstream gongsibao{ server ; server ; #fair; } server { listen ; server_name ubuntu00.xus ...
- Samba简介与配置(匿名&本地用户验证)
Samba简介 Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成. 在此之前我们已经了解了NFS,NFS与samba一样,也是在网络中实现文件共享的一种实 ...
- Java 浮点数相加
刚刚遇到个需求,需要对金额求和,上线的时候才知道这时个,这个字段是个小数. 随手就改了个Double ,然后,跑下,没啥问题,直接上线了 然后,就fuck 了 加出一大堆的小数,大概是这样的 pack ...
- node.js获取参数的常用方法
1.req.body 2.req.query 3.req.params 一.req.body例子 body不是nodejs默认提供的,你需要载入body-parser中间件才可以使用req.body, ...
- fcitx4.2.0自定义中文标点符号
+fcitx 定制标点 http://forum.ubuntu.com.cn/viewtopic.PHP?t=376701&p=2755636 下载punc.mb.gz放到~/.config/ ...
- HDU 4309 Seikimatsu Occult Tonneru (状压 + 网络流)
题意:输入 n 个城市 m 条边,但是边有三种有向边 a b c d,第一种是 d 是 0,那么就是一条普通的路,可以通过无穷多人,如果 d < 0,那么就是隧道,这个隧道是可以藏 c 个人, ...
- 【python-appium】手机一直提示重新安装settings unlock 输入法等 注释掉以下代码
注释掉目录:C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js this.initUnic ...
- 使用root用户登录到AWS EC2服务器
首先是在putty中使用ec2-user登录服务器后,创建root账户的密码,使用如下命令: sudo passwd root 然后会提示你输入new password,输入之后回车,会让你retyp ...