-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (65 loc) · 2.02 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
72
73
74
75
76
77
78
79
80
SHELL:=/bin/bash
export SEP:=\n====================================================================================================================================\n
export PROJECT_ROOT:=$(shell pwd)
export JOP_VER:=1.01
export WORKSPACE_DIR:=/home/jop_workspace
export ROBOT_OPTIONS= --outputdir ${WORKSPACE_DIR}/output/test_results
export BUILD_VER:=1.01
export GO_WORKSPACE_DIR:=/usr/src/app
export WORKSPACE_DIR_HOST:=${PROJECT_ROOT}
export GO_LOG_FILE:=jop.log
all : clean build test generate_bin
@echo "${SEP} all"
clean:
@echo "${SEP} Clean"
cd go/src; \
- rm gen/*; \
echo "" > ${GO_LOG_FILE} ;
- rm output/test_results/*
build :
@echo "${SEP} Build"
cd antlr/ ; \
make ;
tools :
@echo "${SEP} tools"
run :
@echo -e "${SEP} run"
cd antlr/ ; \
make run;
test :
@echo "${SEP} test"
cd tests/test_cases; \
robot test-1.robot ;
test_new :
@echo "${SEP} test"
cd tests/test_cases; \
robot --include New test-1.robot;
build_container :
# Only this recipe runs outside of the container. Rest all will run inside the container.
# Build the container
@echo "${SEP} Building build shell."
docker build -t jop_builder:${JOP_VER} ./ ;
get_build_shell:
docker run -v`pwd`:/home/jop_workspace/ --network=host -w /home/jop_workspace/ -it jop_builder:${JOP_VER} "/bin/bash"
build_shell_go:
@echo "Building Go build shell"
cd go; \
docker build ./ -t jop_go:${BUILD_VER}; \
docker-compose up -d ; \
docker exec -it go_dev-env_1 bash ;
build_go: mod_tidy
@echo "Building go"
cd go/src/; \
java -cp ../../artifacts/antlr-4.13.0-complete.jar org.antlr.v4.Tool -Dlanguage=Go -o gen/ -visitor jop.g4; \
go build;
test_go: mod_tidy
@echo "Testing go"
cd go/src/; \
go test
mod_tidy:
cd go/src/; \
go mod tidy;
generate_bin:
rm -f output/test_1_visitor.bin;
pushd antlr; python3 -m nuitka --standalone test_1_visitor.py; popd;
mv antlr/test_1_visitor.bin output/test_1_visitor.bin;