.pre-build: mkdir -p lib/ SRC=./*.go DST=lib/libagent.so DST2=lib/libagent.a 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) 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) P.HONY: clean clean: rm -f lib/*