Lua loadable c library example (.so)
This commit is contained in:
parent
d089e583cd
commit
c40c698ece
3 changed files with 50 additions and 0 deletions
21
lua_lib/Makefile
Normal file
21
lua_lib/Makefile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
CC ?= gcc
|
||||
CFLAGS ?= -Wall -O2 -fPIC
|
||||
LDFLAGS ?=
|
||||
|
||||
TARGET = lookup3.so
|
||||
SRC = lua_lookup3.c
|
||||
OBJS = lua_lookup3.o lookup3.o
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(CC) -shared -o $@ $^ $(LDFLAGS)
|
||||
|
||||
lua_lookup3.o: $(SRC)
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
lookup3.o: ../lookup3.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) $(OBJS)
|
||||
Loading…
Add table
Add a link
Reference in a new issue