From a7783a83e2e7ccb14322fc31703283b2fa12bfb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:54:02 +0900 Subject: [PATCH] feat: add xz packing --- .gitignore | 1 + Makefile | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 497a115..19efca2 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ test # Build result *.zip +*.xz diff --git a/Makefile b/Makefile index bbed4f3..332b8c5 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ all: @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) && 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) @@ -44,4 +45,6 @@ clean: @if [ -d "$(BUILD_PATH)" ]; then \ rm -rf $(BUILD_PATH)/lib$(PROJECT_NAME).*; \ rm -rf $(BUILD_PATH)/test; \ + rm -rf $(BUILD_PATH)/*.zip; \ + find $(BUILD_PATH) -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;; \ fi