diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c29f743f..34f9810f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,7 @@ jobs: env: { GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" } run: ./ci/deps.sh - name: 构建 - run: make runtime layout + run: make shm - name: 测试 + env: { KVSPACE: "shm:///tmp/kvlang_ci" } run: python3 tutorial/test.py diff --git a/Makefile b/Makefile index 32535e28..18c95429 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ # make shm 链 kvspace-c 后端(SHM,默认,= all 的后端组件) # make durable 链 kvspace_durable 后端(redis/fs/s3) # make test durable 后端全量 tutorial 回归 +# make install 一次性安装产物到最终态目录(.so→/usr/lib,可执行→/usr/bin,头→/usr/include/kvlang/) # make all 全部(shm 后端 + json) # make clean 清理 bin/ 与各构建目录 # 切换后端只需 make shm / make durable:runtime 经 cmake 重配、layout 经环境变量重建。 @@ -14,7 +15,7 @@ BIN := bin KVSPACE_LIB ?= kvspace-c -.PHONY: all runtime term layout json oldhero shm durable test clean +.PHONY: all runtime term layout json oldhero shm durable test install clean all: runtime term layout json @@ -36,8 +37,16 @@ term: layout: KVLANG_KVSPACE_LIB=$(KVSPACE_LIB) cargo build --release --manifest-path layout/Cargo.toml --example layout_file + KVLANG_KVSPACE_LIB=$(KVSPACE_LIB) cargo build --release --manifest-path layout/Cargo.toml cp layout/target/release/examples/layout_file $(BIN)/ +install: + install -d /usr/lib /usr/bin /usr/include/kvlang + install -m 755 $(BIN)/libkvlang_runtime.so /usr/lib/ + install -m 755 layout/target/release/libkvlang_layout.so /usr/lib/ + install -m 755 $(BIN)/kvlang $(BIN)/layout_file /usr/bin/ + install -m 644 runtime/include/kvlang_runtime.h runtime/include/kvlang_rwirext.h /usr/include/kvlang/ + json: ifeq ($(KVSPACE_LIB),kvspace_durable) cd runtime-rwirext_example/go/json && CGO_LDFLAGS="-L$(CURDIR)/../kvspace-durable/target/release -lkvspace_durable -Wl,--disable-new-dtags -Wl,-rpath,$(CURDIR)/../kvspace-durable/target/release" go build -o ../../../bin/json-rwirext ./cmd/ diff --git a/README.md b/README.md index fd2cecb7..8deb2204 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # kvlang [![CI](https://github.com/array2d/kvlang/actions/workflows/ci.yml/badge.svg)](https://github.com/array2d/kvlang/actions/workflows/ci.yml) -[![Go Version](https://img.shields.io/badge/Go-1.24+-00ADD8?logo=go)](https://go.dev/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Tutorial Examples](https://img.shields.io/badge/tutorials-140%20examples-4c1)](tutorial/) diff --git a/README_CN.md b/README_CN.md index a630d1ca..56661404 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,7 +1,6 @@ # kvlang [![CI](https://github.com/array2d/kvlang/actions/workflows/ci.yml/badge.svg)](https://github.com/array2d/kvlang/actions/workflows/ci.yml) -[![Go Version](https://img.shields.io/badge/Go-1.24+-00ADD8?logo=go)](https://go.dev/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Tutorial Examples](https://img.shields.io/badge/tutorials-140%20examples-4c1)](tutorial/)