Makefile 1.26 KB
Newer Older
Lei Li's avatar
Lei Li committed
1
2
3
4
.pre-build:
	mkdir -p lib/
SRC=./*.go
DST=lib/libagent.so
Lei Li's avatar
Lei Li committed
5
DST2=lib/libagent.a
Lei Li's avatar
Lei Li committed
6
7
8
9
10
11
12
13
x86:
	export GOARCH=amd64 GOOS=linux GO111MODULE=on CGO_ENABLED=1 && go build -buildmode=c-shared -o $(DST) $(SRC)

arm:
	export GOARCH=arm GOOS=linux GO111MODULE=on CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc  && go build -buildmode=c-shared -o $(DST) $(SRC)

android:
	export GOARCH=arm GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi19-clang && go build -buildmode=c-shared -o $(DST) $(SRC)
Lei Li's avatar
Lei Li committed
14
15
16
17
18
19
20
21
22
android-64:
	export GOARCH=arm64 GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang && go build -buildmode=c-shared -o $(DST) $(SRC)


android-static:
	export GOARCH=arm GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi19-clang && go build -buildmode=c-shared -o $(DST2) $(SRC)

android-static-64:
	export GOARCH=arm64 GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang && go build -buildmode=c-shared -o $(DST2) $(SRC)
Lei Li's avatar
Lei Li committed
23

Lei Li's avatar
Lei Li committed
24
P.HONY: clean
Lei Li's avatar
Lei Li committed
25
26
clean:
	rm -f lib/*