Added NIF -> FFI bridge

This commit is contained in:
Josh Nussbaum
2015-09-21 18:50:41 -04:00
parent 6ffa064069
commit ecfb01a3fe
3 changed files with 154 additions and 0 deletions

18
Makefile Normal file
View File

@@ -0,0 +1,18 @@
CC=gcc
CFLAGS=
OBJ = ffi_nif.o
TARGET = ffi_nif.so
LIBS += -ldl -lffi
ERTS_INCLUDE_PATH=/home/josh/Playground/erlangs/erts-6.0/include
DIR=c_src
$(DIR)/%.o: $(DIR)/%.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS) -I$(ERTS_INCLUDE_PATH)
$(TARGET): $(DIR)/$(OBJ)
$(CC) -shared -o $@ $^ $(CFLAGS) $(LIBS)
.PHONY : $(TARGET)
clean :
$(RM) $(DIR)/*.o *.so