forked from teal-language/cyan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (42 loc) · 1.1 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
SRC = $(wildcard src/cyan/*.tl) $(wildcard src/cyan/*/*.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 docs rockspec
cyan: build/cyan/fs build/cyan/commands $(LUA)
build/cyan/fs:
mkdir -p $@
build/cyan/commands:
mkdir -p $@
all: clean bootstrap docs rockspec test
clean:
rm -rf build tmp docs/index.html cyan-dev-1.rockspec
bootstrap: build/cyan/fs 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
docs: docs/index.html
rockspec: cyan-dev-1.rockspec
docs/index.html: $(SRC)
./bin/cyan run scripts/docgen.tl
cyan-dev-1.rockspec: $(SRC)
./bin/cyan run scripts/gen_rockspec.tl
.PHONY: clean