1 Star 16 Fork 1

nature-lang/parker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
weiwenhao 提交于 2023-09-20 18:41 . chore: makefile update
.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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
其他
1
https://gitee.com/nature-lang/parker.git
[email protected]:nature-lang/parker.git
nature-lang
parker
parker
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385