summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-15 02:36:55 +0800
committerDeterminant <[email protected]>2015-05-15 02:36:55 +0800
commitefb786d716363dde8f90ef0672f479790befc79c (patch)
tree1d7a6f07db9cae3fd65a437d3ca6ff398a2b684b /Makefile
parentb03471e2b0d604806773b540551cd047979b7b3b (diff)
use C macro to implement matrix template
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
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: