本帖最后由 mmmmar 于 2016-6-4 14:29 编辑
我这还有个
[C] 纯文本查看 复制代码 NDK_ROOT=E:\android-ndk-r10e(你的ndk路径)
TOOLCHAINS_ROOT=$(NDK_ROOT)\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64
TOOLCHAINS_PREFIX=$(TOOLCHAINS_ROOT)\bin\aarch64-linux-android
TOOLCHAINS_INCLUDE=$(TOOLCHAINS_ROOT)\lib\gcc\aarch64-linux-android\4.9\include-fixed
PLATFORM_ROOT=$(NDK_ROOT)\platforms\android-21\arch-arm64
PLATFORM_INCLUDE=$(PLATFORM_ROOT)\usr\include
PLATFORM_LIB=$(PLATFORM_ROOT)\usr\lib
CC := $(TOOLCHAINS_PREFIX)-gcc
FLAGS=-I$(TOOLCHAINS_INCLUDE) \
-I$(PLATFORM_INCLUDE) \
-L$(PLATFORM_LIB) \
-fPIC \
-shared \
-llog \
MODULE_NAME=hello
CFLAGS = -Wall -g
LDFLAGS = -llog -shared
SRC =hello.c(需要编译的文件)
EXE =librusteze.so
all:
$(CC) -S $(MODULE_NAME).c $(FLAGS) -o $(MODULE_NAME).s
$(CC) $(MODULE_NAME).c $(FLAGS) -o lib$(MODULE_NAME).so
$(TOOLCHAINS_PREFIX)-strip lib$(MODULE_NAME).so
clean:
$(RM) $(MODULE_NAME).i $(MODULE_NAME).s $(MODULE_NAME).o $(EXE)
|