windwos 下編譯minicap


一、參考github 介紹:https://github.com/openstf/minicap

Requirements (前提)

  • NDK, Revision 10e (May 2015)
  • make  (http://gnuwin32.sourceforge.net/packages/make.htm ,Setup program 會自帶依賴庫文件)
  • android studio 下安裝。
  •  

Building(編譯)

We include libjpeg-turbo as a Git submodule, so first make sure you've fetched it.(在minicap目錄下執行git命令,如果沒有git可以下載。)

git submodule init  
git submodule update

You're now ready to proceed.

Building requires NDK, and is known to work with at least with NDK Revision 10e (May 2015). Older versions do not work due to the lack of .asm file support for x86_64.

Then it's simply a matter of invoking ndk-build. (最簡單的方式..\Android\sdk\ndk-bundle目錄下ndk-build.cmd)

ndk-build

You should now have the binaries available in ./libs. (執行結果所在目錄)

If you've modified the shared library, you'll also need to build that.(這個我還沒試)

Make 編譯cmd在minicap目錄下執行make。如果不熟悉make命令,可以參考:http://www.cnblogs.com/kissfu/p/6343967.html。

makefile文件做了一些windows 系統的適應。

.PHONY: default clean prebuilt test

NDKBUILT := \
    libs/arm64-v8a/minicap \
    libs/arm64-v8a/minicap-nopie \
    libs/armeabi-v7a/minicap \
    libs/armeabi-v7a/minicap-nopie \
    libs/x86/minicap \
    libs/x86/minicap-nopie \
    libs/x86_64/minicap \
    libs/x86_64/minicap-nopie \

default: prebuilt

clean:
    ndk-build clean
    rm -rf prebuilt

$(NDKBUILT):
    ndk-build
    
test:
    @if exist "prebuilt/armeabi-v7a/bin" echo "ddd"
    @if not exist "prebuilt/armeabi-v7a/bin1" echo "ddd1"

# It may feel a bit redundant to list everything here. However it also
# acts as a safeguard to make sure that we really are including everything
# that is supposed to be there.
prebuilt: \
    prebuilt/armeabi-v7a/bin/minicap \
    prebuilt/armeabi-v7a/bin/minicap-nopie \
    prebuilt/armeabi-v7a/lib/android-9/minicap.so \
    prebuilt/armeabi-v7a/lib/android-10/minicap.so \
    prebuilt/armeabi-v7a/lib/android-14/minicap.so \
    prebuilt/armeabi-v7a/lib/android-15/minicap.so \
    prebuilt/armeabi-v7a/lib/android-16/minicap.so \
    prebuilt/armeabi-v7a/lib/android-17/minicap.so \
    prebuilt/armeabi-v7a/lib/android-18/minicap.so \
    prebuilt/armeabi-v7a/lib/android-19/minicap.so \
    prebuilt/armeabi-v7a/lib/android-21/minicap.so \
    prebuilt/armeabi-v7a/lib/android-22/minicap.so \
    prebuilt/armeabi-v7a/lib/android-23/minicap.so \
    prebuilt/armeabi-v7a/lib/android-24/minicap.so \
    prebuilt/armeabi-v7a/lib/android-25/minicap.so \
    prebuilt/arm64-v8a/bin/minicap \
    prebuilt/arm64-v8a/bin/minicap-nopie \
    prebuilt/arm64-v8a/lib/android-21/minicap.so \
    prebuilt/arm64-v8a/lib/android-22/minicap.so \
    prebuilt/arm64-v8a/lib/android-23/minicap.so \
    prebuilt/arm64-v8a/lib/android-24/minicap.so \
    prebuilt/arm64-v8a/lib/android-25/minicap.so \
    prebuilt/x86/bin/minicap \
    prebuilt/x86/bin/minicap-nopie \
    prebuilt/x86/lib/android-14/minicap.so \
    prebuilt/x86/lib/android-15/minicap.so \
    prebuilt/x86/lib/android-16/minicap.so \
    prebuilt/x86/lib/android-17/minicap.so \
    prebuilt/x86/lib/android-18/minicap.so \
    prebuilt/x86/lib/android-19/minicap.so \
    prebuilt/x86/lib/android-21/minicap.so \
    prebuilt/x86/lib/android-22/minicap.so \
    prebuilt/x86/lib/android-23/minicap.so \
    prebuilt/x86/lib/android-24/minicap.so \
    prebuilt/x86/lib/android-25/minicap.so \
    prebuilt/x86_64/bin/minicap \
    prebuilt/x86_64/bin/minicap-nopie \
    prebuilt/x86_64/lib/android-21/minicap.so \
    prebuilt/x86_64/lib/android-22/minicap.so \
    prebuilt/x86_64/lib/android-23/minicap.so \
    prebuilt/x86_64/lib/android-24/minicap.so \
    prebuilt/x86_64/lib/android-25/minicap.so \

prebuilt/%/bin/minicap: libs\%\minicap
    if not exist "$(@D)" mkdir "$(@D)"
    copy "$^" "$@"

prebuilt/%/bin/minicap-nopie: libs\%\minicap-nopie
    if not exist "$(@D)" mkdir "$(@D)"
    copy "$^" "$@"

prebuilt/armeabi-v7a/lib/%/minicap.so: jni\minicap-shared\aosp\libs\%\armeabi-v7a\minicap.so
    if not exist "$(@D)" mkdir "$(@D)"
    copy "$^" "$@"

prebuilt/arm64-v8a/lib/%/minicap.so: jni\minicap-shared\aosp\libs\%/arm64-v8a\minicap.so #目標:前置條件("/"改為"\")
    if not exist "$(@D)" mkdir "$(@D)"  #路徑需要加引號,目標的目錄 如果不存在創建目錄。
    copy "$^" "$@"  #所有前置條件  目標 ,$(@D) 和 $(@F) 分別指向 $@ 的目錄名和文件名

prebuilt/x86/lib/%/minicap.so: jni\minicap-shared\aosp\libs\%\x86\minicap.so
    if not exist "$(@D)" mkdir "$(@D)"
    copy "$^" "$@"

prebuilt/x86_64/lib/%/minicap.so: jni\minicap-shared\aosp\libs\%\x86_64\minicap.so
    if not exist "$(@D)" mkdir "$(@D)"
    copy "$^" "$@"

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM