Adding -O3 for every platform - naim
[dyninst.git] / make.config
1 #
2 # $Log: make.config,v $
3 # Revision 1.43  1997/09/05 21:52:16  naim
4 # Adding -O3 for every platform - naim
5 #
6 # Revision 1.42  1997/09/05 13:13:15  naim
7 # Adding -O3 option only for solaris platforms - naim
8 #
9 # Revision 1.41  1997/09/04 22:50:51  naim
10 # Adding optimization option - naim
11 #
12 # Revision 1.40  1997/08/19 19:50:20  naim
13 # Adding support to dynamically link libdyninstRT by using dlopen on sparc-
14 # solaris - naim
15 #
16 # Revision 1.39  1997/05/07 19:03:40  naim
17 # Getting rid of old support for threads and turning it off until the new
18 # version is finished. Additionally, new superTable, baseTable and superVector
19 # classes for future support of multiple threads. The fastInferiorHeap class has
20 # also changed - naim
21 #
22 # Revision 1.38  1997/02/28 15:54:50  naim
23 # Turning MT_THREAD flag to "true" in order to use vector of counter/timers - naim
24 #
25 # Revision 1.37  1997/01/27 19:35:52  naim
26 # Part of the base instrumentation for supporting multithreaded applications
27 # (vectors of counter/timers) implemented for all current platforms +
28 # different bug fixes - naim
29 #
30 # Revision 1.36  1996/11/26 16:02:13  naim
31 # Implementation of cross-compiler (sparc-solaris,x86-solaris)->rs6000 - naim
32 #
33 # Revision 1.35  1996/11/08 23:38:17  tamches
34 # added support for a DEBUG_FLAG of 'none'
35 #
36 # Revision 1.34  1996/10/28 23:05:52  tamches
37 # added DEBUG_FLAG feature
38 #
39 # Revision 1.33  1996/10/18 23:46:03  mjrg
40 # Solaris/X86 port
41 #
42 # Revision 1.32  1996/08/05 07:08:18  tamches
43 # Added BACKUP_CORE, which removes several "/p/paradyn" dependencies.
44 # Upgraded to tcl 7.5
45 # removed obsolete USES_BLT
46 # removed AIX kludges for FLEX_DIR
47 #
48 # Revision 1.31  1996/05/12 04:36:48  tamches
49 # FLEX_DIR in /usr/local/lib for aix 4.1
50 #
51 # Revision 1.30  1996/04/06 21:18:08  hollings
52 # Removed write-strings warning (eliminates several thousand warnings on AIX
53 # that are due to bad system header files).
54 #
55 # Revision 1.29  1996/01/05  19:43:18  tamches
56 # IGEN, TCL2C, and TCLTK_INCLUDES (IGEN is a new variable) set more
57 # intelligently (we look for several possibilities)
58 #
59 # Revision 1.28  1995/12/29 20:09:30  tamches
60 # Changed the collector to gcc 2.7.1's "ld", from 2.6.3
61 #
62 # Revision 1.27  1995/12/20 01:09:55  tamches
63 # removed -L/usr/psup/lib from LIBDIR
64 # removed TCLTK_DIRS, replacing with 2 different things:
65 #    TCLTK_INCLUDES and TCLTK_LIBS
66 # TCL2C and TCL2C_GEN_SRCS added
67 # changed FLEX_DIR to a new directory
68 # removed LIBERTY_DIR and associated stuff (not needed anymore)
69 #
70
71 AS              = /bin/as
72 CC              = gcc
73
74 ifdef CROSSCOMPILER
75 AS              = /p/sp2/gcc/bin/rs6000-gcc
76 CC              = /p/sp2/gcc/bin/rs6000-gcc
77 endif
78
79 CXX             = g++
80 LEX             = flex
81 RANLIB          = ranlib
82 AR              = ar
83 YFLAGS          = -d -y
84 YACC            = bison
85 # COLLECTOR is only used by purify & quantify
86 COLLECTOR       = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
87
88 ifdef CROSSCOMPILER
89 CXX             = /p/sp2/gcc/bin/rs6000-gcc
90 AR              = /p/sp2/gcc/rs6000/bin/ar
91 RANLIB          = /p/sp2/gcc/rs6000/bin/ranlib
92 endif
93
94 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
95 AS              = /usr/ccs/bin/as
96 RANLIB          = true
97 endif
98 ifeq ($(PLATFORM),i386-unknown-solaris2.5)
99 AS              = /usr/ccs/bin/as
100 RANLIB          = true
101 endif
102
103 ifeq ($(PLATFORM),hppa1.1-hp-hpux)
104 COLLECTOR       = /usr/psup/gcc-2.6.3/lib/gcc-lib/hppa1.1-hp-hpux9.01/2.6.3/ld
105 endif
106
107
108 ifdef PLATFORM
109 ARCH_DEF        = -D$(shell echo $$PLATFORM | perl -pe 's/\./_/g;s/-/_/g')
110 else
111 ERROR PLATFORM MUST BE DEFINED IN ORDER TO BUILD PARADYN
112 endif
113
114 # most "main" modules are only two levels deep, but we need to be able to
115 # change this for those that are deeper in the tree
116 ifndef TO_CORE
117 TO_CORE         = ../..
118 endif
119
120 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
121 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
122 # with cvs), then we should look in a backup location.  That's what this vrble
123 # is about.  It's used several times below in this file.
124 BACKUP_CORE = /p/paradyn/core
125
126 # Default module compiler; modules which want $(CC) should redefine
127 # this, **NOT** CC
128
129 MODCC           = $(CXX)
130 MODCFLAGS       = $(CXXFLAGS)
131
132 .SUFFIXES:      .I
133
134 # VPATH         = ../src:$(TO_CORE)/../lib/$(PLATFORM):/p/paradyn/lib/$(PLATFORM)
135
136 IFLAGS          = -I. -I$(TO_CORE)
137
138 ASFLAGS         = -P $(ARCH_DEF)
139
140 COMMONWARNINGS  = -W -Wall -Wtraditional -Wshadow -Wpointer-arith       \
141                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
142                 -Wconversion -Wstrict-prototypes        \
143                 -Wmissing-prototypes -Wmissing-declarations             \
144                 -Wredundant-decls -Woverloaded-virtual
145
146 # not as strict as above, but can actually be used -- mdc
147 USEFULWARNINGS  = -W -Wall -Wtraditional -Wpointer-arith       \
148                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
149                 -Wconversion -Wstrict-prototypes        \
150                 -Wmissing-prototypes -Wmissing-declarations             \
151                 -Woverloaded-virtual 
152
153 # being nice to poor old pathetic tcl/tk header files --ari
154 TCLFRIENDLYWARNINGS = -W -Wall -Wtraditional -Wpointer-arith \
155                 -Wbad-function-cast -Wcast-qual \
156                 -Wconversion -Wstrict-prototypes \
157                 -Wmissing-prototypes -Wmissing-declarations \
158                 -Woverloaded-virtual
159
160 #don't inline -- for the files that won't emit template code
161 INLINE_DEFINES = 
162
163 #inline the private members of the class -- templates.o can use this
164 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
165
166 # inline everything -- the way things should be
167 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
168
169 USES_MT_THREAD =
170 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
171 USES_LIBDYNINSTRT_SO = true
172 endif
173
174 OPT_FLAG        = -O3
175
176 CFLAGS          = $(IFLAGS) -Wall $(ARCH_DEF) $(OPT_FLAG)
177 CXXFLAGS        = $(IFLAGS) -Wall $(ARCH_DEF) $(OPT_FLAG)
178
179 ifdef USES_MT_THREAD
180 CFLAGS          += -DMT_THREAD
181 CXXFLAGS        += -DMT_THREAD
182 endif
183
184 ifdef USES_LIBDYNINSTRT_SO
185 CFLAGS          += -DUSES_LIBDYNINSTRT_SO
186 CXXFLAGS        += -DUSES_LIBDYNINSTRT_SO
187 endif
188
189 # flags for kludge files, won't have warnings generated
190 KFLAGS          = $(IFLAGS) -Wall $(ARCH_DEF)
191
192 ifndef OPT_FLAG
193 KFLAGS          += -g
194 ifndef DEBUG_FLAG
195 DEBUG_FLAG = -g
196 endif
197 endif
198
199 ifeq ($(DEBUG_FLAG),none)
200 DEBUG_FLAG =
201 endif
202
203 ifdef DEBUG_FLAG
204 CFLAGS   += $(DEBUG_FLAG)
205 CXXFLAGS += $(DEBUG_FLAG)
206 KFLAGS   += $(DEBUG_FLAG)
207 endif
208
209 # flags for template files, don't define external template flags
210 # -g is optional in this case -- should be defined at module level
211 TFLAGS          = $(IFLAGS) -Wall $(TEMP_INLINE_DEFINES) $(ARCH_DEF) \
212                         $(OPT_FLAG)
213
214 ifdef USES_MT_THREAD
215 TFLAGS          += -DMT_THREAD
216 endif
217
218 ifdef USES_LIBDYNINSTRT_SO
219 TFLAGS          += -DUSES_LIBDYNINSTRT_SO
220 endif
221
222 ifdef DO_INLINE_ALL
223 CFLAGS         += $(ALL_INLINE_DEFINES)
224 CXXFLAGS       += $(ALL_INLINE_DEFINES)
225 endif
226
227 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
228 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
229 # we stick in (BACKUP_CORE)/lib _second_.
230 LIBDIR          = -L$(TO_CORE)/../lib/$(PLATFORM) \
231                         -L$(BACKUP_CORE)/../lib/$(PLATFORM)
232
233 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
234 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
235 # else set it to just "igen" (i.e. assume it's in the user's path)
236 ifdef CROSSCOMPILER
237 IGEN = $(shell if [ -f $(TO_CORE)/../bin/$(BASEPLATFORM)/igen ]; then echo $(TO_CORE)/../bin/$(BASEPLATFORM)/igen; else if [ -f $(BACKUP_CORE)/../bin/$(BASEPLATFORM)/igen ]; then echo $(BACKUP_CORE)/../bin/$(BASEPLATFORM)/igen; else echo igen; fi; fi )
238 else
239 IGEN = $(shell if [ -f $(TO_CORE)/../bin/$(PLATFORM)/igen ]; then echo $(TO_CORE)/../bin/$(PLATFORM)/igen; else if [ -f $(BACKUP_CORE)/../bin/$(PLATFORM)/igen ]; then echo $(BACKUP_CORE)/../bin/$(PLATFORM)/igen; else echo igen; fi; fi )
240 endif
241
242 ifdef NO_IMPLICIT_TEMPLATES
243 CFLAGS          += -fno-implicit-templates
244 CXXFLAGS        += -fno-implicit-templates
245 KFLAGS          += -fno-implicit-templates
246 TFLAGS          += -fno-implicit-templates
247 endif
248
249 ifndef INSTANTIATE_TEMPLATES
250 ifndef NO_IMPLICIT_TEMPLATES
251 # -fexternal-templates and -Dexternal_templates should both be used or
252 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
253 # (but not to TFLAGS).
254 #
255 CFLAGS          +=  -fexternal-templates -Dexternal_templates
256 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
257 KFLAGS          +=  -fexternal-templates -Dexternal_templates
258 endif
259 endif
260
261 ifdef USES_PVM
262 PVM_DIR         = $(PVM_ROOT)/lib/$(PVM_ARCH)
263 IFLAGS          += -I$(PVM_ROOT)/include
264 LIBDIR          += $(patsubst %,-L%,$(PVM_DIR))
265 VPATH           += $(PVM_DIR)
266 endif
267
268 ifdef USES_TCLTK
269 # Set TCL2C to $(TO_CORE)/tclStuff/tcl2c, if it exists, else
270 # set it to $(BACKUP_CORE)/tclStuff/tcl2c, if it exists, else
271 # set it to just tcl2c (i.e. assume it's in the user's shell path)
272 TCL2C           = $(shell if [ -f $(TO_CORE)/tclStuff/tcl2c ]; then echo $(TO_CORE)/tclStuff/tcl2c; else if [ -f $(BACKUP_CORE)/tclStuff/tcl2c ]; then echo $(BACKUP_CORE)/tclStuff/tcl2c; else echo tcl2c; fi; fi )
273 TCL2C_GEN_SRCS  = tcl2c.C
274
275 # Set TCLTK_INCLUDES to $(TO_CORE)/tclStuff/include, if it exists,
276 # else set it to $(BACKUP_CORE)/tclStuff/include.
277 TCLTK_INCLUDES  = $(shell if [ -d $(TO_CORE)/tclStuff/include ]; then echo $(TO_CORE)/tclStuff/include; else echo $(BACKUP_CORE)/tclStuff/include; fi )
278
279 TCLTK_LIBS      = /p/paradyn/packages/tcl7.5
280
281 IFLAGS          += $(patsubst %,-I%,$(TCLTK_INCLUDES))
282 ifdef CROSSCOMPILER
283 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_LIBS))
284 else
285 LIBDIR          += $(patsubst %,-L%/lib,$(TCLTK_LIBS))
286 endif
287 endif
288
289 ifdef USES_FLEX
290 FLEX_DIR        = /s/flex/lib
291 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
292 VPATH           += $(FLEX_DIR)
293 endif
294
295 ifdef CROSSCOMPILER
296 FLEX_DIR        = /s/flex/rs_aix41/lib
297 LIBDIR          += -L/p/sp2/gcc/lib 
298 endif
299
300 ifdef USES_LIBERTY
301 # Since libiberty.a is in the same g++ directory as libstdc++.a and
302 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
303 endif
304
305 ifdef USES_X11
306 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
307 CFLAGS          += -I/usr/openwin/include
308 CXXFLAGS        += -I/usr/openwin/include
309 TFLAGS          += -I/usr/openwin/include
310 LIBDIR          += -R/usr/openwin/lib -L/usr/openwin/lib
311 VPATH           += /usr/openwin/lib
312 endif
313
314 ifeq ($(PLATFORM),i386-unknown-solaris2.5)
315 CFLAGS          += -I/usr/openwin/include
316 CXXFLAGS        += -I/usr/openwin/include
317 TFLAGS          += -I/usr/openwin/include
318 LIBDIR          += -R/usr/openwin/lib -L/usr/openwin/lib
319 VPATH           += /usr/openwin/lib
320 endif
321
322 endif
323
324 # Include any per-user configuration changes; this "local" config file
325 # should *not* be under CVS control, so that it never gets committed.
326
327 -include $(TO_CORE)/make.config.local