feat: add gz packing
This commit is contained in:
parent
a7783a83e2
commit
fdee77d778
1
.gitignore
vendored
1
.gitignore
vendored
@ -31,3 +31,4 @@ test
|
||||
# Build result
|
||||
*.zip
|
||||
*.xz
|
||||
*.gz
|
||||
|
6
Makefile
6
Makefile
@ -18,13 +18,14 @@ CC := $(NDK_TOOLCHAIN)/bin/$(TARGET_ARCH)-linux-$(TARGET_SDK)-clang
|
||||
TEST_OUTPUT = '$(shell cd $(BUILD_PATH) && ./test | head -c 12)'
|
||||
TEST_EXPECTED = '{"code":200,'
|
||||
|
||||
all:
|
||||
all: clean
|
||||
@BUILD_PATH=$(BUILD_PATH)/aarch64 TARGET_ARCH=aarch64 GOARCH=arm64 $(MAKE) -e shared
|
||||
@BUILD_PATH=$(BUILD_PATH)/armv7a TARGET_ARCH=armv7a GOARCH=arm TARGET_SDK=androideabi23 $(MAKE) -e shared
|
||||
@BUILD_PATH=$(BUILD_PATH)/i686 TARGET_ARCH=i686 GOARCH=amd64 $(MAKE) -e shared
|
||||
@BUILD_PATH=$(BUILD_PATH)/x86_64 TARGET_ARCH=x86_64 GOARCH=386 $(MAKE) -e shared
|
||||
rm -rf $(BUILD_PATH)/*/*.h
|
||||
cd $(BUILD_PATH) && xz -z -9 -k aarch64/* armv7a/* i686/* x86_64/*
|
||||
cd $(BUILD_PATH) && gzip -9 -k aarch64/* armv7a/* i686/* x86_64/*
|
||||
find $(BUILD_PATH) -mindepth 1 -maxdepth 1 -type d -exec mv {}/lib$(PROJECT_NAME).so.gz {}_lib$(PROJECT_NAME).so.gz \;; \
|
||||
cd $(BUILD_PATH) && zip -r -9 $(BUILD_PATH).zip aarch64 armv7a i686 x86_64
|
||||
shared: $(GO_SRC) dir tidy
|
||||
GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) NDK_TOOLCHAIN=$(NDK_TOOLCHAIN) CC=$(CC) go build -buildmode=c-shared -o $(BUILD_PATH)/lib$(PROJECT_NAME).so $(GO_SRC)
|
||||
@ -46,5 +47,6 @@ clean:
|
||||
rm -rf $(BUILD_PATH)/lib$(PROJECT_NAME).*; \
|
||||
rm -rf $(BUILD_PATH)/test; \
|
||||
rm -rf $(BUILD_PATH)/*.zip; \
|
||||
rm -rf $(BUILD_PATH)/*.gz; \
|
||||
find $(BUILD_PATH) -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;; \
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user