mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-19 02:20:12 +01:00
1dad113ca1
- From instead of Into - unsafe_data_ref for other payloads - CByteSlice for returning memory spans - send Packet instead of Into<Packet> - expose packet layer to C/C#
22 lines
613 B
Makefile
22 lines
613 B
Makefile
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
OUT_DIR := ${ROOT_DIR}/out
|
|
|
|
SP2_DIR := ${ROOT_DIR}/../../servicepoint2
|
|
SP2_INCLUDE := ${ROOT_DIR}/../../servicepoint2-binding-c
|
|
SP2_TARGET_RELEASE := ${SP2_DIR}/target/release
|
|
|
|
.PHONY: build run clean
|
|
|
|
all: ${OUT_DIR}/lang_c
|
|
|
|
run: ${OUT_DIR}/lang_c
|
|
out/lang_c
|
|
|
|
clean:
|
|
rm -r ${OUT_DIR} || true
|
|
rm -r ${SP2_TARGET_RELEASE} || true
|
|
|
|
${OUT_DIR}/lang_c: main.c
|
|
cd ${SP2_DIR} && cargo build --release --all-features
|
|
mkdir -p ${OUT_DIR}
|
|
gcc main.c -I ${SP2_INCLUDE} -L ${SP2_TARGET_RELEASE} -Wl,-Bstatic -lservicepoint2 -Wl,-Bdynamic -o ${OUT_DIR}/lang_c
|