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