1 # GNU make no longer exports variables by default
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
15 ifneq (,$(findstring -lsuif1,$(LIBS)))
16 START_STY = start_sty.o
18 ifneq (,$(findstring -lmsuif,$(LIBS)))
19 START_STY = start_sty.o
25 REGISTER_LIB = register_lib.o
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 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DINLINE_ALL_TEMPLATES $(USE_SUIF_STRIPPED_HEADERS)
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
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)
82 ifeq (sgi_c++,$(COMPILER_NAME))
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
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
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
101 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3270,1155
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
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
124 DEFAULT_SYSTEM_SPECIFIC_CFLAGS = -g
125 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS = -g
139 ifeq (,$(SYSTEM_SPECIFIC_CFLAGS))
140 SYSTEM_SPECIFIC_CFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CFLAGS)
142 ifeq (,$(SYSTEM_SPECIFIC_CXXFLAGS))
143 SYSTEM_SPECIFIC_CXXFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS)
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
151 # standard definitions (SUIFHOME and MACHINE are read from the environment)
152 MACHDIR = $(SUIFHOME)/$(MACHINE)
154 INCLDIR = $(SUIFHOME)/include
156 ifndef SUIF_VERSION_1
157 INCLDIRFLAG = $(LOCALINCLDIRS) -I$(INCLDIR) $(GLOBALINCLDIRS)
159 INCLDIRFLAG = $(LOCALINCLDIRS) -I$(INCLDIR)/suif1_wrapper -I$(INCLDIR) $(GLOBALINCLDIRS)
162 SRCDIR = $(SUIFHOME)/src
165 MANDIR = $(SUIFHOME)/$(MACHINE)/man
168 INFODIR = $(SUIFHOME)/info
171 HTMLDIR = $(SUIFHOME)/html
174 DOCDIR = $(SUIFHOME)/docs
177 LIBDIR = $(MACHDIR)/lib
180 SODIR = $(MACHDIR)/solib
183 AUTOINITDIR = $(MACHDIR)/auto_init_libs
186 VERDATADIR = $(MACHDIR)/verdata
188 ifndef NIGHTLYREADYDIR
189 NIGHTLYREADYDIR = $(SUIFHOME)/nightly_ready
192 TCLDIR = $(SUIFHOME)/tcl
194 ifndef STATIC_LIBS_ONLY
195 LIBDIRFLAG = $(LOCALLIBDIRS) -L$(SODIR) -L$(LIBDIR) $(GLOBALLIBDIRS)
197 LIBDIRFLAG = $(LOCALLIBDIRS) -L$(LIBDIR) $(GLOBALLIBDIRS)
199 BINDIR = $(MACHDIR)/bin
201 SCRIPTDIR = $(SUIFHOME)/scripts
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)
215 ifeq (,$(LD_LIBRARY_PATH))
216 DOT_LD_LIBRARY_PATH = .
218 DOT_LD_LIBRARY_PATH = .:$(LD_LIBRARY_PATH)
221 LOGFILE = install.log
223 ifndef NIGHTLY_STATUS
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)))
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
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
275 ifndef SHARED_LIBNAME
276 SHARED_LIBNAME = lib$(TARGET).so
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
284 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -shared -o
287 DEFAULT_LIB_SHARED = defined
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
294 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -G -o
297 DEFAULT_LIB_SHARED = defined
299 ifneq (,$(findstring alpha-dec-osf,$(MACHINE)))
300 ifndef SHARED_LIB_GEN
301 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -shared -o
303 DEFAULT_LIB_SHARED = defined
305 ifneq (,$(findstring linux,$(MACHINE)))
306 ifndef SHARED_LIB_GEN
307 SHARED_LIB_GEN = $(CXX) $(CXXFLAGS) -shared -o
309 DEFAULT_LIB_SHARED = defined
312 ifdef DEFAULT_LIB_SHARED
313 ifndef INSTALL_SHARED_LIB
314 INSTALL_SHARED_LIB = true
316 ifndef INSTALL_STATIC_LIB
317 INSTALL_STATIC_LIB = false
320 ifndef INSTALL_SHARED_LIB
321 INSTALL_SHARED_LIB = false
323 ifndef INSTALL_STATIC_LIB
324 INSTALL_STATIC_LIB = true
328 ifeq ($(INSTALL_SHARED_LIB),true)
329 LIBNAME_SET_A = $(SHARED_LIBNAME)
331 ifeq ($(INSTALL_STATIC_LIB),true)
332 LIBNAME_SET_B = $(STATIC_LIBNAME)
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
350 ifeq (egcs,$(COMPILER_NAME))
351 LIB_CLOSURE_GEN = $(CXX) $(CXXFLAGS) -o
355 PUREHOME = /usr/local/pure
357 PURE = $(PUREHOME)/purify
358 ifneq (,$(PURE_COLLECTOR))
359 PURE_FLAGS = -collector=$(PURE_COLLECTOR)
361 GNU_MAKE = $(MAKE_COMMAND)
364 PACKAGE_NAME = $(TARGET)
366 ifndef TARGET_EXECUTABLES
367 TARGET_EXECUTABLES = $(TARGET)
369 ifndef SUPER_PACKAGES_PATH
370 PACKAGE_FULL_NAME = $(PACKAGE_NAME)
372 PACKAGE_FULL_NAME = $(SUPER_PACKAGES_PATH)/$(PACKAGE_NAME)