added DEBUG_FLAG feature
[dyninst.git] / make.config
1 #
2 # $Log: make.config,v $
3 # Revision 1.34  1996/10/28 23:05:52  tamches
4 # added DEBUG_FLAG feature
5 #
6 # Revision 1.33  1996/10/18 23:46:03  mjrg
7 # Solaris/X86 port
8 #
9 # Revision 1.32  1996/08/05 07:08:18  tamches
10 # Added BACKUP_CORE, which removes several "/p/paradyn" dependencies.
11 # Upgraded to tcl 7.5
12 # removed obsolete USES_BLT
13 # removed AIX kludges for FLEX_DIR
14 #
15 # Revision 1.31  1996/05/12 04:36:48  tamches
16 # FLEX_DIR in /usr/local/lib for aix 4.1
17 #
18 # Revision 1.30  1996/04/06 21:18:08  hollings
19 # Removed write-strings warning (eliminates several thousand warnings on AIX
20 # that are due to bad system header files).
21 #
22 # Revision 1.29  1996/01/05  19:43:18  tamches
23 # IGEN, TCL2C, and TCLTK_INCLUDES (IGEN is a new variable) set more
24 # intelligently (we look for several possibilities)
25 #
26 # Revision 1.28  1995/12/29 20:09:30  tamches
27 # Changed the collector to gcc 2.7.1's "ld", from 2.6.3
28 #
29 # Revision 1.27  1995/12/20 01:09:55  tamches
30 # removed -L/usr/psup/lib from LIBDIR
31 # removed TCLTK_DIRS, replacing with 2 different things:
32 #    TCLTK_INCLUDES and TCLTK_LIBS
33 # TCL2C and TCL2C_GEN_SRCS added
34 # changed FLEX_DIR to a new directory
35 # removed LIBERTY_DIR and associated stuff (not needed anymore)
36 #
37
38 AS              = /bin/as
39 CC              = gcc
40 CXX             = g++
41 LEX             = flex
42 RANLIB          = ranlib
43 YFLAGS          = -d -y
44 YACC            = bison
45 # COLLECTOR is only used by purify & quantify
46 COLLECTOR       = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
47
48
49 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
50 AS              = /usr/ccs/bin/as
51 RANLIB          = true
52 endif
53 ifeq ($(PLATFORM),i386-unknown-solaris2.5)
54 AS              = /usr/ccs/bin/as
55 RANLIB          = true
56 endif
57
58 ifeq ($(PLATFORM),hppa1.1-hp-hpux)
59 COLLECTOR       = /usr/psup/gcc-2.6.3/lib/gcc-lib/hppa1.1-hp-hpux9.01/2.6.3/ld
60 endif
61
62
63 ifdef PLATFORM
64 ARCH_DEF        = -D$(shell echo $$PLATFORM | perl -pe 's/\./_/g;s/-/_/g')
65 else
66 ERROR PLATFORM MUST BE DEFINED IN ORDER TO BUILD PARADYN
67 endif
68
69 # most "main" modules are only two levels deep, but we need to be able to
70 # change this for those that are deeper in the tree
71 ifndef TO_CORE
72 TO_CORE         = ../..
73 endif
74
75 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
76 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
77 # with cvs), then we should look in a backup location.  That's what this vrble
78 # is about.  It's used several times below in this file.
79 BACKUP_CORE = /p/paradyn/core
80
81 # Default module compiler; modules which want $(CC) should redefine
82 # this, **NOT** CC
83
84 MODCC           = $(CXX)
85 MODCFLAGS       = $(CXXFLAGS)
86
87 .SUFFIXES:      .I
88
89 # VPATH         = ../src:$(TO_CORE)/../lib/$(PLATFORM):/p/paradyn/lib/$(PLATFORM)
90
91 IFLAGS          = -I. -I$(TO_CORE)
92
93 ASFLAGS         = -P $(ARCH_DEF)
94
95 COMMONWARNINGS  = -W -Wall -Wtraditional -Wshadow -Wpointer-arith       \
96                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
97                 -Wconversion -Wstrict-prototypes        \
98                 -Wmissing-prototypes -Wmissing-declarations             \
99                 -Wredundant-decls -Woverloaded-virtual
100
101 # not as strict as above, but can actually be used -- mdc
102 USEFULWARNINGS  = -W -Wall -Wtraditional -Wpointer-arith       \
103                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
104                 -Wconversion -Wstrict-prototypes        \
105                 -Wmissing-prototypes -Wmissing-declarations             \
106                 -Woverloaded-virtual 
107
108 # being nice to poor old pathetic tcl/tk header files --ari
109 TCLFRIENDLYWARNINGS = -W -Wall -Wtraditional -Wpointer-arith \
110                 -Wbad-function-cast -Wcast-qual \
111                 -Wconversion -Wstrict-prototypes \
112                 -Wmissing-prototypes -Wmissing-declarations \
113                 -Woverloaded-virtual
114
115 #don't inline -- for the files that won't emit template code
116 INLINE_DEFINES = 
117
118 #inline the private members of the class -- templates.o can use this
119 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
120
121 # inline everything -- the way things should be
122 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
123
124
125 CFLAGS          = $(IFLAGS) -Wall $(ARCH_DEF)
126 CXXFLAGS          = $(IFLAGS) -Wall $(ARCH_DEF)
127
128 # flags for kludge files, won't have warnings generated
129 KFLAGS          = $(IFLAGS) -g -Wall $(ARCH_DEF)
130
131 ifndef DEBUG_FLAG
132 DEBUG_FLAG = -g
133 endif
134
135 CFLAGS   += $(DEBUG_FLAG)
136 CXXFLAGS += $(DEBUG_FLAG)
137 KFLAGS   += $(DEBUG_FLAG)
138
139 # flags for template files, don't define external template flags
140 # -g is optional in this case -- should be defined at module level
141 TFLAGS          = $(IFLAGS) -Wall $(TEMP_INLINE_DEFINES) $(ARCH_DEF)
142
143 ifdef DO_INLINE_ALL
144 CFLAGS         += $(ALL_INLINE_DEFINES)
145 CXXFLAGS       += $(ALL_INLINE_DEFINES)
146 endif
147
148 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
149 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
150 # we stick in (BACKUP_CORE)/lib _second_.
151 LIBDIR          = -L$(TO_CORE)/../lib/$(PLATFORM) \
152                         -L$(BACKUP_CORE)/../lib/$(PLATFORM)
153
154 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
155 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
156 # else set it to just "igen" (i.e. assume it's in the user's path)
157 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 )
158
159 ifdef NO_IMPLICIT_TEMPLATES
160 CFLAGS          += -fno-implicit-templates
161 CXXFLAGS        += -fno-implicit-templates
162 KFLAGS          += -fno-implicit-templates
163 TFLAGS          += -fno-implicit-templates
164 endif
165
166 ifndef INSTANTIATE_TEMPLATES
167 ifndef NO_IMPLICIT_TEMPLATES
168 # -fexternal-templates and -Dexternal_templates should both be used or
169 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
170 # (but not to TFLAGS).
171 #
172 CFLAGS          +=  -fexternal-templates -Dexternal_templates
173 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
174 KFLAGS          +=  -fexternal-templates -Dexternal_templates
175 endif
176 endif
177
178 ifdef USES_PVM
179 PVM_DIR         = $(PVM_ROOT)/lib/$(PVM_ARCH)
180 IFLAGS          += -I$(PVM_ROOT)/include
181 LIBDIR          += $(patsubst %,-L%,$(PVM_DIR))
182 VPATH           += $(PVM_DIR)
183 endif
184
185 ifdef USES_TCLTK
186 # Set TCL2C to $(TO_CORE)/tclStuff/tcl2c, if it exists, else
187 # set it to $(BACKUP_CORE)/tclStuff/tcl2c, if it exists, else
188 # set it to just tcl2c (i.e. assume it's in the user's shell path)
189 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 )
190 TCL2C_GEN_SRCS  = tcl2c.C
191
192 # Set TCLTK_INCLUDES to $(TO_CORE)/tclStuff/include, if it exists,
193 # else set it to $(BACKUP_CORE)/tclStuff/include.
194 TCLTK_INCLUDES  = $(shell if [ -d $(TO_CORE)/tclStuff/include ]; then echo $(TO_CORE)/tclStuff/include; else echo $(BACKUP_CORE)/tclStuff/include; fi )
195
196 TCLTK_LIBS      = /p/paradyn/packages/tcl7.5
197
198 IFLAGS          += $(patsubst %,-I%,$(TCLTK_INCLUDES))
199 LIBDIR          += $(patsubst %,-L%/lib,$(TCLTK_LIBS))
200 endif
201
202 ifdef USES_FLEX
203 FLEX_DIR        = /s/flex/lib
204 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
205 VPATH           += $(FLEX_DIR)
206 endif
207
208 ifdef USES_LIBERTY
209 # Since libiberty.a is in the same g++ directory as libstdc++.a and
210 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
211 endif
212
213 ifdef USES_X11
214 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
215 CFLAGS          += -I/usr/openwin/include
216 CXXFLAGS        += -I/usr/openwin/include
217 TFLAGS          += -I/usr/openwin/include
218 LIBDIR          += -R/usr/openwin/lib -L/usr/openwin/lib
219 VPATH           += /usr/openwin/lib
220 endif
221
222 ifeq ($(PLATFORM),i386-unknown-solaris2.5)
223 CFLAGS          += -I/usr/openwin/include
224 CXXFLAGS        += -I/usr/openwin/include
225 TFLAGS          += -I/usr/openwin/include
226 LIBDIR          += -R/usr/openwin/lib -L/usr/openwin/lib
227 VPATH           += /usr/openwin/lib
228 endif
229
230 endif
231
232
233 # Include any per-user configuration changes; this "local" config file
234 # should *not* be under CVS control, so that it never gets committed.
235
236 -include $(TO_CORE)/make.config.local