feat: add ffi c
This commit is contained in:
16
__ffi/c2/Makefile
Normal file
16
__ffi/c2/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
.PHONY: clean
|
||||
|
||||
libcfunctions.so: cfunctions.o
|
||||
${CC} --shared -o $@ $<
|
||||
|
||||
cfunctions.o: cfunctions.h cfunctions.c
|
||||
${CC} -fPIC -o $@ -c cfunctions.c -I.
|
||||
|
||||
something: something.rs libcfunctions.so
|
||||
rustc -L. -lcfunctions something.rs -C link-arg='-Wl,-rpath,${PWD}'
|
||||
@# The command below can be used if the library to link with is
|
||||
@# specified in something.rs.
|
||||
@#rustc -L. something.rs -C link-arg='-Wl,-rpath,${PWD}'
|
||||
clean:
|
||||
${RM} libcfunctions.so cfunctions.o something
|
||||
|
||||
Reference in New Issue
Block a user