This is a sample project for demonstrating how to use makefile simply.
Linux(ARM), Windows, Android, MacOS, IOS
(1) Linux64位:
make -f Makefile_lib platform=x86_64 PUREC=1
make -f Makefile_demo platform=x86_64 PUREC=1
(2) linux32位:
make -f Makefile_lib platform=x86_32 PUREC=1
make -f Makefile_demo platform=x86_32 PUREC=1
(1) ARM32位:
make -f Makefile_lib platform=arm32 CROSS=arm-linux-androideabi- PUREC=1
make -f Makefile_demo platform=arm32 CROSS=arm-linux-androideabi- PUREC=1
(2) ARM64位:
make -f Makefile_lib platform=arm64 CROSS=aarch64-linux-android- PUREC=1
make -f Makefile_demo platform=arm64 CROSS=aarch64-linux-android- PUREC=1
(1) MacOS X86_64位:
make -f Makefile_lib target_plat=mac platform=x86_64 PUREC=1
make -f Makefile_demo target_plat=mac platform=x86_64 PUREC=1
(2) MacOS X86_32位:
make -f Makefile_lib target_plat=mac platform=x86_32 PUREC=1
make -f Makefile_demo target_plat=mac platform=x86_32 PUREC=1
(3) MacOS ARM64位(Apple Silicon):
make -f Makefile_lib target_plat=mac platform=arm64 PUREC=1
make -f Makefile_demo target_plat=mac platform=arm64 PUREC=1
(1) IOS32位:
make -f Makefile_lib target_plat=ios platform=ios32 PUREC=1
make -f Makefile_demo target_plat=ios platform=ios32 PUREC=1
(2) IOS64位:
make -f Makefile_lib target_plat=ios platform=ios64 PUREC=1
make -f Makefile_demo target_plat=ios platform=ios64 PUREC=1
(3) IOS Universal Pack:
cd ./build/ios
make -f Makefile_ios_pack
在android-ndk-r10e中执行如下命令:
(1)带优化编译:./ndk-build -B -C ~/MakefileSample\build\android PUREC=0
(2)纯C编译: ./ndk-build -B -C ~/MakefileSample\build\android PUREC=1
说明:android-ndk-r10e下载链接:https://blog.csdn.net/SoaringLee_fighting/article/details/106873454
(1)带优化编译: python build_andorid.py /home/myshare/android-ndk-r10e pure_c=0
(2)纯C编译: python build_andorid.py /home/myshare/android-ndk-r10e pure_c=1
./build_android.sh /home/myshare/android-ndk-r10e
cd ./build/windows
启动cmd:
build_vs2010.bat release Win32
build_vs2010.bat release x64
首先启动minGW和VC环境,运行msys_vs2010_win32.bat或msys_vs2010_win64.bat,
cd ./build/windowsmake
make -f Makefile_demo platform=win32
make -f Makefile_demo platform=x64
make -f Makefile_lib platform=mips64 CROSS=loongarch64-linux-gnu-
make -f Makefile_demo platform=mips64 CROSS=loongarch64-linux-gnu-
-
v1.0 2020.6.18 ---> 支持Windows和Linux平台的编译和汇编的编译;
-
v2.0 2020.6.22 ---> 支持ARM和macOS平台的编译;
-
v3.0 2020.6.23 ---> 支持Windows平台make编译;
-
v4.0 2020.8.1 ---> 支持git版本获取和命令行参数解析;
-
v4.1 2021.6.20 ---> 支持macOS平台arm64架构编译(Apple Silicon);
-
v5.0 2021.7.9 ---> 支持不同平台根据cpuflags自动设置汇编函数指针;