-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jamroot
143 lines (114 loc) · 3.87 KB
/
Jamroot
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import toolset ;
import feature ;
import package ;
feature.feature build-tool : : free ;
explicit install ;
package.install install
: # requirements
: # binaries
commands_to_compilation_database_cpp
commands_to_compilation_database_py
files_to_compilation_database_cpp
files_to_compilation_database_py
compare_compilation_databases_py
: # libraries
: # headers
;
exe commands_to_compilation_database_cpp
: # sources
commands_to_compilation_database_cpp.cpp
compilation_database.hpp
json.hpp
: # requirements
<linkflags>-lboost_program_options
<linkflags>-lboost_filesystem
<linkflags>-lboost_system
<toolset>clang:<cxxflags>"-std=c++11 -stdlib=libc++"
<toolset>gcc:<cxxflags>-std=c++11
<toolset>darwin:<cxxflags>-std=c++11
;
exe files_to_compilation_database_cpp
: # sources
files_to_compilation_database_cpp.cpp
compilation_database.hpp
json.hpp
: # requirements
<linkflags>-lboost_program_options
<linkflags>-lboost_filesystem
<linkflags>-lboost_system
<toolset>clang:<cxxflags>"-std=c++11 -stdlib=libc++"
<toolset>gcc:<cxxflags>-std=c++11
<toolset>darwin:<cxxflags>-std=c++11
;
alias test
: # sources
commands-to-compilation-database-compare-make-py.pass
commands-to-compilation-database-compare-make-cpp.pass
commands-to-compilation-database-compare-Boost.Build-py.pass
commands-to-compilation-database-compare-Boost.Build-cpp.pass
files-to-compilation-database-compare.pass
;
# generate targets for each implementation
for implementation in py cpp
{
for build-tool in make Boost.Build
{
explicit commands_to_compilation_database_$(build-tool)_$(implementation).json ;
make commands_to_compilation_database_$(build-tool)_$(implementation).json
: # sources
commands_to_compilation_database_$(implementation)
test/commands_to_compilation_database_$(build-tool).txt
: # generating-rule
@commands-to-compilation-database
: # requirements
<build-tool>$(build-tool)
;
explicit commands-to-compilation-database-compare-$(build-tool)-$(implementation).pass ;
make commands-to-compilation-database-compare-$(build-tool)-$(implementation).pass
: # sources
test/commands_to_compilation_database_$(build-tool).json
commands_to_compilation_database_$(build-tool)_$(implementation).json
: # generating-rule
@compare-compilation-databases
;
}
explicit files_to_compilation_database_$(implementation).json ;
make files_to_compilation_database_$(implementation).json
: # sources
files_to_compilation_database_$(implementation)
: # generating-rule
@files-to-compilation-database
: # requirements
<flags>--cflags=-std=c89
<flags>--cxxflags=-std=c++11
<flags>--include=INCLUDE1
<flags>--include=INCLUDE2
<flags>--define=DEFINE1
<flags>--define=DEFINE2
<flags>--undefine=UNDEFINE1
<flags>--undefine=UNDEFINE2
;
}
explicit files-to-compilation-database-compare.pass ;
make files-to-compilation-database-compare.pass
: # sources
files_to_compilation_database_py.json
files_to_compilation_database_cpp.json
: # generating-rule
@compare-compilation-databases
;
toolset.flags commands-to-compilation-database BUILD_TOOL : <build-tool> ;
toolset.flags commands-to-compilation-database FLAGS : <flags> ;
actions commands-to-compilation-database
{
./$(>[1]) $(FLAGS) --build-tool=$(BUILD_TOOL) --output-filename=$(<) --root-directory=/tmp < $(>[2])
}
toolset.flags files-to-compilation-database FLAGS : <flags> ;
actions files-to-compilation-database
{
echo "*.[ch]pp" | ./$(>) $(FLAGS) --output-filename=$(<) --root-directory=/tmp
}
actions compare-compilation-databases
{
if ./compare_compilation_databases_py "$(>[1])" "$(>[2])" ; then echo "**passed**" > $(<) ; else rm -f $(<) && false ; fi
}