-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
94 lines (75 loc) · 2.84 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
CONFIG:=Makefile.config
-include $(CONFIG)
CC ?= "clang"
CXX ?= "clang++"
BUILD_TYPE ?= "RelWithDebInfo"
DYNAMORIO_SOURCES ?= "ON"
LLVM_SOURCES ?= "ON"
TESSLA_SUPPORT ?= "ON"
LIBINPUT_SOURCES ?= "ON"
WLDBG_SOURCES ?= "OFF"
CLONE_METHOD := "https://github.com/"
all: check-dependencies export_config buffers compiler sources monitors
check-dependencies:
python3 --version > /dev/null || (echo "Need python 3 installed"; exit 1)
cmake --version > /dev/null || (echo "Need cmake installed"; exit 1)
python3 -c "import lark" || (echo "Need lark installed (pip install lark)"; exit 1)
# dump current config into a file that will be used on the next run
export_config:
@echo "CC:=$(CC)" > $(CONFIG)
@echo "CXX:=$(CXX)" >> $(CONFIG)
@echo "BUILD_TYPE:=$(BUILD_TYPE)" >> $(CONFIG)
@echo "DYNAMORIO_SOURCES:=$(DYNAMORIO_SOURCES)" >> $(CONFIG)
@echo "TESSLA_SUPPORT:=$(TESSLA_SUPPORT)" >> $(CONFIG)
@echo "LLVM_SOURCES:=$(LLVM_SOURCES)" >> $(CONFIG)
@echo "LIBINPUT_SOURCES:=$(LIBINPUT_SOURCES)" >> $(CONFIG)
@echo "WLDBG_SOURCES:=$(WLDBG_SOURCES)" >> $(CONFIG)
@echo "Config has been written to $(CONFIG)"
.PHONY: all export_config docs
include makefiles/Makefile-buffers
include makefiles/Makefile-common
include makefiles/Makefile-compiler
include makefiles/Makefile-monitors
include makefiles/Makefile-sources
#include makefiles/Makefile-hyper
include makefiles/Makefile-spec
include makefiles/Makefile-mpt
fase23-experiments-config: export_config buffers
test -f fase23-experiments/CMakeLists.txt || git clone $(CLONE_METHOD)ista-vamos/fase23-experiments.git
cd fase23-experiments && (test -f CMakeCache.txt || cmake . -DCMAKE_C_COMPILER=$(CC)\
-Dvamos-buffers_DIR=../vamos-buffers/cmake/vamos-buffers\
-Dvamos_sources_DIR=../vamos-sources\
-Dvamos_compiler_DIR=../vamos-compiler\
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)) || git clean -xdf
fase23-experiments: fase23-experiments-config all
# FIXME: change this to use HTTPS after making it public
make -C fase23-experiments
echo -e "\n## Now you can go to the folder fase23-experiments and follow README there ##\n"
REPOS := vamos-buffers vamos-compiler vamos-sources vamos-monitors\
vamos-common vamos-mpt vamos-spec
clean:
for REPO in $(REPOS); do\
echo "Cleaning $$REPO";\
test -d $$REPO && make clean -C $$REPO;\
done
test -d experiments && make clean -C experiments
reconfigure:
for REPO in $(REPOS); do\
rm -f $$REPO/CMakeCache.txt || true
done
-rm -f fase23-experiments/CMakeCache.txt
make buffers-config
make compiler-config
make sources-config
make monitors-config
set-dev: all
for REPO in $(REPOS); do\
echo "Setting url at $$REPO";\
test -d $$REPO && cd $$REPO && git remote set-url origin [email protected]:ista-vamos/$$REPO.git && cd -;\
done
reset:
for REPO in $(REPOS); do\
test -d $$REPO && cd $$REPO && git clean -xdf && cd -;\
done
docs:
cd .mdbook && mdbook build -d ../docs