| 1 |
# |
| 2 |
# Makefile for Leg |
| 3 |
# $Id: Makefile,v 1.7 2007/11/26 18:41:51 hanjos Exp $ |
| 4 |
# |
| 5 |
|
| 6 |
# ===== LUA PATHS ================= |
| 7 |
# Lua's library directory |
| 8 |
LUA_LIB = /usr/local/share/lua/5.1 |
| 9 |
|
| 10 |
# ===== PROJECT INFO ============== |
| 11 |
# project info |
| 12 |
NAME = leg |
| 13 |
VERSION = 0.1.2 |
| 14 |
|
| 15 |
# project directories |
| 16 |
DOC_DIR = doc |
| 17 |
SRC_DIR = src |
| 18 |
TEST_DIR = tests |
| 19 |
|
| 20 |
# the document generator used to build the documentation in doc/. |
| 21 |
# It uses an unreleased generator, so this is for my personal use. |
| 22 |
DOCCER = lua /usr/local/share/lua/5.1/ldt/ldt.lua |
| 23 |
|
| 24 |
# ===== RULES ===================== |
| 25 |
leg: |
| 26 |
mkdir -p $(NAME) |
| 27 |
rm -f $(NAME)/*.lua |
| 28 |
cp src/*.lua $(NAME) |
| 29 |
|
| 30 |
install: |
| 31 |
# copying the source files to LUA_LIB |
| 32 |
mkdir -p $(LUA_LIB)/$(NAME) |
| 33 |
rm -f $(LUA_LIB)/$(NAME)/*.lua |
| 34 |
cp src/*.lua $(LUA_LIB)/$(NAME) |
| 35 |
|
| 36 |
clean: |
| 37 |
# removing the source files and package |
| 38 |
rm -r $(LUA_LIB)/$(NAME) |
| 39 |
|
| 40 |
documents: |
| 41 |
# generate documentation |
| 42 |
mkdir -p $(DOC_DIR) |
| 43 |
$(DOCCER) src/*.lua |
| 44 |
mv ldt/* $(DOC_DIR) |
| 45 |
rm -rf ldt |
| 46 |
|
| 47 |
bundle: |
| 48 |
# tar-ing it (this works only with version 1.19 and beyond, due |
| 49 |
# the --exclude-vcs flag) |
| 50 |
tar --create --verbose --exclude-vcs --file=../$(NAME)-$(VERSION).tar ../$(NAME) |
| 51 |
|
| 52 |
# zipping it |
| 53 |
gzip ../$(NAME)-$(VERSION).tar |
| 54 |
|
| 55 |
test: |
| 56 |
cd tests; lua test.lua |