From 1c4a84ff6fabaa78e4c1ed2263d57bd2c79c48a5 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 30 May 2015 15:57:13 +0800 Subject: move the destination of .so files to build/lib --- Makefile | 15 +++++++++------ nerv | 2 +- speech | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 5ba68da..b4ba715 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ .PHONY: all clean luajit +BUILD_DIR := $(CURDIR)/build OBJS := nerv.o luaT.o common.o \ matrix/mmatrix.o matrix/cumatrix.o matrix/init.o matrix/cukernel.o \ io/init.o io/param.o \ @@ -13,8 +14,9 @@ CUDA_INCLUDE := -I $(CUDA_BASE)/include/ INCLUDE += $(CUDA_INCLUDE) LDFLAGS := -L$(CUDA_BASE)/lib64/ -Wl,-rpath=$(CUDA_BASE)/lib64/ -lcudart -lcublas CFLAGS := -Wall -Wextra -OBJ_DIR := build/objs -LUA_DIR := build/lua +OBJ_DIR := $(BUILD_DIR)/objs +LUA_DIR := $(BUILD_DIR)/lua +LIB_DIR := $(BUILD_DIR)/lib SUBDIR := matrix io layer examples pl NVCC := $(CUDA_BASE)/bin/nvcc NVCC_FLAGS := -Xcompiler -fPIC,-Wall,-Wextra @@ -22,13 +24,13 @@ NVCC_FLAGS := -Xcompiler -fPIC,-Wall,-Wextra OBJS := $(addprefix $(OBJ_DIR)/,$(OBJS)) OBJ_SUBDIR := $(addprefix $(OBJ_DIR)/,$(SUBDIR)) LUA_SUBDIR := $(addprefix $(LUA_DIR)/,$(SUBDIR)) -LIBS := $(addprefix $(OBJ_DIR)/,$(LIBS)) +LIBS := $(addprefix $(BUILD_DIR)/lib/,$(LIBS)) LUA_LIBS := $(addprefix $(LUA_DIR)/,$(LUA_LIBS)) -all: luajit $(OBJ_DIR) $(OBJ_SUBDIR) $(LIBS) $(LUA_DIR) $(LUA_SUBDIR) $(LUA_LIBS) +all: luajit $(OBJ_DIR) $(LIB_DIR) $(OBJ_SUBDIR) $(LIBS) $(LUA_DIR) $(LUA_SUBDIR) $(LUA_LIBS) luajit: ./build_luajit.sh -$(OBJ_DIR) $(LUA_DIR) $(OBJ_SUBDIR) $(LUA_SUBDIR): +$(OBJ_DIR) $(LIB_DIR) $(LUA_DIR) $(OBJ_SUBDIR) $(LUA_SUBDIR): -mkdir -p $@ $(OBJ_DIR)/%.o: %.c $(patsubst /%.o,/%.c,$@) gcc -c -o $@ $< $(INCLUDE) -fPIC $(CFLAGS) @@ -48,7 +50,8 @@ $(OBJ_DIR)/matrix/cukernel.o: matrix/generic/cukernel.cu .PHONY: speech speech: - $(MAKE) -C speech/tnet_io/ OBJ_DIR=$(CURDIR)/build/objs/speech/tnet_io + -mkdir -p build/objs/speech/tnet_io + $(MAKE) -C speech/ BUILD_DIR=$(BUILD_DIR) LIB_DIR=$(LIB_DIR) OBJ_DIR=$(CURDIR)/build/objs/speech/ clean: -rm -rf $(OBJ_DIR) diff --git a/nerv b/nerv index 50e2e0b..a9109ed 100755 --- a/nerv +++ b/nerv @@ -1,2 +1,2 @@ #!/bin/bash -exec 'build/luajit-2.0/bin/luajit' -e "package.cpath=\"${PWD}/build/objs/?.so\"" -e "package.path=\"${PWD}/build/lua/?/init.lua;${PWD}/build/lua/?.lua\"" -e "require 'nerv'" "$@" +exec 'build/luajit-2.0/bin/luajit' -e "package.cpath=\"${PWD}/build/lib/?.so\"" -e "package.path=\"${PWD}/build/lua/?/init.lua;${PWD}/build/lua/?.lua\"" -e "require 'nerv'" "$@" diff --git a/speech b/speech index 74b9f7c..3b156cd 160000 --- a/speech +++ b/speech @@ -1 +1 @@ -Subproject commit 74b9f7cb88cd21cfac3c2e50c8efb802485df0c5 +Subproject commit 3b156cd0cd19aa7db97082161921064a0a871328 -- cgit v1.2.3-70-g09d2