/[resiprocate]/main/build/Makefile.osarch
ViewVC logotype

Contents of /main/build/Makefile.osarch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5295 - (show annotations) (download)
Mon Aug 22 00:30:05 2005 UTC (14 years, 3 months ago) by jason
File size: 5640 byte(s)
merged 5270:HEAD from b-directory-reorg
1 # $Id: Makefile.osarch,v 1.12 2004/02/18 22:56:38 jason Exp $
2
3 ######################################################################
4
5 # these options are NECESSARY options for a give operating system or
6 # architecture. If they could or should be turned off, they shouldn't
7 # be here (or they should be wrapped in if code that is controllable
8 # in Makefile.pre (now - moved from Makefile.opt)
9
10 ############################## FreeBSD ##############################
11
12 # recent FreeBSDs (as of 6/1999) should have a sufficiently modern
13 # version of ecgs to build this code cleanly with the default c++
14 # compiler, but the releases generally don't. install the ecgs
15 # port/package for older versions.
16
17 ifeq ($(OSTYPE),FreeBSD)
18
19 USE_LIBGETOPT = 1
20 USE_R_WRAPPER = 1
21
22 endif
23
24 ############################## NetBSD ##############################
25
26 # sounds like BSD
27 # toolchain is closer to Solaris
28
29 ifeq ($(OSTYPE),NetBSD)
30
31 # pull in system-specific changes (if available)
32 -include /etc/mk.conf
33
34 CPUFLAGS := $(shell test -x /usr/pkg/bin/cpuflags && /usr/pkg/bin/cpuflags)
35
36 CXXFLAGS += -D_REENTRANT
37 CFLAGS += -D_REENTRANT
38
39 INCDIRS += /usr/pkg/include
40 LIBDIRS += /usr/pkg/lib
41
42 LDFLAGS += -Wl,-rpath=/usr/pkg/lib
43 CXXFLAGS += $(CPUFLAGS)
44 CFLAGS += $(CPUFLAGS)
45
46 endif
47
48 ############################## Linux ##############################
49
50 ifeq ($(OSTYPE),Linux)
51
52 ifeq ($(ARCH),i686)
53 CXXFLAGS += -march=i686
54 endif
55 ifeq ($(ARCH),i486)
56 CXXFLAGS += -march=i486
57 endif
58 ifeq ($(ARCH),i386)
59 CXXFLAGS += -march=i386
60 endif
61
62 CXXFLAGS += -D_REENTRANT
63 CFLAGS += -D_REENTRANT
64
65 ifeq ($(USE_GOOGLE_MALLOC),true)
66 LDLIBS_LAST += -lprofiler
67 endif
68
69 ifeq ($(USE_GOOGLE_CPUPERF),true)
70 LDLIBS_LAST += -ltcmalloc
71 endif
72
73 endif
74
75
76 ############################# QNX ##################################
77
78 ifeq ($(OSTYPE),QNX)
79 CXXFLAGS += -D_REENTRANT
80 CFLAGS += -D_REENTRANT
81 LDLIBS_LAST += -lsocket -lstdc++
82 USE_SSL = false
83 endif
84
85
86 ############################## Solaris ##############################
87
88 ifeq ($(OSTYPE),SunOS)
89
90 USE_LIBGETOPT = 1
91 CFLAGS += -DSUNXIL_WARNING_DISABLE
92 CXXFLAGS += -DSUNXIL_WARNING_DISABLE
93
94 INCDIRS += /opt/sfw/include
95 LIBDIRS += /opt/sfw/lib
96
97 ifeq ($(VOCAL_TOOLCHAIN_TYPE),gnu)
98 CXXFLAGS += -D_REENTRANT
99 CFLAGS += -D_REENTRANT
100 LDLIBS_LAST += -R/usr/local/lib -lnsl -lsocket
101 else
102 CXXFLAGS += -D_REENTRANT -mt -D_RWSTD_MULTI_THREAD -dalign -xarch=v8plus
103 CFLAGS += -D_REENTRANT -xarch=v8plus
104 LDFLAGS += -DTHREAD=MULTI -mt -dalign -xarch=v8plus -L/opt/SUNWspro/WS6/lib/rw7 -L/opt/SUNWspro/WS6/lib/
105 LDLIBS_LAST += -lrwtool -liostream -lnsl -lsocket -lCstd
106 endif
107
108 endif
109
110
111 ############################## MacOS X ##############################
112
113 # Mac OS X is missing poll and some pthreads bits which are built by
114 # the
115
116 ifeq ($(OSTYPE),Darwin)
117
118 -include /etc/mk.conf
119
120 CXXFLAGS += -D_REENTRANT
121 CFLAGS += -D_REENTRANT
122
123 INCDIRS += /sw/include
124 LIBDIRS += /sw/lib
125
126 USE_LIBGETOPT = 1
127 USE_R_WRAPPER = 1
128
129 endif
130
131
132 ############################ cygwin ##################################
133
134 ifeq ($(OSTYPE),cygwin)
135
136 USE_LIBGETOPT = 1
137 INCDIRS += $(ROOT)/contrib/win32/mingw/include $(ROOT)/contrib/win32/pthreads
138
139 endif
140
141
142 ifeq ($(VOCAL_PROCESSOR_OPTS),1)
143 ifeq ($(ARCH),i686)
144 CXXFLAGS += -march=i686
145 CFLAGS += -march=i686
146 LDFLAGS +=
147 LDLIBS +=
148 endif
149 endif
150
151
152
153 # set up general compilation options
154
155 LDFLAGS +=
156 CXXFLAGS +=
157 CFLAGS +=
158 LDLIBS +=
159 INCDIRS +=
160
161
162
163 ######################################################################
164
165 # this section lets you override the default compile type
166
167 ######################################################################
168
169 ifdef CODE_OPTIMIZE
170 VOCAL_COMPILE_TYPE := opt
171 endif
172
173 ifdef CODE_GOPTIMIZE
174 VOCAL_COMPILE_TYPE := gopt
175 endif
176
177 ifdef CODE_PROFILE
178 VOCAL_COMPILE_TYPE := prof
179 endif
180
181 ifdef CODE_NODEBUG
182 VOCAL_COMPILE_TYPE := nodebug
183 endif
184
185 ifdef CODE_SMALL
186 VOCAL_COMPILE_TYPE := small
187 endif
188
189 ifdef LIB_DYNAMIC
190 BUILD_SHARED_LIBS := yes
191 endif
192
193 TARGET_TYPE := $(VOCAL_COMPILE_TYPE)
194
195
196 ifeq ($(VOCAL_COMPILE_TYPE),small)
197 CXXFLAGS += $(COMPILE_SMALL_FLAG)
198 CFLAGS += $(COMPILE_SMALL_FLAG)
199 endif
200
201 ifeq ($(VOCAL_COMPILE_TYPE),nodebug)
202 endif
203
204 ifeq ($(VOCAL_COMPILE_TYPE),debug)
205 CXXFLAGS += $(DEBUG_FLAG)
206 CFLAGS += $(DEBUG_FLAG)
207 endif
208
209 ifeq ($(VOCAL_COMPILE_TYPE),opt)
210 CXXFLAGS += $(OPTFLAGS) #-DNDEBUG
211 CFLAGS += $(OPTFLAGS) #-DNDEBUG
212 endif
213
214 ifeq ($(VOCAL_COMPILE_TYPE),gopt)
215 CXXFLAGS += $(DEBUG_FLAG) $(OPTFLAGS)
216 CFLAGS += $(DEBUG_FLAG) $(OPTFLAGS)
217 endif
218
219
220 # profiling
221
222 ifeq ($(VOCAL_COMPILE_TYPE),prof)
223 LDFLAGS += -pg $(OPTFLAGS) -DNDEBUG
224 CXXFLAGS += -pg $(OPTFLAGS) -DNDEBUG
225 CFLAGS += -pg $(OPTFLAGS) -DNDEBUG
226 endif
227
228 ######################################################################
229 # More Toolchain defaults
230 ######################################################################
231
232 DISTCC = distcc
233 CCACHE = ccache
234
235 ifeq ($(OSCLASS),VXWORKS)
236
237 # these are VxWorks defaults
238
239 # by default, we will use a real linker as the linker
240
241 ifndef LINKER
242 LINKER = $(LD)
243 endif
244
245 LDFLAGS += -Ur
246
247 endif
248
249
250
251
252 # SH hardware -- this code should actually be separated as this is
253 # toolchain stuff, by and large.
254
255
256 ifeq ($(ARCH),sh)
257
258 CXX=sh-wrs-vxworks-g++
259 DEP=sh-wrs-vxworks-gcc
260 CC=sh-wrs-vxworks-gcc
261 AR=sh-wrs-vxworks-ar
262 LD=sh-wrs-vxworks-ld
263 CROSS_COMPILE=1
264 DEFINES += BSD43_COMPATIBLE
265 CXXFLAGS +=
266 CFLAGS +=
267 LDFLAGS += -L/usr/local/lib/gcc-lib/sh-wrs-vxworks/2.95.1/m2
268 LDLIBS_LAST += -lstdc++ -lgcc
269 OSCLASS = VXWORKS
270
271 endif
272
273 OS_ARCH := $(OSTYPE).$(ARCH)
274 TARGET_NAME := $(TARGET_TYPE).$(OS_ARCH)

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27