aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-14 15:01:55 +0800
committerDeterminant <[email protected]>2015-05-14 15:01:55 +0800
commitf48dc493b5b77fd4e4472dd6c78b7542a4884129 (patch)
tree0b7a0f95df28fc100fc1fd252ce1d0215d19150d /Makefile
parent46ccec6d5ad057476e945afa34981f7e8d732547 (diff)
add basic matrix implementation
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index e638b96..55510a7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,28 @@
.PHONY: all clean luajit
-OBJS := oop_example.o nerv.o luaT.o
+OBJS := oop_example.o nerv.o luaT.o common.o matrix.o
LIBS := libnerv.so
+LUA_LIBS := 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 :=
OBJ_DIR := build/objs
+LUA_DIR := build/lua
+
OBJS := $(addprefix $(OBJ_DIR)/,$(OBJS))
LIBS := $(addprefix $(OBJ_DIR)/,$(LIBS))
-all: luajit $(OBJ_DIR) $(LIBS)
+LUA_LIBS := $(addprefix $(LUA_DIR)/,$(LUA_LIBS))
+
+all: luajit $(OBJ_DIR) $(LIBS) $(LUA_DIR) $(LUA_LIBS)
luajit:
./build_luajit.sh
$(OBJ_DIR):
-mkdir -p $(OBJ_DIR)
+$(LUA_DIR):
+ -mkdir -p $(LUA_DIR)
$(OBJ_DIR)/%.o: %.c
- gcc -c -o $@ $< $(INCLUDE) -fPIC
+ gcc -c -o $@ $< $(INCLUDE) -fPIC $(CFLAGS)
+$(LUA_DIR)/%.lua: %.lua
+ cp $< $@
$(OBJ_DIR)/luaT.o:
gcc -c -o $@ luaT/luaT.c $(INCLUDE) -fPIC
$(LIBS): $(OBJS)