@@ -27,6 +27,7 @@ env.Append(CPPPATH=[
2727 "external/IntelRDFPMathLib20U1/LIBRARY/src" ,
2828 "external/utf8/source" ,
2929 "external/lib/libffi-3.2.1/include" ,
30+ "src" ,
3031])
3132if sys .platform == "win32" :
3233 env .Append (CXXFLAGS = [
@@ -52,63 +53,63 @@ if coverage:
5253 "--coverage" , "-O0" ,
5354 ])
5455
55- env .Command (["thunks.inc" , "functions_compile.inc" , "functions_exec.inc" ], ["rtl_exec.cpp" , "make_thunks.py" ], sys .executable + " make_thunks.py" )
56+ env .Command (["src/ thunks.inc" , "src/ functions_compile.inc" , "src/ functions_exec.inc" ], ["src/ rtl_exec.cpp" , "scripts/ make_thunks.py" ], sys .executable + " scripts/ make_thunks.py" )
5657
5758if os .name == "posix" :
58- rtl_platform = "rtl_posix.cpp"
59+ rtl_platform = "src/ rtl_posix.cpp"
5960elif os .name == "nt" :
60- rtl_platform = "rtl_win32.cpp"
61+ rtl_platform = "src/ rtl_win32.cpp"
6162else :
6263 print "Unsupported platform:" , os .name
6364 sys .exit (1 )
6465
65- simple = env .Program ("simple" , [
66- "ast.cpp" ,
67- "bytecode.cpp" ,
68- "cell.cpp" ,
69- "compiler.cpp" ,
70- "debuginfo.cpp" ,
71- "disassembler.cpp" ,
72- "exec.cpp" ,
73- "lexer.cpp" ,
74- "main.cpp" ,
75- "number.cpp" ,
76- "parser.cpp" ,
77- "rtl_compile.cpp" ,
78- "rtl_exec.cpp" ,
66+ simple = env .Program ("bin/ simple" , [
67+ "src/ ast.cpp" ,
68+ "src/ bytecode.cpp" ,
69+ "src/ cell.cpp" ,
70+ "src/ compiler.cpp" ,
71+ "src/ debuginfo.cpp" ,
72+ "src/ disassembler.cpp" ,
73+ "src/ exec.cpp" ,
74+ "src/ lexer.cpp" ,
75+ "src/ main.cpp" ,
76+ "src/ number.cpp" ,
77+ "src/ parser.cpp" ,
78+ "src/ rtl_compile.cpp" ,
79+ "src/ rtl_exec.cpp" ,
7980 rtl_platform ,
80- "util.cpp" ,
81+ "src/ util.cpp" ,
8182] + coverage_lib ,
8283)
8384
84- simplec = env .Program ("simplec" , [
85- "ast.cpp" ,
86- "bytecode.cpp" ,
87- "compiler.cpp" ,
88- "debuginfo.cpp" ,
89- "disassembler.cpp" ,
90- "lexer.cpp" ,
91- "number.cpp" ,
92- "parser.cpp" ,
93- "rtl_compile.cpp" ,
94- "simplec.cpp" ,
95- "util.cpp" ,
85+ simplec = env .Program ("bin/ simplec" , [
86+ "src/ ast.cpp" ,
87+ "src/ bytecode.cpp" ,
88+ "src/ compiler.cpp" ,
89+ "src/ debuginfo.cpp" ,
90+ "src/ disassembler.cpp" ,
91+ "src/ lexer.cpp" ,
92+ "src/ number.cpp" ,
93+ "src/ parser.cpp" ,
94+ "src/ rtl_compile.cpp" ,
95+ "src/ simplec.cpp" ,
96+ "src/ util.cpp" ,
9697] + coverage_lib ,
9798)
9899
99- simplex = env .Program ("simplex" , [
100- "bytecode.cpp" ,
101- "cell.cpp" ,
102- "exec.cpp" ,
103- "number.cpp" ,
104- "rtl_exec.cpp" ,
100+ simplex = env .Program ("bin/ simplex" , [
101+ "src/ bytecode.cpp" ,
102+ "src/ cell.cpp" ,
103+ "src/ exec.cpp" ,
104+ "src/ number.cpp" ,
105+ "src/ rtl_exec.cpp" ,
105106 rtl_platform ,
106- "simplex.cpp" ,
107+ "src/ simplex.cpp" ,
107108] + coverage_lib ,
108109)
109110
110- env .Depends ("number.h" , libbid )
111- env .Depends ("exec.cpp" , libffi )
111+ env .Depends ("src/ number.h" , libbid )
112+ env .Depends ("src/ exec.cpp" , libffi )
112113
113114def UnitTest (env , target , source , ** kwargs ):
114115 t = env .Program (target , source , ** kwargs )
@@ -118,54 +119,54 @@ def UnitTest(env, target, source, **kwargs):
118119 env .Alias ("test" , t )
119120 return t
120121
121- env .Command ("errors.txt" , ["extract_errors.py" ] + Glob ("*.cpp" ), sys .executable + " extract_errors.py" )
122+ env .Command ("src/ errors.txt" , ["scripts/ extract_errors.py" ] + Glob ("src/ *.cpp" ), sys .executable + " scripts/ extract_errors.py" )
122123
123124SConsEnvironment .UnitTest = UnitTest
124125
125- env .UnitTest ("test_lexer" , [
126- "test_lexer.cpp" ,
127- "lexer.cpp" ,
128- "number.cpp" ,
129- "util.cpp" ,
126+ env .UnitTest ("bin/ test_lexer" , [
127+ "tests/ test_lexer.cpp" ,
128+ "src/ lexer.cpp" ,
129+ "src/ number.cpp" ,
130+ "src/ util.cpp" ,
130131] + coverage_lib ,
131132)
132133
133- env .UnitTest ("test_parser" , [
134- "test_parser.cpp" ,
135- "ast.cpp" ,
136- "cell.cpp" ,
137- "compiler.cpp" ,
138- "parser.cpp" ,
139- "lexer.cpp" ,
140- "number.cpp" ,
141- "rtl_compile.cpp" ,
142- "util.cpp" ,
134+ env .UnitTest ("bin/ test_parser" , [
135+ "tests/ test_parser.cpp" ,
136+ "src/ ast.cpp" ,
137+ "src/ cell.cpp" ,
138+ "src/ compiler.cpp" ,
139+ "src/ parser.cpp" ,
140+ "src/ lexer.cpp" ,
141+ "src/ number.cpp" ,
142+ "src/ rtl_compile.cpp" ,
143+ "src/ util.cpp" ,
143144] + coverage_lib ,
144145)
145146
146- env .UnitTest ("test_compiler" , [
147- "test_compiler.cpp" ,
148- "ast.cpp" ,
149- "bytecode.cpp" ,
150- "cell.cpp" ,
151- "compiler.cpp" ,
152- "disassembler.cpp" ,
153- "lexer.cpp" ,
154- "number.cpp" ,
155- "parser.cpp" ,
156- "rtl_compile.cpp" ,
157- "util.cpp" ,
147+ env .UnitTest ("bin/ test_compiler" , [
148+ "tests/ test_compiler.cpp" ,
149+ "src/ ast.cpp" ,
150+ "src/ bytecode.cpp" ,
151+ "src/ cell.cpp" ,
152+ "src/ compiler.cpp" ,
153+ "src/ disassembler.cpp" ,
154+ "src/ lexer.cpp" ,
155+ "src/ number.cpp" ,
156+ "src/ parser.cpp" ,
157+ "src/ rtl_compile.cpp" ,
158+ "src/ util.cpp" ,
158159] + coverage_lib ,
159160)
160161
161162if sys .platform == "win32" :
162- test_ffi = env .SharedLibrary ("libtest_ffi" , "test_ffi.c" )
163+ test_ffi = env .SharedLibrary ("bin/ libtest_ffi" , "tests/ test_ffi.c" )
163164else :
164- test_ffi = env .SharedLibrary ("test_ffi" , "test_ffi.c" )
165+ test_ffi = env .SharedLibrary ("bin/ test_ffi" , "tests/ test_ffi.c" )
165166
166- tests = env .Command ("tests_normal" , [simple , "run_test.py" , Glob ("t/*" )], sys .executable + " run_test.py t" )
167+ tests = env .Command ("tests_normal" , [simple , "scripts/ run_test.py" , Glob ("t/*" )], sys .executable + " scripts/ run_test.py t" )
167168env .Depends (tests , test_ffi )
168- env .Command ("tests_error" , [simple , "run_test.py" , "errors.txt" , Glob ("t/errors/*" )], sys .executable + " run_test.py --errors t/errors" )
169+ env .Command ("tests_error" , [simple , "scripts/ run_test.py" , "src/ errors.txt" , Glob ("t/errors/*" )], sys .executable + " scripts/ run_test.py --errors t/errors" )
169170
170171env .Command ("samples/hello.simplex" , ["samples/hello.simple" , simplec ], simplec [0 ].abspath + " $SOURCE" )
171172env .Command ("tests_2" , ["samples/hello.simplex" , simplex ], simplex [0 ].abspath + " $SOURCE" )
0 commit comments