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 ...
随机推荐
- python shell的交互模式和文本编辑模式
之前学python的时候,是拿<笨办法学python>练习的. 书里面基本都是以.py文件去写代码,也就是文本编辑模式. 而交互模式(也就是powershell),唯有在input用户输入 ...
- 动态添加 SqlParameter 参数
List<SqlParameter> paras = new List<SqlParameter>(); paras.Add(new SqlParameter("@m ...
- face_recognition 模块安装
https://blog.csdn.net/qq_15192373/article/details/78623741 https://blog.csdn.net/roguesir/article/de ...
- c++ 计算cpu占用率
计算CPU占用率就是获取系统总的内核时间 用户时间及空闲时间 其中空闲时间就是内核空转 所以内核时间包含空闲时间 然后计算 运行时间 = 内核时间 加 用户时间 减去 空闲时间 间隔时间 = 内核时 ...
- PyCharm选择性忽略PEP8代码风格警告信息
用了几天的PyCharm,发现确实在编写Python代码上非常好用,但有一点体验不太好,就是代码编写时要按照PEP8代码风格编写,不然会有波浪线的警告信息.解决方法如下: 方法一: 将鼠标移到提示的地 ...
- Python12/11--盒子的显隐/布局/z-index/流式布局思想
1.盒子的显隐 display:none 在页面中不占位,采用定位布局后,显示隐藏都不会影响其他标签,不需要用动画处理时,一般用这个 opacoity : 0 在页面中占位,采 ...
- 2019.02.17 spoj Query on a tree V(链分治)
传送门 题意简述: 给你一棵nnn个黑白点的树,初始全是黑点. 现在支持给一个点换颜色或者求整颗树中离某个点最近的白点跟这个点的距离. 思路: 考虑链分治维护答案,每个链顶用一个堆来维护答案,然后对于 ...
- 走进JDK(六)------ArrayList
对于广大java程序员来说,ArrayList的使用是非常广泛的,但是发现很多工作了好几年的程序员不知道底层是啥...这我觉得对于以后的发展是非常不利的,因为java中的每种数据结构的设计都是非常完善 ...
- centos7升级系统内核
1)升级 方法一: rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org rpm -Uvh http://www.elrepo.or ...
- python_day1_数据类型
数据类型: python基本数据类型有:int(整型),str(字符串),list[](列表),dict{}(字典),li()(元祖)bool(布尔) 注:还有一个Long(长整型),python3里 ...