forked from xolox/lua-lxsh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (39 loc) · 1.31 KB
/
Makefile
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
46
47
# Makefile for the Lua LXSH module.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: October 4, 2011
# URL: http://peterodding.com/code/lua/lxsh/
VERSION = $(shell grep _VERSION src/init.lua | cut "-d'" -f 2)
RELEASE = $(VERSION)-1
PACKAGE = lxsh-$(RELEASE)
STYLESHEETS = examples/earendel.css \
examples/slate.css \
examples/wiki.css
demo: $(STYLESHEETS)
@mkdir -p examples/earendel examples/slate examples/wiki
@lua etc/demo.lua
test:
@lua test/lexers.lua
@lua test/highlighters.lua
links:
@lua etc/doclinks.lua
examples/%.css: src/colors/%.lua src/init.lua
@lua -e "print(require 'lxsh'.formatters.html.stylesheet'$(notdir $(basename $@))')" > $@
package: demo
@rm -f $(PACKAGE).zip
@mkdir -p $(PACKAGE)/etc
@cp -al etc/lxsh etc/demo.lua etc/doclinks.lua etc/styleswitcher.js $(PACKAGE)/etc
@cp -al examples $(PACKAGE)
@cp -al src $(PACKAGE)
@cp README.md TODO.md $(PACKAGE)
@zip $(PACKAGE).zip -x '*.sw*' -r $(PACKAGE)
@rm -R $(PACKAGE)
@echo Generated $(PACKAGE).zip
rockspec: package
@cat etc/template.rockspec \
| sed "s/{{VERSION}}/$(RELEASE)/g" \
| sed "s/{{DATE}}/`export LANG=; date '+%B %d, %Y'`/" \
| sed "s/{{HASH}}/`md5sum $(PACKAGE).zip | cut '-d ' -f1 `/" \
> $(PACKAGE).rockspec
@echo Generated $(PACKAGE).rockspec
.PHONY: demo test links package