]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #============================================================================== |
2 | # Copyright (c) 2001-2011 Joel de Guzman | |
3 | # | |
4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | #============================================================================== | |
7 | project spirit-qi-compiler_tutorial | |
8 | : requirements | |
11fdf7f2 | 9 | <c++-template-depth>300 |
7c673cae FG |
10 | <variant>release:<location>"bin/release" |
11 | <variant>debug:<location>"bin/debug" | |
12 | : | |
13 | ; | |
14 | ||
15 | import modules ; | |
16 | ||
17 | exe calc1 : calc1.cpp ; | |
18 | exe calc2 : calc2.cpp ; | |
19 | exe calc3 : calc3.cpp ; | |
20 | exe calc4 : calc4.cpp ; | |
21 | exe calc5 : calc5.cpp ; | |
22 | exe calc6 : calc6.cpp ; | |
23 | ||
24 | exe calc7 : | |
25 | calc7/vm.cpp | |
26 | calc7/compiler.cpp | |
27 | calc7/expression.cpp | |
28 | calc7/statement.cpp | |
29 | calc7/main.cpp | |
30 | ; | |
31 | ||
32 | exe calc8 : | |
33 | calc8/vm.cpp | |
34 | calc8/compiler.cpp | |
35 | calc8/expression.cpp | |
36 | calc8/statement.cpp | |
37 | calc8/main.cpp | |
38 | ; | |
39 | ||
40 | exe mini_c : | |
41 | mini_c/vm.cpp | |
42 | mini_c/compiler.cpp | |
43 | mini_c/expression.cpp | |
44 | mini_c/statement.cpp | |
45 | mini_c/function.cpp | |
46 | mini_c/main.cpp | |
47 | ; | |
48 | ||
49 | exe conjure1 : | |
50 | conjure1/vm.cpp | |
51 | conjure1/compiler.cpp | |
52 | conjure1/expression.cpp | |
53 | conjure1/statement.cpp | |
54 | conjure1/function.cpp | |
55 | conjure1/main.cpp | |
56 | ; | |
57 | ||
58 | exe conjure2 : | |
59 | conjure2/compiler.cpp | |
60 | conjure2/expression.cpp | |
61 | conjure2/function.cpp | |
62 | conjure2/lexer.cpp | |
63 | conjure2/main.cpp | |
64 | conjure2/statement.cpp | |
65 | conjure2/vm.cpp | |
66 | ; | |
67 | ||
68 | #============================================================================== | |
69 | # conjure3 and above require LLVM. Make sure you provide the | |
70 | # LLVM_PATH in your bjam invocation. E.g.: | |
71 | # | |
72 | # bjam -sLLVM_PATH=C:/dev/llvm conjure3 | |
73 | # | |
74 | #============================================================================== | |
75 | ||
76 | if [ modules.peek : LLVM_PATH ] | |
77 | { | |
78 | LLVM_PATH = [ modules.peek : LLVM_PATH ] ; | |
79 | } | |
80 | ||
81 | if $(LLVM_PATH) | |
82 | { | |
83 | path-constant LLVM_LIB_DEBUG_PATH : $(LLVM_PATH)/lib/Debug ; | |
84 | path-constant LLVM_LIB_RELEASE_PATH : $(LLVM_PATH)/lib/Release ; | |
85 | ||
86 | llvm_linker_flags = | |
87 | "advapi32.lib" | |
88 | "shell32.lib" | |
89 | ; | |
90 | ||
91 | llvm_debug_libs = [ glob $(LLVM_LIB_DEBUG_PATH)/LLVM*.lib ] ; | |
92 | llvm_release_libs = [ glob $(LLVM_LIB_RELEASE_PATH)/LLVM*.lib ] ; | |
93 | ||
94 | rule build_exe_1 ( target-name : sources + : requirements * ) | |
95 | { | |
96 | local llvm_lib ; | |
97 | if <variant>debug in $(requirements) | |
98 | { | |
99 | llvm_lib = $(llvm_debug_libs) ; | |
100 | } | |
101 | else | |
102 | { | |
103 | llvm_lib = $(llvm_release_libs) ; | |
104 | } | |
105 | ||
106 | exe $(target-name) | |
107 | : $(sources) | |
108 | $(llvm_lib) | |
109 | : $(requirements) | |
110 | <toolset>msvc | |
111 | <include>$(LLVM_PATH)/include | |
112 | <linkflags>$(llvm_linker_flags) | |
113 | ; | |
114 | } | |
115 | ||
116 | rule build_exe ( target-name : sources + ) | |
117 | { | |
118 | build_exe_1 $(target-name) : $(sources) : <variant>debug ; | |
119 | build_exe_1 $(target-name) : $(sources) : <variant>release ; | |
120 | } | |
121 | ||
122 | build_exe conjure3 : | |
123 | conjure3/compiler.cpp | |
124 | conjure3/expression.cpp | |
125 | conjure3/function.cpp | |
126 | conjure3/lexer.cpp | |
127 | conjure3/main.cpp | |
128 | conjure3/statement.cpp | |
129 | conjure3/vm.cpp | |
130 | ; | |
131 | } | |
132 | ||
133 | ||
134 |