1 | #~ Copyright 2002 Christopher Currie, Gennadiy Rozental. |
---|
2 | #~ Copyright 2003 Christopher Currie. |
---|
3 | |
---|
4 | #~ Use, modification and distribution is subject to the Boost Software |
---|
5 | #~ License Version 1.0. (See accompanying file LICENSE_1_0.txt or |
---|
6 | #~ http://www.boost.org/LICENSE_1_0.txt) |
---|
7 | |
---|
8 | # The following #// line will be used by the regression test table |
---|
9 | # generation program as the column heading for HTML tables. Must not |
---|
10 | # include version number. |
---|
11 | #//<a href="http://wwws.sun.com/software/sundev/suncc/index.html">Sun<br>C++</a> |
---|
12 | |
---|
13 | # The sunpro toolset can be user-configured using the following |
---|
14 | # variables: |
---|
15 | # |
---|
16 | # SUNPRO_ROOT_DIRECTORY |
---|
17 | # The directory in which Sun C++ was installed. Defaults to |
---|
18 | # unset. Usually, there is no need to set this variable at all. |
---|
19 | # However, if CC is not in the path it is usually sufficient |
---|
20 | # to configure this one variable. More fine-grained configuration |
---|
21 | # is available by setting the following: |
---|
22 | # |
---|
23 | # SUNPRO_BIN_DIRECTORY |
---|
24 | # The directory prefix used to find the CC and cc executables. |
---|
25 | # Defaults to $(SUNPRO_ROOT_DIRECTORY)/bin/, or "" if |
---|
26 | # SUNPRO_ROOT_DIRECTORY is not set. |
---|
27 | # |
---|
28 | # SUNPRO_CXX |
---|
29 | # The name by which CC is invoked. Defaults to "CC". You can also |
---|
30 | # use this in lieu of setting the <cxxflags> property to force |
---|
31 | # options such as "-Qoption CC -xcomdat" into the CC command line: |
---|
32 | # "-sSUNPRO_CXX=CC -Qoption CC -xcomdat". |
---|
33 | # |
---|
34 | # SUNPRO_CC |
---|
35 | # Similar to SUNPRO_CXX, the name by which cc is invoked for "C" |
---|
36 | # language targets. |
---|
37 | |
---|
38 | # singleton variables... |
---|
39 | set-as-singleton SUNPRO_ROOT_DIRECTORY SUNPRO_BIN_DIRECTORY ; |
---|
40 | |
---|
41 | flags sunpro SUNPRO_BIN_DIRECTORY : $(SUNPRO_BIN_DIRECTORY) ; |
---|
42 | |
---|
43 | SUNPRO_BIN_DIRECTORY ?= $(SUNPRO_ROOT_DIRECTORY)/bin/ ; |
---|
44 | SUNPRO_BIN_DIRECTORY ?= "" ; # Don't clobber adjoining text if SUNPRO_ROOT_DIRECTORY isn't set |
---|
45 | |
---|
46 | # Make sure this gets set "on" the target |
---|
47 | flags sunpro SUNPRO_BIN_DIR : $(SUNPRO_BIN_DIRECTORY) ; |
---|
48 | |
---|
49 | flags sunpro LINKFLAGS <runtime-link>static : -staticlib=Crun ; |
---|
50 | flags sunpro LINKFLAGS <target-type>$(SHARED_TYPES) : -G ; |
---|
51 | flags sunpro CFLAGS <debug-symbols>on : -g ; |
---|
52 | flags sunpro LINKFLAGS <debug-symbols>on : -g ; |
---|
53 | flags sunpro CFLAGS <optimization>speed : -fast -O4 ; |
---|
54 | |
---|
55 | flags sunpro CFLAGS <optimization>space : -O2 -xspace ; |
---|
56 | flags sunpro C++FLAGS <inlining>off : +d ; |
---|
57 | flags sunpro CFLAGS <threading>multi : -mt ; |
---|
58 | flags sunpro LINKFLAGS <threading>multi : -mt ; |
---|
59 | flags sunpro C++FLAGS <rtti>on : -features=rtti ; |
---|
60 | flags sunpro C++FLAGS <rtti>off : -features=no%rtti ; |
---|
61 | flags sunpro C++FLAGS <exception-handling>on : -features=except ; |
---|
62 | flags sunpro C++FLAGS <exception-handling>off : -features=no%except ; |
---|
63 | |
---|
64 | flags sunpro DLLVERSION <dllversion> ; |
---|
65 | |
---|
66 | flags sunpro .CXX : $(SUNPRO_CXX) ; |
---|
67 | flags sunpro .CC : $(SUNPRO_CC) ; |
---|
68 | |
---|
69 | # architecture/instruction-set options |
---|
70 | .ARCH = <architecture>sparc <architecture>native ; |
---|
71 | flags sunpro CFLAGS <architecture>native/<instruction-set>default : -xtarget=generic ; |
---|
72 | flags sunpro CFLAGS $(.ARCH)/<instruction-set>v7 : -xarch=v7 ; |
---|
73 | flags sunpro CFLAGS $(.ARCH)/<instruction-set>v8 : -xarch=v8 ; |
---|
74 | flags sunpro CFLAGS $(.ARCH)/<instruction-set>v9 : -xarch=v9 ; |
---|
75 | flags sunpro CFLAGS $(.ARCH)/<instruction-set>supersparc : -xarch=v8 -xchip=super ; |
---|
76 | flags sunpro CFLAGS $(.ARCH)/<instruction-set>hypersparc : -xarch=v8 -xchip=hyper ; |
---|
77 | flags sunpro CFLAGS $(.ARCH)/<instruction-set>ultrasparc : -xarch=v8plus -xchip=ultra ; |
---|
78 | |
---|
79 | # The POSIX real-time library is always needed (nanosleep, clock_gettime etc.) |
---|
80 | flags sunpro FINDLIBS : rt ; |
---|
81 | |
---|
82 | flags sunpro CFLAGS <cflags> ; |
---|
83 | flags sunpro C++FLAGS <cxxflags> ; |
---|
84 | flags sunpro DEFINES <define> ; |
---|
85 | flags sunpro UNDEFS <undef> ; |
---|
86 | flags sunpro HDRS <include> ; |
---|
87 | flags sunpro SYSHDRS <sysinclude> ; |
---|
88 | flags sunpro LINKFLAGS <linkflags> ; |
---|
89 | flags sunpro LINKFLAGS <debug-symbols>off : -s ; |
---|
90 | flags sunpro ARFLAGS <arflags> ; |
---|
91 | flags sunpro LIBPATH <library-path> ; |
---|
92 | flags sunpro NEEDLIBS <library-file> ; |
---|
93 | flags sunpro FINDLIBS <find-library> ; |
---|
94 | |
---|
95 | flags sunpro TARGET_TYPE <target-type> ; |
---|
96 | |
---|
97 | .CXX ?= CC ; |
---|
98 | .CC ?= cc ; |
---|
99 | |
---|
100 | #### Link #### |
---|
101 | |
---|
102 | rule Link-action |
---|
103 | { |
---|
104 | _ on $(<) = " " ; |
---|
105 | |
---|
106 | if $(DLLVERSION) && $(TARGET_TYPE) in $(SHARED_TYPES) |
---|
107 | { |
---|
108 | SO_EXT on $(<) = ".$(DLLVERSION)" ; |
---|
109 | SO_VER on $(<) = ".$(DLLVERSION)" ; |
---|
110 | DO_LN on $(<) = "" ; |
---|
111 | } |
---|
112 | else |
---|
113 | { |
---|
114 | SO_EXT on $(<) = "" ; |
---|
115 | SO_VER on $(<) = ; |
---|
116 | DO_LN on $(<) = ; |
---|
117 | } |
---|
118 | |
---|
119 | sunpro-Link-action $(<) : $(>) ; |
---|
120 | } |
---|
121 | |
---|
122 | actions together sunpro-Link-action bind NEEDLIBS |
---|
123 | { |
---|
124 | $(.CXX[1]:R=$(SUNPRO_BIN_DIR)) $(.CXX[2-]) -xildoff -h,$(<[1]:D=)$(SO_VER) $(LINKFLAGS) -o "$(<[1]:T)$(SO_EXT)" -L"$(LIBPATH:T)" -L"$(STDLIBPATH)" "$(>)" "$(NEEDLIBS)" -l$(FINDLIBS) |
---|
125 | $(DO_LN)$(LN)$(_)"$(<[1]:T)$(SO_EXT)"$(_)"$(<[1])" |
---|
126 | } |
---|
127 | |
---|
128 | #### Archive #### |
---|
129 | |
---|
130 | rule Archive-action |
---|
131 | { |
---|
132 | sunpro-Archive-action $(<) : $(>) ; |
---|
133 | } |
---|
134 | |
---|
135 | actions together sunpro-Archive-action |
---|
136 | { |
---|
137 | $(.CXX[1]:R=$(SUNPRO_BIN_DIR)) $(.CXX[2]) -xar -o "$(<:T)" "$(>:T)" |
---|
138 | } |
---|
139 | |
---|
140 | #### Cc ##### |
---|
141 | |
---|
142 | rule Cc-action |
---|
143 | { |
---|
144 | sunpro-Cc-action $(<) : $(>) ; |
---|
145 | } |
---|
146 | |
---|
147 | actions sunpro-Cc-action |
---|
148 | { |
---|
149 | $(.CC[1]:R=$(SUNPRO_BIN_DIR)) $(.CC[2-]) -c -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<)" "$(>)" |
---|
150 | } |
---|
151 | |
---|
152 | #### C++ #### |
---|
153 | rule C++-action |
---|
154 | { |
---|
155 | sunpro-C++-action $(<) : $(>) ; |
---|
156 | } |
---|
157 | |
---|
158 | actions sunpro-C++-action |
---|
159 | { |
---|
160 | $(.CXX[1]:R=$(SUNPRO_BIN_DIR)) $(.CXX[2-]) -c -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<)" "$(>)" |
---|
161 | } |
---|
162 | |
---|