Partial support for integer divisions in access vectors
[suif.git] / Makefile.defs
blob917098c1d5f98d2a9e2652a79983b0de6dd06ee4
1 # GNU make no longer exports variables by default
2 export
4 unexport VERDATAFILE TMP_VERDATAFILE AUXILIARY_HEADERS TMP_YSRCS TMP_DSRCS
5 unexport TMP_HEADERS TMP_CSRCS TMP_SRCS TMP_INFOSRCS TMP_MANPAGES
6 unexport TMP_MANPAGES TMP_OTHERSRCS
7 unexport EXTRA_PURE EXTRA_YFLAGS EXTRA_CFLAGS EXTRA_CXXFLAGS
8 unexport LIBNAME_SET LIBNAME_SET_A LIBNAME_SET_B
9 unexport BASE_CFLAGS BASE_CXXFLAGS
11 # macro to initialize standard SUIF libraries
12 ifneq (,$(findstring -lsty,$(LIBS)))
13 START_STY =     start_sty.o
14 else
15 ifneq (,$(findstring -lsuif1,$(LIBS)))
16 START_STY =     start_sty.o
17 else
18 ifneq (,$(findstring -lmsuif,$(LIBS)))
19 START_STY =     start_sty.o
20 endif
21 endif
22 endif
24 ifdef AUTOINITLIB
25 REGISTER_LIB =  register_lib.o
26 endif
28 ifdef CC_OVERRIDE
29 CC =            $(CC_OVERRIDE)
30 endif
31 ifdef CXX_OVERRIDE
32 CXX =           $(CXX_OVERRIDE)
33 endif
35 ifeq (gcc,$(COMPILER_NAME))
37 #   Note:  We have turned off the ``unused'' warnings from g++ because
38 #       when this warning is enabled, it generates warning messages
39 #       for any function declared ``inline'' that is not used.  That
40 #       causes warnings for most cases of ``inline'' functions
41 #       declared in header files though there is nothing at all wrong
42 #       with such code.  Other warnings are not used because system
43 #       header files often trigger them or because code that we think
44 #       is valid and commonly used in SUIF triggers them.  For
45 #       example, comparing an unsigned to see if it is less than
46 #       zero.  We have lots of code that does this because we want the
47 #       same code to work whether certain typedef'ed types are signed
48 #       or unsigned integers.
50 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g -fPIC -Wall
51 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g -fPIC -pedantic -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wreorder -Wpointer-arith -DINLINE_ALL_TEMPLATES $(USE_SUIF_STRIPPED_HEADERS)
52 ifndef CC_OVERRIDE
53 CC =            gcc
54 endif
55 ifndef CXX_OVERRIDE
56 CXX =           g++
57 endif
58 DEPSFLAG =      -M
59 else
60 ifeq (gcc-repo,$(COMPILER_NAME))
61 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g -Wall
62 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g -pedantic -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wreorder -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DINLINE_ALL_TEMPLATES -frepo -DGCC_REPO_BUG_WORK_AROUND $(USE_SUIF_STRIPPED_HEADERS) -DANTIQUE_CPP
63 ifndef CC_OVERRIDE
64 CC =            gcc
65 endif
66 ifndef CXX_OVERRIDE
67 CXX =           g++
68 endif
69 DEPSFLAG =      -M
70 else
71 ifeq (egcs,$(COMPILER_NAME))
72 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g -Wall
73 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g -pedantic -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wreorder -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DINLINE_ALL_TEMPLATES -frepo -fno-exceptions -DGCC_REPO_BUG_WORK_AROUND $(USE_SUIF_STRIPPED_HEADERS)
74 ifndef CC_OVERRIDE
75 CC =            gcc
76 endif
77 ifndef CXX_OVERRIDE
78 CXX =           g++
79 endif
80 DEPSFLAG =      -M
81 else
82 ifeq (sgi_c++,$(COMPILER_NAME))
84 #   Note:
85 #       Warning 3247: ``unrecognized #pragma''
86 #           -- We use #pragmas for gcc that the Irix 5.3 C++ compiler
87 #              doesn't understand, but it should just silently ignore
88 #              them.
89 #       Warning 3672: ``Mangling of signed character does not match
90 #                     cfront name mangling.''
91 #           -- We don't care about C front.
92 #       Warning 3270: ``pointless comparison of unsigned integer with
93 #                     zero'' 
94 #           -- We use symbolic types that might be signed or unsigned,
95 #              so we really want to compare with zero even if the type
96 #              happens to be unsigned right now.
98 ifeq (mips-sgi-irix5.3,$(MACHINE))
99 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3672,3270
100 else
101 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3270,1155
102 endif
103 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =   -fullwarn -woff $(SUIF_SGI_WARNINGS_OFF) -g
104 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS = -fullwarn -woff $(SUIF_SGI_WARNINGS_OFF) -g -DNOBOOL -DNO_CONST_CAST -DINLINE_ALL_TEMPLATES
105 ifndef CC_OVERRIDE
106 CC =            cc
107 endif
108 ifndef CXX_OVERRIDE
109 CXX =           CC
110 endif
111 DEPSFLAG =      -M
112 else
113 ifeq (sun_procompiler,$(COMPILER_NAME))
114 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g -KPIC
115 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g -KPIC -DNOBOOL -DNO_CONST_CAST -DINLINE_ALL_TEMPLATES $(USE_SUIF_STRIPPED_HEADERS) -DANTIQUE_CPP
116 ifndef CC_OVERRIDE
117 CC =            cc
118 endif
119 ifndef CXX_OVERRIDE
120 CXX =           CC +w
121 endif
122 DEPSFLAG =      -xM1
123 else
124 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g
125 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g
126 ifndef CC_OVERRIDE
127 CC =            cc
128 endif
129 ifndef CXX_OVERRIDE
130 CXX =           CC
131 endif
132 DEPSFLAG =      -M
133 endif
134 endif
135 endif
136 endif
137 endif
139 ifeq (,$(SYSTEM_SPECIFIC_CFLAGS))
140 SYSTEM_SPECIFIC_CFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CFLAGS)
141 endif
142 ifeq (,$(SYSTEM_SPECIFIC_CXXFLAGS))
143 SYSTEM_SPECIFIC_CXXFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS)
144 endif
146 # The USER_CFLAGS and USER_CXXFLAGS variables are reserved for
147 # _users_.  They should never be defined in any Makefile.  The
148 # EXTRA_CFLAGS and EXTRA_CXXFLAGS variables are available for local
149 # Makefiles.
151 # standard definitions (SUIFHOME and MACHINE are read from the environment)
152 MACHDIR =       $(SUIFHOME)/$(MACHINE)
153 ifndef INCLDIR
154 INCLDIR =       $(SUIFHOME)/include
155 endif
156 ifndef SUIF_VERSION_1
157 INCLDIRFLAG =   $(LOCALINCLDIRS) -I$(INCLDIR) $(GLOBALINCLDIRS)
158 else
159 INCLDIRFLAG =   $(LOCALINCLDIRS) -I$(INCLDIR)/suif1_wrapper -I$(INCLDIR) $(GLOBALINCLDIRS)
160 endif
161 ifndef SRCDIR
162 SRCDIR =        $(SUIFHOME)/src
163 endif
164 ifndef MANDIR
165 MANDIR =        $(SUIFHOME)/$(MACHINE)/man
166 endif
167 ifndef INFODIR
168 INFODIR =       $(SUIFHOME)/info
169 endif
170 ifndef HTMLDIR
171 HTMLDIR =       $(SUIFHOME)/html
172 endif
173 ifndef DOCDIR
174 DOCDIR =        $(SUIFHOME)/docs
175 endif
176 ifndef LIBDIR
177 LIBDIR =        $(MACHDIR)/lib
178 endif
179 ifndef SODIR
180 SODIR =         $(MACHDIR)/solib
181 endif
182 ifndef AUTOINITDIR
183 AUTOINITDIR =   $(MACHDIR)/auto_init_libs
184 endif
185 ifndef VERDATADIR
186 VERDATADIR =    $(MACHDIR)/verdata
187 endif
188 ifndef NIGHTLYREADYDIR
189 NIGHTLYREADYDIR = $(SUIFHOME)/nightly_ready
190 endif
191 ifndef TCLDIR
192 TCLDIR =        $(SUIFHOME)/tcl
193 endif
194 ifndef STATIC_LIBS_ONLY
195 LIBDIRFLAG =    $(LOCALLIBDIRS) -L$(SODIR) -L$(LIBDIR) $(GLOBALLIBDIRS)
196 else
197 LIBDIRFLAG =    $(LOCALLIBDIRS) -L$(LIBDIR) $(GLOBALLIBDIRS)
198 endif
199 BINDIR =        $(MACHDIR)/bin
200 ifndef SCRIPTDIR
201 SCRIPTDIR =     $(SUIFHOME)/scripts
202 endif
203 SHELL =         /bin/sh
204 YACC =          bison
205 ifeq (,$(SHARLIT))
206 SHARLIT =       sharlit
207 endif
208 YFLAGS =        -y $(EXTRA_YFLAGS)
209 BASE_CFLAGS =   $(SYSTEM_SPECIFIC_CFLAGS) $(USER_CFLAGS)
210 BASE_CXXFLAGS = $(SYSTEM_SPECIFIC_CXXFLAGS) $(USER_CXXFLAGS)
211 CFLAGS =        $(BASE_CFLAGS) $(INCLDIRFLAG) $(EXTRA_CFLAGS)
212 CXXFLAGS =      $(BASE_CXXFLAGS) $(INCLDIRFLAG) $(EXTRA_CXXFLAGS)
213 CO =            co
214 COFLAGS =       -q
215 ifeq (,$(LD_LIBRARY_PATH))
216 DOT_LD_LIBRARY_PATH = .
217 else
218 DOT_LD_LIBRARY_PATH = .:$(LD_LIBRARY_PATH)
219 endif
220 ifndef LOGFILE
221 LOGFILE =       install.log
222 endif
223 ifndef NIGHTLY_STATUS
224 NIGHTLY_STATUS =
225 endif
227 # The variable NEED_RANLIB should be defined if and only if the ``ar''
228 # command on a system does not accept the ``-s'' option and ``ranlib''
229 # must be used instead.  The only system we commonly use for which
230 # this is the case is SunOS version 4, so NEED_RANLIB is automatically
231 # turned on for that system.  If this is found to be need on another
232 # system, NEED_RANLIB can be set as an environment variable.
233 ifneq (,$(findstring sparc-sun-sunos4,$(MACHINE)))
234 NEED_RANLIB =   yes
235 endif
239 # BEGIN SHARED LIBRARY STUFF
242 # SHARED LIBRARY SUPPORT
244 # This code is meant to automatically determine whether shared
245 # libraries can be used on a given system.  If they can be used, they
246 # will be; otherwise, the old staticly linked library system will be
247 # used.
249 # ADDING SUPPORT FOR SHARED LIBRARIES ON NEW SYSTEMS
251 # Take a look at the if-block that defines SHARED_LIB_GEN and
252 # DEFAULT_LIB_SHARED conditionally based on the MACHINE variable.  You
253 # should be able to add support for a new system by doing nothing more
254 # than adding a new if-clause for the new machine.
256 # OVERRIDING THE DEFAULTS
258 # It is possible for the user to override the automatic choices about
259 # shared versus static libraries without modifying makefiles.  Two
260 # variables are provided for this purpose, INSTALL_SHARED_LIB and
261 # INSTALL_STATIC_LIB.  If neither is defined, this makefile will
262 # automatically define one to be ``true'' and the other ``false''
263 # based on which kind of library is to be installed by default.  The
264 # user may override these settings either in the environment or on the
265 # gmake command line.  If both are set to ``true'', both kinds of
266 # libraries will be built and installed at the same time.
268 # If SHARED_LIB_GEN isn't automatically defined, or is not defined as
269 # you like for a given system, it too may be overridden by the user.
271 ifndef STATIC_LIBNAME
272 STATIC_LIBNAME =        lib$(TARGET).a
273 endif
275 ifndef SHARED_LIBNAME
276 SHARED_LIBNAME =        lib$(TARGET).so
277 endif
279 ifneq (,$(findstring mips-sgi-irix,$(MACHINE)))
280 ifndef SHARED_LIB_GEN
281 ifeq (sgi_c++,$(COMPILER_NAME))
282 SHARED_LIB_GEN =        CC $(CXXFLAGS) -shared -o
283 else
284 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -shared -o
285 endif
286 endif
287 DEFAULT_LIB_SHARED =    defined
288 endif
289 ifneq (,$(findstring solaris2,$(MACHINE)))
290 ifndef SHARED_LIB_GEN
291 ifeq (sun_procompiler,$(COMPILER_NAME))
292 SHARED_LIB_GEN =        CC $(CXXFLAGS) -g -G -xs -o
293 else
294 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -G -o
295 endif
296 endif
297 DEFAULT_LIB_SHARED =    defined
298 endif
299 ifneq (,$(findstring alpha-dec-osf,$(MACHINE)))
300 ifndef SHARED_LIB_GEN
301 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -shared -o
302 endif
303 DEFAULT_LIB_SHARED =    defined
304 endif
305 ifneq (,$(findstring linux,$(MACHINE)))
306 ifndef SHARED_LIB_GEN
307 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -shared -o
308 endif
309 DEFAULT_LIB_SHARED =    defined
310 endif
312 ifdef DEFAULT_LIB_SHARED
313 ifndef INSTALL_SHARED_LIB
314 INSTALL_SHARED_LIB =    true
315 endif
316 ifndef INSTALL_STATIC_LIB
317 INSTALL_STATIC_LIB =    false
318 endif
319 else
320 ifndef INSTALL_SHARED_LIB
321 INSTALL_SHARED_LIB =    false
322 endif
323 ifndef INSTALL_STATIC_LIB
324 INSTALL_STATIC_LIB =    true
325 endif
326 endif
328 ifeq ($(INSTALL_SHARED_LIB),true)
329 LIBNAME_SET_A = $(SHARED_LIBNAME)
330 endif
331 ifeq ($(INSTALL_STATIC_LIB),true)
332 LIBNAME_SET_B = $(STATIC_LIBNAME)
333 endif
334 LIBNAME_SET = $(LIBNAME_SET_A) $(LIBNAME_SET_B)
337 # END SHARED LIBRARY STUFF
341 # The LIB_CLOSURE_GEN macro defines how to generate closure for a
342 # library, if this is necessary.  It is necessary with g++'s
343 # ``-frepo'' flag.  The LIB_CLOSURE_GEN command is used before either
344 # a static or shared library is generated.
346 ifeq (gcc-repo,$(COMPILER_NAME))
347 LIB_CLOSURE_GEN =       $(CXX) $(CXXFLAGS) -o
348 endif
350 ifeq (egcs,$(COMPILER_NAME))
351 LIB_CLOSURE_GEN =       $(CXX) $(CXXFLAGS) -o
352 endif
354 ifeq (,$(PUREHOME))
355 PUREHOME =      /usr/local/pure
356 endif
357 PURE =          $(PUREHOME)/purify
358 ifneq (,$(PURE_COLLECTOR))
359 PURE_FLAGS =    -collector=$(PURE_COLLECTOR)
360 endif
361 GNU_MAKE =      $(MAKE_COMMAND)
363 ifndef PACKAGE_NAME
364 PACKAGE_NAME =  $(TARGET)
365 endif
366 ifndef TARGET_EXECUTABLES
367 TARGET_EXECUTABLES =    $(TARGET)
368 endif
369 ifndef SUPER_PACKAGES_PATH
370 PACKAGE_FULL_NAME = $(PACKAGE_NAME)
371 else
372 PACKAGE_FULL_NAME = $(SUPER_PACKAGES_PATH)/$(PACKAGE_NAME)
373 endif