4 COMPILER_NAME = @COMPILER_NAME@
5 CC_OVERRIDE = @CC_OVERRIDE@
6 CXX_OVERRIDE = @CXX_OVERRIDE@
7 LD_LIBRARY_PATH = @LD_LIBRARY_PATH@
9 # GNU make no longer exports variables by default
12 unexport VERDATAFILE TMP_VERDATAFILE AUXILIARY_HEADERS TMP_YSRCS TMP_DSRCS
13 unexport TMP_HEADERS TMP_CSRCS TMP_SRCS TMP_INFOSRCS TMP_MANPAGES
14 unexport TMP_MANPAGES TMP_OTHERSRCS
15 unexport EXTRA_PURE EXTRA_YFLAGS EXTRA_CFLAGS EXTRA_CXXFLAGS
16 unexport LIBNAME_SET LIBNAME_SET_A LIBNAME_SET_B
17 unexport BASE_CFLAGS BASE_CXXFLAGS
19 # macro to initialize standard SUIF libraries
20 ifneq (,$(findstring -lsty,$(LIBS)))
21 START_STY = start_sty.o
23 ifneq (,$(findstring -lsuif1,$(LIBS)))
24 START_STY = start_sty.o
26 ifneq (,$(findstring -lmsuif,$(LIBS)))
27 START_STY = start_sty.o
33 REGISTER_LIB = register_lib.o
43 ifeq (gcc,$(COMPILER_NAME))
45 # Note: We have turned off the ``unused'' warnings from g++ because
46 # when this warning is enabled, it generates warning messages
47 # for any function declared ``inline'' that is not used. That
48 # causes warnings for most cases of ``inline'' functions
49 # declared in header files though there is nothing at all wrong
50 # with such code. Other warnings are not used because system
51 # header files often trigger them or because code that we think
52 # is valid and commonly used in SUIF triggers them. For
53 # example, comparing an unsigned to see if it is less than
54 # zero. We have lots of code that does this because we want the
55 # same code to work whether certain typedef'ed types are signed
56 # or unsigned integers.
58 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g -fPIC -Wall
59 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)
68 ifeq (gcc-repo,$(COMPILER_NAME))
69 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g -Wall
70 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
79 ifeq (egcs,$(COMPILER_NAME))
80 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g -Wall
81 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)
90 ifeq (sgi_c++,$(COMPILER_NAME))
93 # Warning 3247: ``unrecognized #pragma''
94 # -- We use #pragmas for gcc that the Irix 5.3 C++ compiler
95 # doesn't understand, but it should just silently ignore
97 # Warning 3672: ``Mangling of signed character does not match
98 # cfront name mangling.''
99 # -- We don't care about C front.
100 # Warning 3270: ``pointless comparison of unsigned integer with
102 # -- We use symbolic types that might be signed or unsigned,
103 # so we really want to compare with zero even if the type
104 # happens to be unsigned right now.
106 ifeq (mips-sgi-irix5.3,$(MACHINE))
107 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3672,3270
109 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3270,1155
111 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -fullwarn -woff $(SUIF_SGI_WARNINGS_OFF) -g
112 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS = -fullwarn -woff $(SUIF_SGI_WARNINGS_OFF) -g -DNOBOOL -DNO_CONST_CAST -DINLINE_ALL_TEMPLATES
121 ifeq (sun_procompiler,$(COMPILER_NAME))
122 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g -KPIC
123 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS = -g -KPIC -DNOBOOL -DNO_CONST_CAST -DINLINE_ALL_TEMPLATES $(USE_SUIF_STRIPPED_HEADERS) -DANTIQUE_CPP
132 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g
133 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS = -g
147 ifeq (,$(SYSTEM_SPECIFIC_CFLAGS))
148 SYSTEM_SPECIFIC_CFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CFLAGS)
150 ifeq (,$(SYSTEM_SPECIFIC_CXXFLAGS))
151 SYSTEM_SPECIFIC_CXXFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS)
154 # The USER_CFLAGS and USER_CXXFLAGS variables are reserved for
155 # _users_. They should never be defined in any Makefile. The
156 # EXTRA_CFLAGS and EXTRA_CXXFLAGS variables are available for local
159 # standard definitions (SUIFHOME and MACHINE are read from the environment)
160 MACHDIR = $(SUIFHOME)/$(MACHINE)
162 INCLDIR = $(MACHDIR)/include
164 ifndef SUIF_VERSION_1
165 INCLDIRFLAG = $(LOCALINCLDIRS) -I$(INCLDIR) $(GLOBALINCLDIRS)
167 INCLDIRFLAG = $(LOCALINCLDIRS) -I$(INCLDIR)/suif1_wrapper -I$(INCLDIR) $(GLOBALINCLDIRS)
170 SRCDIR = $(SUIFHOME)/src
173 MANDIR = $(SUIFHOME)/$(MACHINE)/man
176 INFODIR = $(SUIFHOME)/info
179 HTMLDIR = $(SUIFHOME)/html
182 DOCDIR = $(SUIFHOME)/docs
185 LIBDIR = $(MACHDIR)/lib
188 SODIR = $(MACHDIR)/solib
191 AUTOINITDIR = $(MACHDIR)/auto_init_libs
194 VERDATADIR = $(MACHDIR)/verdata
196 ifndef NIGHTLYREADYDIR
197 NIGHTLYREADYDIR = $(SUIFHOME)/nightly_ready
200 TCLDIR = $(SUIFHOME)/tcl
202 ifndef STATIC_LIBS_ONLY
203 LIBDIRFLAG = $(LOCALLIBDIRS) -L$(SODIR) -L$(LIBDIR) $(GLOBALLIBDIRS)
205 LIBDIRFLAG = $(LOCALLIBDIRS) -L$(LIBDIR) $(GLOBALLIBDIRS)
207 BINDIR = $(MACHDIR)/bin
209 SCRIPTDIR = $(SUIFHOME)/scripts
216 YFLAGS = -y $(EXTRA_YFLAGS)
217 BASE_CFLAGS = $(SYSTEM_SPECIFIC_CFLAGS) $(USER_CFLAGS)
218 BASE_CXXFLAGS = $(SYSTEM_SPECIFIC_CXXFLAGS) $(USER_CXXFLAGS)
219 CFLAGS = $(BASE_CFLAGS) $(INCLDIRFLAG) $(EXTRA_CFLAGS)
220 CXXFLAGS = $(BASE_CXXFLAGS) $(INCLDIRFLAG) $(EXTRA_CXXFLAGS)
223 ifeq (,$(LD_LIBRARY_PATH))
224 DOT_LD_LIBRARY_PATH = .
226 DOT_LD_LIBRARY_PATH = .:$(LD_LIBRARY_PATH)
229 LOGFILE = install.log
231 ifndef NIGHTLY_STATUS
235 # The variable NEED_RANLIB should be defined if and only if the ``ar''
236 # command on a system does not accept the ``-s'' option and ``ranlib''
237 # must be used instead. The only system we commonly use for which
238 # this is the case is SunOS version 4, so NEED_RANLIB is automatically
239 # turned on for that system. If this is found to be need on another
240 # system, NEED_RANLIB can be set as an environment variable.
241 ifneq (,$(findstring sparc-sun-sunos4,$(MACHINE)))
247 # BEGIN SHARED LIBRARY STUFF
250 # SHARED LIBRARY SUPPORT
252 # This code is meant to automatically determine whether shared
253 # libraries can be used on a given system. If they can be used, they
254 # will be; otherwise, the old staticly linked library system will be
257 # ADDING SUPPORT FOR SHARED LIBRARIES ON NEW SYSTEMS
259 # Take a look at the if-block that defines SHARED_LIB_GEN and
260 # DEFAULT_LIB_SHARED conditionally based on the MACHINE variable. You
261 # should be able to add support for a new system by doing nothing more
262 # than adding a new if-clause for the new machine.
264 # OVERRIDING THE DEFAULTS
266 # It is possible for the user to override the automatic choices about
267 # shared versus static libraries without modifying makefiles. Two
268 # variables are provided for this purpose, INSTALL_SHARED_LIB and
269 # INSTALL_STATIC_LIB. If neither is defined, this makefile will
270 # automatically define one to be ``true'' and the other ``false''
271 # based on which kind of library is to be installed by default. The
272 # user may override these settings either in the environment or on the
273 # gmake command line. If both are set to ``true'', both kinds of
274 # libraries will be built and installed at the same time.
276 # If SHARED_LIB_GEN isn't automatically defined, or is not defined as
277 # you like for a given system, it too may be overridden by the user.
279 ifndef STATIC_LIBNAME
280 STATIC_LIBNAME = lib$(TARGET).a
283 ifndef SHARED_LIBNAME
284 SHARED_LIBNAME = lib$(TARGET).so
287 ifneq (,$(findstring mips-sgi-irix,$(MACHINE)))
288 ifndef SHARED_LIB_GEN
289 ifeq (sgi_c++,$(COMPILER_NAME))
290 SHARED_LIB_GEN = CC $(CXXFLAGS) -shared -o
292 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -shared -o
295 DEFAULT_LIB_SHARED = defined
297 ifneq (,$(findstring solaris2,$(MACHINE)))
298 ifndef SHARED_LIB_GEN
299 ifeq (sun_procompiler,$(COMPILER_NAME))
300 SHARED_LIB_GEN = CC $(CXXFLAGS) -g -G -xs -o
302 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -G -o
305 DEFAULT_LIB_SHARED = defined
307 ifneq (,$(findstring alpha-dec-osf,$(MACHINE)))
308 ifndef SHARED_LIB_GEN
309 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -shared -o
311 DEFAULT_LIB_SHARED = defined
313 ifneq (,$(findstring linux,$(MACHINE)))
314 ifndef SHARED_LIB_GEN
315 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -shared -o
317 DEFAULT_LIB_SHARED = defined
320 ifdef DEFAULT_LIB_SHARED
321 ifndef INSTALL_SHARED_LIB
322 INSTALL_SHARED_LIB = true
324 ifndef INSTALL_STATIC_LIB
325 INSTALL_STATIC_LIB = false
328 ifndef INSTALL_SHARED_LIB
329 INSTALL_SHARED_LIB = false
331 ifndef INSTALL_STATIC_LIB
332 INSTALL_STATIC_LIB = true
336 ifeq ($(INSTALL_SHARED_LIB),true)
337 LIBNAME_SET_A = $(SHARED_LIBNAME)
339 ifeq ($(INSTALL_STATIC_LIB),true)
340 LIBNAME_SET_B = $(STATIC_LIBNAME)
342 LIBNAME_SET = $(LIBNAME_SET_A) $(LIBNAME_SET_B)
345 # END SHARED LIBRARY STUFF
349 # The LIB_CLOSURE_GEN macro defines how to generate closure for a
350 # library, if this is necessary. It is necessary with g++'s
351 # ``-frepo'' flag. The LIB_CLOSURE_GEN command is used before either
352 # a static or shared library is generated.
354 ifeq (gcc-repo,$(COMPILER_NAME))
355 LIB_CLOSURE_GEN = $(CXX) $(CXXFLAGS) -o
358 ifeq (egcs,$(COMPILER_NAME))
359 LIB_CLOSURE_GEN = $(CXX) $(CXXFLAGS) -o
363 PUREHOME = /usr/local/pure
365 PURE = $(PUREHOME)/purify
366 ifneq (,$(PURE_COLLECTOR))
367 PURE_FLAGS = -collector=$(PURE_COLLECTOR)
369 GNU_MAKE = $(MAKE_COMMAND)
372 PACKAGE_NAME = $(TARGET)
374 ifndef TARGET_EXECUTABLES
375 TARGET_EXECUTABLES = $(TARGET)
377 ifndef SUPER_PACKAGES_PATH
378 PACKAGE_FULL_NAME = $(PACKAGE_NAME)
380 PACKAGE_FULL_NAME = $(SUPER_PACKAGES_PATH)/$(PACKAGE_NAME)