aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: e98302bf6898e9a7f6a771e963214f3096536d7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.PHONY: all clean install luajit luarocks speech submodule
##############  EDIT THESE LINES  #####################
SHELL := /bin/bash
PREFIX := $(CURDIR)/install/
#CUDA_BASE := /usr/local/cuda-7.0
CUDA_BASE := /usr/local/cuda
BLAS_BASE := /usr/lib/
BLAS_LDFLAGS := -L$(BLAS_BASE) -Wl,-rpath=$(BLAS_BASE)
BLAS_TYPE := atlas
KALDI_BASE := /speechlab/tools/KALDI/kaldi-master/
#######################################################
MKL_LDFLAGS := -lmkl_rt
ATLAS_LDFLAGS := -lcblas -llapack_atlas
ifeq ($(BLAS_TYPE), mkl)
BLAS_LDFLAGS += $(MKL_LDFLAGS)
else ifeq ($(BLAS_TYPE), atlas)
BLAS_LDFLAGS += $(ATLAS_LDFLAGS)
else
$(error Invalid blas type)
endif
export CUDA_BASE
export KALDI_BASE
export BLAS_LDFLAGS

.PHONY: nerv speech/speech_utils speech/htk_io speech/kaldi_io speech/kaldi_decode \
		nerv-clean speech-clean speech/speech_utils-clean speech/htk_io-clean speech/kaldi_io-clean speech/kaldi_decode-clean \
		Penlight

all: nerv
submodule: luajit luarocks Penlight
luajit:
	PREFIX=$(PREFIX) ./tools/build_luajit.sh
luarocks:
	PREFIX=$(PREFIX) ./tools/build_luarocks.sh

speech: speech/speech_utils speech/htk_io speech/kaldi_io speech/kaldi_decode
speech-clean: speech/speech_utils-clean speech/htk_io-clean speech/kaldi_io-clean speech/kaldi_decode-clean
clean: nerv-clean speech-clean
uninstall:
	-rm -rf install/

nerv Penlight speech/speech_utils speech/htk_io speech/kaldi_io speech/kaldi_decode:
	cd $@; $(PREFIX)/bin/luarocks make
nerv-clean speech/speech_utils-clean speech/htk_io-clean speech/kaldi_io-clean speech/kaldi_decode-clean:
	-make -C $(subst -clean,,$@) clean LUA_BINDIR=$(PREFIX)/bin/