move examples into package (include them in published crate)
This commit is contained in:
parent
5514f60c28
commit
c92493fad1
22 changed files with 26 additions and 165 deletions
33
crates/servicepoint_binding_c/examples/lang_c/Makefile
Normal file
33
crates/servicepoint_binding_c/examples/lang_c/Makefile
Normal file
|
@ -0,0 +1,33 @@
|
|||
CC := gcc
|
||||
|
||||
THIS_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
REPO_ROOT := $(THIS_DIR)/../..
|
||||
|
||||
build: out/lang_c
|
||||
|
||||
clean:
|
||||
rm -r out
|
||||
rm include/servicepoint.h
|
||||
|
||||
run: out/lang_c
|
||||
out/lang_c
|
||||
|
||||
PHONY: build clean dependencies run
|
||||
|
||||
out/lang_c: dependencies src/main.c
|
||||
mkdir -p out || true
|
||||
${CC} src/main.c \
|
||||
-I include \
|
||||
-L $(REPO_ROOT)/target/release \
|
||||
-Wl,-Bstatic -lservicepoint_binding_c \
|
||||
-Wl,-Bdynamic -llzma \
|
||||
-o out/lang_c
|
||||
|
||||
dependencies: FORCE
|
||||
mkdir -p include || true
|
||||
# generate servicepoint header and binary to link against
|
||||
SERVICEPOINT_HEADER_OUT=$(THIS_DIR)/include cargo build \
|
||||
--manifest-path=$(REPO_ROOT)/crates/servicepoint_binding_c/Cargo.toml \
|
||||
--release
|
||||
|
||||
FORCE: ;
|
Loading…
Add table
Add a link
Reference in a new issue