From efb786d716363dde8f90ef0672f479790befc79c Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 15 May 2015 02:36:55 +0800 Subject: use C macro to implement matrix template --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 55510a7..75e1317 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: all clean luajit -OBJS := oop_example.o nerv.o luaT.o common.o matrix.o +OBJS := oop_example.o nerv.o luaT.o common.o matrix/matrix.o matrix/init.o LIBS := libnerv.so -LUA_LIBS := matrix.lua +LUA_LIBS := matrix/matrix.lua INCLUDE := -I build/luajit-2.0/include/luajit-2.0/ -DLUA_USE_APICHECK LDFLAGS := -L luajit-2.0/build/lib/ -llua -lm CFLAGS := @@ -17,10 +17,14 @@ luajit: ./build_luajit.sh $(OBJ_DIR): -mkdir -p $(OBJ_DIR) + -mkdir -p $(OBJ_DIR)/matrix + -mkdir -p $(LUA_DIR)/matrix $(LUA_DIR): -mkdir -p $(LUA_DIR) $(OBJ_DIR)/%.o: %.c gcc -c -o $@ $< $(INCLUDE) -fPIC $(CFLAGS) +$(OBJ_DIR)/matrix/%.o: matrix/%.c + gcc -c -o $@ $< $(INCLUDE) -fPIC $(CFLAGS) $(LUA_DIR)/%.lua: %.lua cp $< $@ $(OBJ_DIR)/luaT.o: -- cgit v1.2.3-70-g09d2