Skip to content

Commit

Permalink
增加static目录的拷贝
Browse files Browse the repository at this point in the history
  • Loading branch information
fruitbars committed Jul 12, 2024
1 parent e65e0b4 commit d01ee5a
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ build-linux-arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BUILD_DIR)/linux-arm64/$(BINARY_NAME)

build-freebsd-amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BUILD_DIR)/freebsd-amd64/$(BINARY_NAME)
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -o $(BUILD_DIR)/freebsd-amd64/$(BINARY_NAME)

build-freebsd-arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BUILD_DIR)/freebsd-arm64/$(BINARY_NAME)
CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -o $(BUILD_DIR)/freebsd-arm64/$(BINARY_NAME)

upx:
ifeq ($(use_upx),1)
Expand All @@ -56,56 +56,66 @@ compress:
@$(MAKE) --no-print-directory $(addprefix compress-,$(PLATFORMS))

compress-darwin-amd64:
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64.tar.gz -C $(BUILD_DIR)/darwin-amd64/ $(BINARY_NAME)
cp -r static $(BUILD_DIR)/darwin-amd64/
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64.tar.gz -C $(BUILD_DIR)/darwin-amd64/ $(BINARY_NAME) static
ifeq ($(clean_up),1)
rm -rf $(BUILD_DIR)/darwin-amd64
@echo "Removed build directory for darwin-amd64"
endif

compress-darwin-arm64:
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64.tar.gz -C $(BUILD_DIR)/darwin-arm64/ $(BINARY_NAME)
cp -r static $(BUILD_DIR)/darwin-arm64/
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64.tar.gz -C $(BUILD_DIR)/darwin-arm64/ $(BINARY_NAME) static
ifeq ($(clean_up),1)
rm -rf $(BUILD_DIR)/darwin-arm64
@echo "Removed build directory for darwin-arm64"
endif

compress-windows-amd64:
cp -r static $(BUILD_DIR)/windows-amd64/
zip -j $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.zip $(BUILD_DIR)/windows-amd64/$(BINARY_NAME).exe
zip -r $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.zip $(BUILD_DIR)/windows-amd64/static
ifeq ($(clean_up),1)
rm -rf $(BUILD_DIR)/windows-amd64
@echo "Removed build directory for windows-amd64"
endif

compress-windows-arm64:
cp -r static $(BUILD_DIR)/windows-arm64/
zip -j $(BUILD_DIR)/$(BINARY_NAME)-windows-arm64.zip $(BUILD_DIR)/windows-arm64/$(BINARY_NAME).exe
zip -r $(BUILD_DIR)/$(BINARY_NAME)-windows-arm64.zip $(BUILD_DIR)/windows-arm64/static
ifeq ($(clean_up),1)
rm -rf $(BUILD_DIR)/windows-arm64
@echo "Removed build directory for windows-arm64"
endif

compress-linux-amd64:
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64.tar.gz -C $(BUILD_DIR)/linux-amd64/ $(BINARY_NAME)
cp -r static $(BUILD_DIR)/linux-amd64/
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64.tar.gz -C $(BUILD_DIR)/linux-amd64/ $(BINARY_NAME) static
ifeq ($(clean_up),1)
rm -rf $(BUILD_DIR)/linux-amd64
@echo "Removed build directory for linux-amd64"
endif

compress-linux-arm64:
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64.tar.gz -C $(BUILD_DIR)/linux-arm64/ $(BINARY_NAME)
cp -r static $(BUILD_DIR)/linux-arm64/
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64.tar.gz -C $(BUILD_DIR)/linux-arm64/ $(BINARY_NAME) static
ifeq ($(clean_up),1)
rm -rf $(BUILD_DIR)/linux-arm64
@echo "Removed build directory for linux-arm64"
endif

compress-freebsd-amd64:
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-freebsd-amd64.tar.gz -C $(BUILD_DIR)/freebsd-amd64/ $(BINARY_NAME)
cp -r static $(BUILD_DIR)/freebsd-amd64/
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-freebsd-amd64.tar.gz -C $(BUILD_DIR)/freebsd-amd64/ $(BINARY_NAME) static
ifeq ($(clean_up),1)
rm -rf $(BUILD_DIR)/freebsd-amd64
@echo "Removed build directory for freebsd-amd64"
endif

compress-freebsd-arm64:
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-freebsd-arm64.tar.gz -C $(BUILD_DIR)/freebsd-arm64/ $(BINARY_NAME)
cp -r static $(BUILD_DIR)/freebsd-arm64/
tar -czvf $(BUILD_DIR)/$(BINARY_NAME)-freebsd-arm64.tar.gz -C $(BUILD_DIR)/freebsd-arm64/ $(BINARY_NAME) static
ifeq ($(clean_up),1)
rm -rf $(BUILD_DIR)/freebsd-arm64
@echo "Removed build directory for freebsd-arm64"
Expand Down

0 comments on commit d01ee5a

Please sign in to comment.