-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (51 loc) · 1.9 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
62
63
64
65
66
67
68
69
70
71
INSTALL_DIR=/usr/local/bin
all: compile
.PHONY: compile
compile: build
ghc -j`nproc` -i./src --make -O3 -o ./build/lsql-csv ./main/Main.hs
build:
mkdir -p build
docs: build
cd build; find ../src | grep .hs$ | xargs haddock --html
latex-docs: build
cd build; find ../src | grep .hs$ | xargs haddock --latex
.PHONY: install
install:
mkdir -p $(INSTALL_DIR)
cp build/lsql-csv $(INSTALL_DIR)
.PHONY: clean
clean:
git clean -Xf; rm -r ./build
.PHONY: test
test: compile test-basics test-examples test-options test-blocks test-functions
echo -e "\033[1mAll tests succedded.\033[0m"
.PHONY: test-basics
test-basics: $(wildcard ./tests/basics/*)
echo $? | tr ' ' '\n' | xargs -I{} bash -c "{}"
echo -e "\033[1mBasics tests succedded.\033[0m"
.PHONY: test-examples
test-examples: $(wildcard ./tests/examples/*)
echo $? | tr ' ' '\n' | xargs -I{} bash -c "{}"
echo -e "\033[1mExamples tests succedded.\033[0m"
.PHONY: test-options
test-options: $(wildcard ./tests/options/*)
echo $? | tr ' ' '\n' | xargs -I{} bash -c "{}"
echo -e "\033[1mOptions tests succedded.\033[0m"
.PHONY: test-blocks
test-blocks: $(wildcard ./tests/blocks/*)
echo $? | tr ' ' '\n' | xargs -I{} bash -c "{}"
echo -e "\033[1mBlocks tests succedded.\033[0m"
.PHONY: test-functions
test-functions: test-onearg-functions test-aggregate-functions test-operators
.PHONY: test-aggregate-functions
test-aggregate-functions: $(wildcard ./tests/aggregate-functions/*)
echo $? | tr ' ' '\n' | xargs -I{} bash -c "{}"
echo -e "\033[1mAggregate functions tests succedded.\033[0m"
.PHONY: test-onearg-functions
test-onearg-functions: $(wildcard ./tests/onearg-functions/*)
echo $? | tr ' ' '\n' | xargs -I{} bash -c "{}"
echo -e "\033[1mOnearg functions tests succedded.\033[0m"
.PHONY: test-operators
test-operators: $(wildcard ./tests/operators/*)
echo $? | tr ' ' '\n' | xargs -I{} bash -c "{}"
echo -e "\033[1mOperators tests succedded.\033[0m"