4 COMPILER_NAME = @COMPILER_NAME@
5 CC_OVERRIDE = @CC_OVERRIDE@
6 CXX_OVERRIDE = @CXX_OVERRIDE@
7 LD_LIBRARY_PATH = @LD_LIBRARY_PATH@
10 # GNU make no longer exports variables by default
13 unexport VERDATAFILE TMP_VERDATAFILE AUXILIARY_HEADERS TMP_YSRCS TMP_DSRCS
14 unexport TMP_HEADERS TMP_CSRCS TMP_SRCS TMP_INFOSRCS TMP_MANPAGES
15 unexport TMP_MANPAGES TMP_OTHERSRCS
16 unexport EXTRA_PURE EXTRA_YFLAGS EXTRA_CFLAGS EXTRA_CXXFLAGS
17 unexport LIBNAME_SET LIBNAME_SET_A LIBNAME_SET_B
18 unexport BASE_CFLAGS BASE_CXXFLAGS
20 # macro to initialize standard SUIF libraries
21 ifneq (,$(findstring -lsty,$(LIBS)))
22 START_STY = start_sty.o
24 ifneq (,$(findstring -lsuif1,$(LIBS)))
25 START_STY = start_sty.o
27 ifneq (,$(findstring -lmsuif,$(LIBS)))
28 START_STY = start_sty.o
34 REGISTER_LIB = register_lib.o
44 ifeq (gcc,$(COMPILER_NAME))
46 # Note: We have turned off the ``unused'' warnings from g++ because
47 # when this warning is enabled, it generates warning messages
48 # for any function declared ``inline'' that is not used. That
49 # causes warnings for most cases of ``inline'' functions
50 # declared in header files though there is nothing at all wrong
51 # with such code. Other warnings are not used because system
52 # header files often trigger them or because code that we think
53 # is valid and commonly used in SUIF triggers them. For
54 # example, comparing an unsigned to see if it is less than
55 # zero. We have lots of code that does this because we want the
56 # same code to work whether certain typedef'ed types are signed
57 # or unsigned integers.
59 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g -fPIC -Wall
60 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)
69 ifeq (gcc-repo,$(COMPILER_NAME))
70 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g -Wall
71 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
80 ifeq (egcs,$(COMPILER_NAME))
81 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g -Wall
82 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)
91 ifeq (sgi_c++,$(COMPILER_NAME))
94 # Warning 3247: ``unrecognized #pragma''
95 # -- We use #pragmas for gcc that the Irix 5.3 C++ compiler
96 # doesn't understand, but it should just silently ignore
98 # Warning 3672: ``Mangling of signed character does not match
99 # cfront name mangling.''
100 # -- We don't care about C front.
101 # Warning 3270: ``pointless comparison of unsigned integer with
103 # -- We use symbolic types that might be signed or unsigned,
104 # so we really want to compare with zero even if the type
105 # happens to be unsigned right now.
107 ifeq (mips-sgi-irix5.3,$(MACHINE))
108 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3672,3270
110 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3270,1155
112 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -fullwarn -woff $(SUIF_SGI_WARNINGS_OFF) -g
113 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS = -fullwarn -woff $(SUIF_SGI_WARNINGS_OFF) -g -DNOBOOL -DNO_CONST_CAST -DINLINE_ALL_TEMPLATES
122 ifeq (sun_procompiler,$(COMPILER_NAME))
123 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g -KPIC
124 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS = -g -KPIC -DNOBOOL -DNO_CONST_CAST -DINLINE_ALL_TEMPLATES $(USE_SUIF_STRIPPED_HEADERS) -DANTIQUE_CPP
133 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g
134 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS = -g
148 ifeq (,$(SYSTEM_SPECIFIC_CFLAGS))
149 SYSTEM_SPECIFIC_CFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CFLAGS)
151 ifeq (,$(SYSTEM_SPECIFIC_CXXFLAGS))
152 SYSTEM_SPECIFIC_CXXFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS)
155 # The USER_CFLAGS and USER_CXXFLAGS variables are reserved for
156 # _users_. They should never be defined in any Makefile. The
157 # EXTRA_CFLAGS and EXTRA_CXXFLAGS variables are available for local
160 # standard definitions (SUIFHOME and MACHINE are read from the environment)
161 MACHDIR = $(SUIFHOME)/$(MACHINE)
163 INCLDIR = $(MACHDIR)/include
165 ifndef SUIF_VERSION_1
166 INCLDIRFLAG = $(LOCALINCLDIRS) -I$(INCLDIR) $(GLOBALINCLDIRS)
168 INCLDIRFLAG = $(LOCALINCLDIRS) -I$(INCLDIR)/suif1_wrapper -I$(INCLDIR) $(GLOBALINCLDIRS)
171 SRCDIR = $(SUIFHOME)/src
174 MANDIR = $(SUIFHOME)/$(MACHINE)/man
177 INFODIR = $(SUIFHOME)/info
180 HTMLDIR = $(SUIFHOME)/html
183 DOCDIR = $(SUIFHOME)/docs
186 LIBDIR = $(MACHDIR)/lib
189 SODIR = $(MACHDIR)/solib
192 AUTOINITDIR = $(MACHDIR)/auto_init_libs
195 VERDATADIR = $(MACHDIR)/verdata
197 ifndef NIGHTLYREADYDIR
198 NIGHTLYREADYDIR = $(SUIFHOME)/nightly_ready
201 TCLDIR = $(SUIFHOME)/tcl
203 ifndef STATIC_LIBS_ONLY
204 LIBDIRFLAG = $(LOCALLIBDIRS) -L$(SODIR) -L$(LIBDIR) $(GLOBALLIBDIRS)
206 LIBDIRFLAG = $(LOCALLIBDIRS) -L$(LIBDIR) $(GLOBALLIBDIRS)
208 BINDIR = $(MACHDIR)/bin
210 SCRIPTDIR = $(SUIFHOME)/scripts
217 YFLAGS = -y $(EXTRA_YFLAGS)
218 BASE_CFLAGS = $(SYSTEM_SPECIFIC_CFLAGS) $(USER_CFLAGS)
219 BASE_CXXFLAGS = $(SYSTEM_SPECIFIC_CXXFLAGS) $(USER_CXXFLAGS)
220 CFLAGS = $(BASE_CFLAGS) $(INCLDIRFLAG) $(EXTRA_CFLAGS)
221 CXXFLAGS = $(BASE_CXXFLAGS) $(INCLDIRFLAG) $(EXTRA_CXXFLAGS)
224 ifeq (,$(LD_LIBRARY_PATH))
225 DOT_LD_LIBRARY_PATH = .
227 DOT_LD_LIBRARY_PATH = .:$(LD_LIBRARY_PATH)
230 LOGFILE = install.log
232 ifndef NIGHTLY_STATUS
236 # The variable NEED_RANLIB should be defined if and only if the ``ar''
237 # command on a system does not accept the ``-s'' option and ``ranlib''
238 # must be used instead. The only system we commonly use for which
239 # this is the case is SunOS version 4, so NEED_RANLIB is automatically
240 # turned on for that system. If this is found to be need on another
241 # system, NEED_RANLIB can be set as an environment variable.
242 ifneq (,$(findstring sparc-sun-sunos4,$(MACHINE)))
248 # BEGIN SHARED LIBRARY STUFF
251 # SHARED LIBRARY SUPPORT
253 # This code is meant to automatically determine whether shared
254 # libraries can be used on a given system. If they can be used, they
255 # will be; otherwise, the old staticly linked library system will be
258 # ADDING SUPPORT FOR SHARED LIBRARIES ON NEW SYSTEMS
260 # Take a look at the if-block that defines SHARED_LIB_GEN and
261 # DEFAULT_LIB_SHARED conditionally based on the MACHINE variable. You
262 # should be able to add support for a new system by doing nothing more
263 # than adding a new if-clause for the new machine.
265 # OVERRIDING THE DEFAULTS
267 # It is possible for the user to override the automatic choices about
268 # shared versus static libraries without modifying makefiles. Two
269 # variables are provided for this purpose, INSTALL_SHARED_LIB and
270 # INSTALL_STATIC_LIB. If neither is defined, this makefile will
271 # automatically define one to be ``true'' and the other ``false''
272 # based on which kind of library is to be installed by default. The
273 # user may override these settings either in the environment or on the
274 # gmake command line. If both are set to ``true'', both kinds of
275 # libraries will be built and installed at the same time.
277 # If SHARED_LIB_GEN isn't automatically defined, or is not defined as
278 # you like for a given system, it too may be overridden by the user.
280 ifndef STATIC_LIBNAME
281 STATIC_LIBNAME = lib$(TARGET).a
284 ifndef SHARED_LIBNAME
285 SHARED_LIBNAME = lib$(TARGET).so
288 ifneq (,$(findstring mips-sgi-irix,$(MACHINE)))
289 ifndef SHARED_LIB_GEN
290 ifeq (sgi_c++,$(COMPILER_NAME))
291 SHARED_LIB_GEN = CC $(CXXFLAGS) -shared -o
293 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -shared -o
296 DEFAULT_LIB_SHARED = defined
298 ifneq (,$(findstring solaris2,$(MACHINE)))
299 ifndef SHARED_LIB_GEN
300 ifeq (sun_procompiler,$(COMPILER_NAME))
301 SHARED_LIB_GEN = CC $(CXXFLAGS) -g -G -xs -o
303 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -G -o
306 DEFAULT_LIB_SHARED = defined
308 ifneq (,$(findstring alpha-dec-osf,$(MACHINE)))
309 ifndef SHARED_LIB_GEN
310 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -shared -o
312 DEFAULT_LIB_SHARED = defined
314 ifneq (,$(findstring linux,$(MACHINE)))
315 ifndef SHARED_LIB_GEN
316 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -shared -o
318 DEFAULT_LIB_SHARED = defined
321 ifdef DEFAULT_LIB_SHARED
322 ifndef INSTALL_SHARED_LIB
323 INSTALL_SHARED_LIB = true
325 ifndef INSTALL_STATIC_LIB
326 INSTALL_STATIC_LIB = false
329 ifndef INSTALL_SHARED_LIB
330 INSTALL_SHARED_LIB = false
332 ifndef INSTALL_STATIC_LIB
333 INSTALL_STATIC_LIB = true
337 ifeq ($(INSTALL_SHARED_LIB),true)
338 LIBNAME_SET_A = $(SHARED_LIBNAME)
340 ifeq ($(INSTALL_STATIC_LIB),true)
341 LIBNAME_SET_B = $(STATIC_LIBNAME)
343 LIBNAME_SET = $(LIBNAME_SET_A) $(LIBNAME_SET_B)
346 # END SHARED LIBRARY STUFF
350 # The LIB_CLOSURE_GEN macro defines how to generate closure for a
351 # library, if this is necessary. It is necessary with g++'s
352 # ``-frepo'' flag. The LIB_CLOSURE_GEN command is used before either
353 # a static or shared library is generated.
355 ifeq (gcc-repo,$(COMPILER_NAME))
356 LIB_CLOSURE_GEN = $(CXX) $(CXXFLAGS) -o
359 ifeq (egcs,$(COMPILER_NAME))
360 LIB_CLOSURE_GEN = $(CXX) $(CXXFLAGS) -o
364 PUREHOME = /usr/local/pure
366 PURE = $(PUREHOME)/purify
367 ifneq (,$(PURE_COLLECTOR))
368 PURE_FLAGS = -collector=$(PURE_COLLECTOR)
370 GNU_MAKE = $(MAKE_COMMAND)
373 PACKAGE_NAME = $(TARGET)
375 ifndef TARGET_EXECUTABLES
376 TARGET_EXECUTABLES = $(TARGET)
378 ifndef SUPER_PACKAGES_PATH
379 PACKAGE_FULL_NAME = $(PACKAGE_NAME)
381 PACKAGE_FULL_NAME = $(SUPER_PACKAGES_PATH)/$(PACKAGE_NAME)