2024-05-12 20:25:06 +02:00
|
|
|
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
2024-05-12 21:14:23 +02:00
|
|
|
OUT_DIR := ${ROOT_DIR}/out
|
|
|
|
|
2024-05-25 11:16:37 +02:00
|
|
|
SP2_DIR := ${ROOT_DIR}/../../servicepoint
|
|
|
|
SP2_INCLUDE := ${ROOT_DIR}/../../servicepoint-binding-c
|
2024-05-15 20:34:51 +02:00
|
|
|
SP2_TARGET_RELEASE := ${SP2_DIR}/target/release
|
2024-05-12 20:25:06 +02:00
|
|
|
|
2024-05-12 21:33:47 +02:00
|
|
|
.PHONY: build run clean
|
|
|
|
|
2024-05-15 20:34:51 +02:00
|
|
|
all: ${OUT_DIR}/lang_c
|
2024-05-12 20:25:06 +02:00
|
|
|
|
|
|
|
run: ${OUT_DIR}/lang_c
|
|
|
|
out/lang_c
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -r ${OUT_DIR} || true
|
2024-05-12 21:33:47 +02:00
|
|
|
rm -r ${SP2_TARGET_RELEASE} || true
|
|
|
|
|
|
|
|
${OUT_DIR}/lang_c: main.c
|
|
|
|
cd ${SP2_DIR} && cargo build --release --all-features
|
|
|
|
mkdir -p ${OUT_DIR}
|
2024-05-25 11:16:37 +02:00
|
|
|
gcc main.c -I ${SP2_INCLUDE} -L ${SP2_TARGET_RELEASE} -Wl,-Bstatic -lservicepoint -Wl,-Bdynamic -o ${OUT_DIR}/lang_c
|