1 | # (C) Copyright David Abrahams 2001. |
---|
2 | # (C) Copyright MetaCommunications, Inc. 2004. |
---|
3 | |
---|
4 | # Distributed under the Boost Software License, Version 1.0. (See |
---|
5 | # accompanying file LICENSE_1_0.txt or copy at |
---|
6 | # http://www.boost.org/LICENSE_1_0.txt) |
---|
7 | |
---|
8 | # The following #// line will be used by the regression test table generation |
---|
9 | # program as the column heading for HTML tables. Must not include version number. |
---|
10 | #//<a href="http://www.comeaucomputing.com/">Comeau<br>C++</a> |
---|
11 | |
---|
12 | # Feature to allow specifying files that will compile with warnings disabled. |
---|
13 | # This is usefull for files that use windows headers. |
---|
14 | free-feature no-warn ; |
---|
15 | |
---|
16 | # variables used to configure como-tools.jam |
---|
17 | # |
---|
18 | # COMO_PATH - path to installation |
---|
19 | # COMO_BIN_PATH - path to como executable, defaults to $(COMO_PATH)/bin/ |
---|
20 | # COMO_INCLUDE_PATH - path to libcomo headers, defaults to $(COMO_PATH)/libcomo |
---|
21 | # COMO_STDLIB_PATH - path to built libcomo object, defaults to $(COMO_PATH)/libcomo |
---|
22 | # COMO_BACKEND - backend abbreviation, e.g. "vc71", "bcc", "dig", etc. Defaults to "vc7" |
---|
23 | # COMO_BACKEND_PATH - path to backend compiler root directory, defaults to $(VC7_ROOT) |
---|
24 | |
---|
25 | # Keep using COMO_BASE for backward compatibility |
---|
26 | set-as-singleton COMO_BASE COMO_PATH COMO_BIN_PATH COMO_INCLUDE_PATH COMO_STDLIB_PATH COMO_BACKEND COMO_BACKEND_PATH ; |
---|
27 | COMO_BASE ?= $(COMO_PATH) ; |
---|
28 | |
---|
29 | # compute directories for invoking como |
---|
30 | if ! $(COMO_PATH_SETUP) # do this once |
---|
31 | { |
---|
32 | # Keep using COMO_BIN_DIRECTORY for backward compatibility. |
---|
33 | COMO_BIN_DIRECTORY ?= $(COMO_BIN_PATH) ; |
---|
34 | COMO_BIN_DIRECTORY ?= $(COMO_BASE)$(SLASH)bin$(SLASH) ; |
---|
35 | COMO_BIN_DIRECTORY ?= "" ; # Don't clobber tool names if COMO_ROOT_DIRECTORY not |
---|
36 | # set |
---|
37 | |
---|
38 | COMO_INCLUDE_PATH ?= $(COMO_BASE)$(SLASH)libcomo ; |
---|
39 | COMO_INCLUDE_PATH += $(COMO_INCLUDE_PATH)$(SLASH)cnames ; |
---|
40 | |
---|
41 | COMO_STDLIB_PATH ?= $(COMO_BASE)$(SLASH)libcomo ; |
---|
42 | |
---|
43 | COMO_BACKEND_SETUP = $(COMO_BACKEND_SETUP) ; |
---|
44 | newline = " |
---|
45 | " ; |
---|
46 | COMO_BACKEND ?= "vc7" ; |
---|
47 | COMO_BACKEND_PATH ?= $(VC7_ROOT) ; |
---|
48 | COMO_BACKEND_INCLUDE_SETUP ?= "set \"COMO_MS_INCLUDE="$(COMO_BACKEND_PATH)"/include\"" ; |
---|
49 | COMO_BACKEND_LIB_SETUP ?= "set \"LIB="$(COMO_STDLIB_PATH)";%LIB%\"" ; |
---|
50 | COMO_PATH_SETUP ?= "set \"PATH="$(COMO_BIN_DIRECTORY)";%PATH%\"" ; |
---|
51 | COMO_BACKEND_SETUP ?= "call "\"$(COMO_BACKEND_PATH)\\..\\Common7\\Tools\\vsvars32"\" >nul" ; |
---|
52 | COMO_BASE_SETUP ?= "set \"COMO_BASE=$(COMO_BASE)\"" ; |
---|
53 | COMO_PATH_SETUP ?= "" ; |
---|
54 | COMO_CMD = \"$(COMO_BIN_DIRECTORY)como\" --$(COMO_BACKEND) ; |
---|
55 | } |
---|
56 | |
---|
57 | |
---|
58 | flags como-win32 C++FLAGS <exception-handling>off : --no_exceptions ; |
---|
59 | flags como-win32 C++FLAGS <exception-handling>on : --exceptions ; |
---|
60 | |
---|
61 | flags como-win32 CFLAGS <inlining>off : --no_inlining ; |
---|
62 | flags como-win32 CFLAGS <inlining>on <inlining>full : --inlining ; |
---|
63 | |
---|
64 | flags como-win32 CFLAGS <debug-symbols>on : /Zi ; |
---|
65 | flags como-win32 CFLAGS <optimization>off : /Od ; |
---|
66 | |
---|
67 | flags como-win32 CFLAGS <cflags> ; |
---|
68 | flags como-win32 CFLAGS : -D_WIN32 ; # make sure that we get the Boost Win32 platform config header. |
---|
69 | flags como-win32 CFLAGS <threading>single : -DBOOST_SP_DISABLE_THREADS ; |
---|
70 | flags como-win32 CFLAGS <threading>multi : -D_MT ; # make sure that our config knows that threading is on. |
---|
71 | flags como-win32 C++FLAGS <cxxflags> ; |
---|
72 | flags como-win32 DEFINES <define> ; |
---|
73 | flags como-win32 UNDEFS <undef> ; |
---|
74 | flags como-win32 HDRS <include> ; |
---|
75 | flags como-win32 SYSHDRS <sysinclude> ; |
---|
76 | flags como-win32 LINKFLAGS <linkflags> ; |
---|
77 | flags como-win32 ARFLAGS <arflags> ; |
---|
78 | flags como-win32 NO_WARN <no-warn> ; |
---|
79 | |
---|
80 | flags como-win32 STDHDRS : $(COMO_INCLUDE_PATH) ; |
---|
81 | flags como-win32 STDLIB_PATH : $(COMO_STDLIB_PATH)$(SLASH) ; |
---|
82 | |
---|
83 | flags como-win32 LIBPATH <library-path> ; |
---|
84 | flags como-win32 NEEDLIBS <library-file> ; |
---|
85 | flags como-win32 FINDLIBS <find-library> ; |
---|
86 | |
---|
87 | #### Link #### |
---|
88 | |
---|
89 | rule Link-action |
---|
90 | { |
---|
91 | with-command-file como-Link-action $(<) : $(>) ; |
---|
92 | } |
---|
93 | |
---|
94 | # for como, we repeat all libraries so that dependencies are always resolved |
---|
95 | actions como-Link-action bind NEEDLIBS |
---|
96 | { |
---|
97 | $(COMO_BACKEND_SETUP) |
---|
98 | $(COMO_BACKEND_INCLUDE_SETUP) |
---|
99 | $(COMO_BACKEND_LIB_SETUP) |
---|
100 | $(COMO_PATH_SETUP) |
---|
101 | $(COMO_BASE_SETUP) |
---|
102 | $(COMO_CMD) --no_version --no_prelink_verbose $(LINKFLAGS) -o "$(<[1]:S=)" @"$(>)" "$(NEEDLIBS)" "$(FINDLIBS:S=.lib)" |
---|
103 | } |
---|
104 | |
---|
105 | |
---|
106 | #### Cc ##### |
---|
107 | |
---|
108 | rule Cc-action |
---|
109 | { |
---|
110 | if $(>:G=:D=) in $(NO_WARN) { WARN on $(<) = "" ; } |
---|
111 | else { WARN on $(<) = --a -DBOOST_COMO_STRICT=1 ; } |
---|
112 | como-Cc-action $(<) : $(>) ; |
---|
113 | } |
---|
114 | |
---|
115 | actions como-Cc-action |
---|
116 | { |
---|
117 | $(COMO_BACKEND_SETUP) |
---|
118 | $(COMO_BACKEND_INCLUDE_SETUP) |
---|
119 | $(COMO_BACKEND_LIB_SETUP) |
---|
120 | $(COMO_PATH_SETUP) |
---|
121 | $(COMO_BASE_SETUP) |
---|
122 | $(COMO_CMD) -c --c99 -e5 --no_version --display_error_number --diag_suppress=9,21,161,748,940,962 -U$(UNDEFS) -D$(DEFINES) $(WARN) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<:D=)" "$(>)" |
---|
123 | } |
---|
124 | |
---|
125 | #### C++ #### |
---|
126 | rule C++-action |
---|
127 | { |
---|
128 | if $(>:G=:D=) in $(NO_WARN) { WARN on $(<) = "" ; } |
---|
129 | else { WARN on $(<) = --a -DBOOST_COMO_STRICT=1 ; } |
---|
130 | como-C++-action $(<) : $(>) ; |
---|
131 | } |
---|
132 | |
---|
133 | actions como-C++-action |
---|
134 | { |
---|
135 | $(COMO_BACKEND_SETUP) |
---|
136 | $(COMO_BACKEND_INCLUDE_SETUP) |
---|
137 | $(COMO_BACKEND_LIB_SETUP) |
---|
138 | $(COMO_PATH_SETUP) |
---|
139 | $(COMO_BASE_SETUP) |
---|
140 | $(COMO_CMD) -c -e5 --no_version --no_prelink_verbose --display_error_number --long_long --diag_suppress=9,21,161,748,940,962 -D__STL_LONG_LONG -U$(UNDEFS) -D$(DEFINES) $(WARN) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<)" "$(>)" |
---|
141 | } |
---|
142 | |
---|
143 | #### Archive #### |
---|
144 | |
---|
145 | rule Archive-action |
---|
146 | { |
---|
147 | with-command-file como-Archive-action $(<) : $(>) ; |
---|
148 | } |
---|
149 | |
---|
150 | actions updated together piecemeal como-Archive-action |
---|
151 | { |
---|
152 | $(COMO_BACKEND_SETUP) |
---|
153 | $(COMO_BACKEND_INCLUDE_SETUP) |
---|
154 | $(COMO_BACKEND_LIB_SETUP) |
---|
155 | $(COMO_PATH_SETUP) |
---|
156 | $(COMO_BASE_SETUP) |
---|
157 | $(COMO_CMD) --no_version --no_prelink_verbose --prelink_object @"$(>)" |
---|
158 | lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" @"$(>)" |
---|
159 | } |
---|
160 | |
---|