summaryrefslogtreecommitdiff
path: root/htk_io/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'htk_io/Makefile')
-rw-r--r--htk_io/Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/htk_io/Makefile b/htk_io/Makefile
index d32d17a..6a5f529 100644
--- a/htk_io/Makefile
+++ b/htk_io/Makefile
@@ -1,3 +1,7 @@
+ifndef LUA_BINDIR
+$(error Please build the package via luarocks: `luarocks make`)
+endif
+
.PHONY: tnet
SHELL := /bin/bash
BUILD_DIR := $(CURDIR)/build
@@ -17,6 +21,7 @@ OBJ_SUBDIR := $(addprefix $(OBJ_DIR)/,$(SUBDIR))
LUA_SUBDIR := $(addprefix $(LUA_DIR)/,$(SUBDIR))
LUA_LIBS := $(addprefix $(LUA_DIR)/,$(LUA_LIBS))
LIB_PATH := $(LUA_BINDIR)/../lib
+LUALIB_PATH := $(LUA_BINDIR)/../lib/lua/5.1/
build: $(OBJ_DIR) $(OBJ_SUBDIR) $(OBJS) tnet $(OBJ_DIR)/src/test
install: $(LUA_DIR) $(LUA_SUBDIR) $(LUA_LIBS) $(LIBS)
@@ -26,7 +31,7 @@ $(OBJ_DIR) $(LUA_DIR) $(OBJ_SUBDIR) $(LUA_SUBDIR):
$(LUA_DIR)/%.lua: %.lua
cp $< $@
$(LIBS): $(OBJ_DIR)/src/cwrapper.o $(OBJ_DIR)/init.o $(OBJ_DIR)/src/init.o $(OBJ_DIR)/src/libKaldiLib.a
- gcc -shared -o $@ $(OBJ_DIR)/src/cwrapper.o $(OBJ_DIR)/init.o $(OBJ_DIR)/src/libKaldiLib.a $(OBJ_DIR)/src/init.o -lstdc++ -Wl,-rpath=$(LIB_PATH) -L$(LIB_PATH) -lnervcore -lluaT
+ gcc -shared -o $@ $(OBJ_DIR)/src/cwrapper.o $(OBJ_DIR)/init.o $(OBJ_DIR)/src/libKaldiLib.a $(OBJ_DIR)/src/init.o -lstdc++ -Wl,-rpath=$(LIB_PATH) -L$(LIB_PATH) -lnervcore -Wl,-rpath=$(LUALIB_PATH) -L$(LUALIB_PATH) -lnerv -lluaT
$(OBJ_DIR)/src/test: $(OBJ_DIR)/src/cwrapper.o $(OBJ_DIR)/src/test.o $(OBJ_DIR)/src/libKaldiLib.a
gcc -o $@ $^ -Wl,-rpath=$(LIB_PATH) -L$(LIB_PATH) -lnervcore -Wl,-rpath=$(LUA_LIBDIR) -L$(LUA_LIBDIR) -lluajit-5.1 -lstdc++ -lm
$(OBJ_DIR)/src/cwrapper.o: src/cwrapper.cpp
@@ -34,7 +39,7 @@ $(OBJ_DIR)/src/cwrapper.o: src/cwrapper.cpp
$(OBJ_DIR)/%.o: %.c
gcc -o $@ -c $< -g $(INCLUDE) -fPIC
clean:
- -rm $(OBJ_DIR)/src/*.o
+ -rm -r $(OBJ_DIR)
$(MAKE) -C src/KaldiLib/ clean
tnet:
$(MAKE) -C src/KaldiLib/ OBJ_DIR=$(OBJ_DIR)/src