代码拉取完成,页面将自动刷新
.PHONY: all amd64 arm64 install package
TARGET_DIR=$(PWD)/build/parker/bin
all: amd64 arm64
amd64:
@echo "Building for amd64 using nature build..."
mkdir -p $(TARGET_DIR)
npkg sync
BUILD_OS=linux BUILD_ARCH=amd64 nature build -o $(TARGET_DIR)/parker parker.n
BUILD_OS=linux BUILD_ARCH=amd64 nature build -o $(TARGET_DIR)/runner runner.n
@make copy-version
arm64:
@echo "Building for arm64 using go build..."
mkdir -p $(TARGET_DIR)
cd parkergo && go mod download
cd parkergo && GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o $(TARGET_DIR)/parker main.go
cd parkergo && GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o $(TARGET_DIR)/runner runner/main.go
@make copy-version
install:
@echo "Installing..."
mkdir -p /usr/local/parker
cp -r build/parker/* /usr/local/parker/
package:
@echo "Packaging..."
@test "$(ARCH)" || (echo "Error: ARCH is not set. Please set it like 'make package ARCH=amd64'" && exit 1)
$(eval VERSION=$(shell cat VERSION))
mkdir -p releases
cd build && tar -czvf parker-$(VERSION)-linux-$(ARCH).tar.gz parker
mv build/parker-$(VERSION)-linux-$(ARCH).tar.gz releases/
@echo "Packaging done."
copy-version:
@echo "Copying VERSION to build..."
cp VERSION build/parker
cp LICENSE build/parker
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。