blob: 7bca179590640a45baf57dcb8129e3e5b8d1d970 (
plain) (
tree)
|
|
ifndef LUA_BINDIR
$(error Please build the package via luarocks: `luarocks make`)
endif
SHELL := /bin/bash
BUILD_DIR := $(CURDIR)/build
INC_PATH := $(LUA_BINDIR)/../include/
OBJS :=
LIBS :=
LUA_LIBS := init.lua
INCLUDE := -I $(LUA_INCDIR) -I $(INC_PATH) -DLUA_USE_APICHECK
SUBDIR := src
OBJ_DIR := $(BUILD_DIR)/objs
LUA_DIR = $(INST_LUADIR)/speech_utils
OBJS := $(addprefix $(OBJ_DIR)/,$(OBJS))
LIBS := $(addprefix $(INST_LIBDIR)/,$(LIBS))
OBJ_SUBDIR := $(addprefix $(OBJ_DIR)/,$(SUBDIR))
LUA_SUBDIR := $(addprefix $(LUA_DIR)/,$(SUBDIR))
LUA_LIBS := $(addprefix $(LUA_DIR)/,$(LUA_LIBS))
LIB_PATH := $(LUA_BINDIR)/../lib
build: $(OBJ_DIR) $(OBJ_SUBDIR) $(OBJS)
install: $(LUA_DIR) $(LUA_SUBDIR) $(LUA_LIBS) $(LIBS)
$(OBJ_DIR) $(LUA_DIR) $(OBJ_SUBDIR) $(LUA_SUBDIR):
-mkdir -p $@
$(LUA_DIR)/%.lua: %.lua
cp $< $@
$(OBJ_DIR)/%.o: %.c
gcc -o $@ -c $< -g $(INCLUDE) -fPIC
clean:
-rm $(OBJ_DIR)/src/*.o
|