From a774bfc860471ac880a9b33bbe68761ec9187caf Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 14 May 2015 08:08:32 +0800 Subject: init --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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) -- cgit v1.2.3-70-g09d2