-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (35 loc) · 1.06 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
.PHONY=clean
LDPL_FILES=$(shell ls -f src/{bytecode,compiler,vm,version}.ldpl src/{util,compiler,vm}/*.ldpl | sed -e 's/^/-i=/' | tr -s '\n' ' ')
dino: src/*.ldpl src/**/*.ldpl
@make version
ldpl $(LDPL_FILES) src/main.ldpl -o=dino; true
@git checkout src/version.ldpl
docs/index.html: docs/index.tpl README.txt dino
dino run docs/build.ldpl
docs: docs/index.html
release: src/*.ldpl src/**/*.ldpl
@make version
ldpl $(LDPL_FILES) src/main.ldpl -o=dino -f=-O3
strip dino
@git checkout src/version.ldpl
make docs
ldpltest:
git clone https://github.com/lartu/ldpltest
test: ldpltest dino
cd ldpltest && git pull
cd ldpltest && ../dino tester.ldpl -r=../../dino
# remember to escape $ in the text
define VERSIONLDPL
DATA:
$$DINO.VERSION is text
$$DINO.BUILT is text
PROCEDURE:
store "<v>" in $$DINO.VERSION
store "<b>" in $$DINO.BUILT
endef
export VERSIONLDPL
version:
@echo "$$VERSIONLDPL" | sed "s/<v>/$(shell git rev-parse --short HEAD | tr -d '\n')/g" | sed "s/<b>/$(shell date +%Y-%m-%d | tr -d '\n')/g" > src/version.ldpl
clean:
rm -f dino
rm -rf ldpltest