-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
61 lines (47 loc) · 1.4 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
SRC = \
$(wildcard src/cyan/*.tl) \
$(wildcard src/cyan/*/*.tl) \
$(wildcard src/spec/*.tl) \
$(wildcard src/spec/*/*.tl) \
$(wildcard src/testing/*.tl)
LUA = $(SRC:src/%.tl=build/%.lua)
TL = tl
TLFLAGS = --quiet -I src
BOOTSTRAP1= bin/bootstrap --no-script
BOOTSTRAP2= bin/bootstrap --no-script
BOOTSTRAP3= bin/bootstrap --no-script
build/%.lua: src/%.tl
$(TL) $(TLFLAGS) gen --check $< -o $@
default: cyan rockspec
cyan: build_directories $(LUA)
build_directories:
mkdir -p build/cyan/{fs,commands,experimental} build/spec/{api,commands} build/testing
all: clean bootstrap docs rockspec test
clean:
rm -rf build tmp docs/index.html cyan-dev-1.rockspec
bootstrap: build/cyan/fs build/cyan/experimental build/cyan/commands $(LUA)
@echo "Initial build"
$(BOOTSTRAP1) build
@echo "Replacing code"
rm -rf build
mv tmp build
@echo "Building with self compiled code"
$(BOOTSTRAP2) build
@echo "Replacing code"
rm -rf build
mv tmp build
@echo "Final build with self compiled code"
$(BOOTSTRAP3) build
rm -rf build
mv tmp build
test: default
busted build/
lint: default
./bin/cyan run scripts/lint.tl
docs: docs/index.html
rockspec: cyan-dev-1.rockspec
docs/index.html: $(SRC) cyan scripts/gen_documentation.tl doc-template.html
./bin/cyan run scripts/gen_documentation.tl
cyan-dev-1.rockspec: $(SRC) scripts/gen_rockspec.tl
./bin/cyan run scripts/gen_rockspec.tl
.PHONY: clean