diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..659774c --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +.PHONY: all clean +OBJS := oop_example.o nerv.o luaT.o +INCLUDE := -I luajit-2.0/build/include/luajit-2.0/ -DLUA_USE_APICHECK +LDFLAGS := -L luajit-2.0/build/lib/ -llua -lm +OBJ_DIR := build/objs +OBJS := $(addprefix $(OBJ_DIR)/,$(OBJS)) +all: libnerv.so +$(OBJS): $(OBJ_DIR) +$(OBJ_DIR): + -mkdir -p $(OBJ_DIR) +$(OBJ_DIR)/%.o: %.c + gcc -c -o $@ $< $(INCLUDE) -fPIC +$(OBJ_DIR)/luaT.o: + gcc -c -o $@ luaT/luaT.c $(INCLUDE) -fPIC +libnerv.so: $(OBJS) + gcc -shared -o $(OBJ_DIR)/$@ $(OBJS) +clean: + -rm -rf $(OBJ_DIR) |