add $(EXEEXT) to executable targets during installation for MinGW
[suif.git] / Makefile.defs.in
blob7026f14f056ea8474d4c18f34d3ef54afbd2a154
1 # set by configure
2 MACHINE = @MACHINE@
3 SUIFPATH = @SUIFPATH@
4 COMPILER_NAME = @COMPILER_NAME@
5 CC_OVERRIDE = @CC_OVERRIDE@
6 CXX_OVERRIDE = @CXX_OVERRIDE@
7 LD_LIBRARY_PATH = @LD_LIBRARY_PATH@
8 EXEEXT = @EXEEXT@
10 # GNU make no longer exports variables by default
11 export
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
23 else
24 ifneq (,$(findstring -lsuif1,$(LIBS)))
25 START_STY =     start_sty.o
26 else
27 ifneq (,$(findstring -lmsuif,$(LIBS)))
28 START_STY =     start_sty.o
29 endif
30 endif
31 endif
33 ifdef AUTOINITLIB
34 REGISTER_LIB =  register_lib.o
35 endif
37 ifdef CC_OVERRIDE
38 CC =            $(CC_OVERRIDE)
39 endif
40 ifdef CXX_OVERRIDE
41 CXX =           $(CXX_OVERRIDE)
42 endif
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)
61 ifndef CC_OVERRIDE
62 CC =            gcc
63 endif
64 ifndef CXX_OVERRIDE
65 CXX =           g++
66 endif
67 DEPSFLAG =      -M
68 else
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
72 ifndef CC_OVERRIDE
73 CC =            gcc
74 endif
75 ifndef CXX_OVERRIDE
76 CXX =           g++
77 endif
78 DEPSFLAG =      -M
79 else
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)
83 ifndef CC_OVERRIDE
84 CC =            gcc
85 endif
86 ifndef CXX_OVERRIDE
87 CXX =           g++
88 endif
89 DEPSFLAG =      -M
90 else
91 ifeq (sgi_c++,$(COMPILER_NAME))
93 #   Note:
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
97 #              them.
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
102 #                     zero'' 
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
109 else
110 SUIF_SGI_WARNINGS_OFF = 803,728,3247,3317,3270,1155
111 endif
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
114 ifndef CC_OVERRIDE
115 CC =            cc
116 endif
117 ifndef CXX_OVERRIDE
118 CXX =           CC
119 endif
120 DEPSFLAG =      -M
121 else
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
125 ifndef CC_OVERRIDE
126 CC =            cc
127 endif
128 ifndef CXX_OVERRIDE
129 CXX =           CC +w
130 endif
131 DEPSFLAG =      -xM1
132 else
133 DEFAULT_SYSTEM_SPECIFIC_CFLAGS =        -g
134 DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS =      -g
135 ifndef CC_OVERRIDE
136 CC =            cc
137 endif
138 ifndef CXX_OVERRIDE
139 CXX =           CC
140 endif
141 DEPSFLAG =      -M
142 endif
143 endif
144 endif
145 endif
146 endif
148 ifeq (,$(SYSTEM_SPECIFIC_CFLAGS))
149 SYSTEM_SPECIFIC_CFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CFLAGS)
150 endif
151 ifeq (,$(SYSTEM_SPECIFIC_CXXFLAGS))
152 SYSTEM_SPECIFIC_CXXFLAGS = $(DEFAULT_SYSTEM_SPECIFIC_CXXFLAGS)
153 endif
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
158 # Makefiles.
160 # standard definitions (SUIFHOME and MACHINE are read from the environment)
161 MACHDIR =       $(SUIFHOME)/$(MACHINE)
162 ifndef INCLDIR
163 INCLDIR =       $(MACHDIR)/include
164 endif
165 ifndef SUIF_VERSION_1
166 INCLDIRFLAG =   $(LOCALINCLDIRS) -I$(INCLDIR) $(GLOBALINCLDIRS)
167 else
168 INCLDIRFLAG =   $(LOCALINCLDIRS) -I$(INCLDIR)/suif1_wrapper -I$(INCLDIR) $(GLOBALINCLDIRS)
169 endif
170 ifndef SRCDIR
171 SRCDIR =        $(SUIFHOME)/src
172 endif
173 ifndef MANDIR
174 MANDIR =        $(SUIFHOME)/$(MACHINE)/man
175 endif
176 ifndef INFODIR
177 INFODIR =       $(SUIFHOME)/info
178 endif
179 ifndef HTMLDIR
180 HTMLDIR =       $(SUIFHOME)/html
181 endif
182 ifndef DOCDIR
183 DOCDIR =        $(SUIFHOME)/docs
184 endif
185 ifndef LIBDIR
186 LIBDIR =        $(MACHDIR)/lib
187 endif
188 ifndef SODIR
189 SODIR =         $(MACHDIR)/solib
190 endif
191 ifndef AUTOINITDIR
192 AUTOINITDIR =   $(MACHDIR)/auto_init_libs
193 endif
194 ifndef VERDATADIR
195 VERDATADIR =    $(MACHDIR)/verdata
196 endif
197 ifndef NIGHTLYREADYDIR
198 NIGHTLYREADYDIR = $(SUIFHOME)/nightly_ready
199 endif
200 ifndef TCLDIR
201 TCLDIR =        $(SUIFHOME)/tcl
202 endif
203 ifndef STATIC_LIBS_ONLY
204 LIBDIRFLAG =    $(LOCALLIBDIRS) -L$(SODIR) -L$(LIBDIR) $(GLOBALLIBDIRS)
205 else
206 LIBDIRFLAG =    $(LOCALLIBDIRS) -L$(LIBDIR) $(GLOBALLIBDIRS)
207 endif
208 BINDIR =        $(MACHDIR)/bin
209 ifndef SCRIPTDIR
210 SCRIPTDIR =     $(SUIFHOME)/scripts
211 endif
212 SHELL =         /bin/sh
213 YACC =          bison
214 ifeq (,$(SHARLIT))
215 SHARLIT =       sharlit
216 endif
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)
222 CO =            co
223 COFLAGS =       -q
224 ifeq (,$(LD_LIBRARY_PATH))
225 DOT_LD_LIBRARY_PATH = .
226 else
227 DOT_LD_LIBRARY_PATH = .:$(LD_LIBRARY_PATH)
228 endif
229 ifndef LOGFILE
230 LOGFILE =       install.log
231 endif
232 ifndef NIGHTLY_STATUS
233 NIGHTLY_STATUS =
234 endif
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)))
243 NEED_RANLIB =   yes
244 endif
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
256 # used.
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
282 endif
284 ifndef SHARED_LIBNAME
285 SHARED_LIBNAME =        lib$(TARGET).so
286 endif
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
292 else
293 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -shared -o
294 endif
295 endif
296 DEFAULT_LIB_SHARED =    defined
297 endif
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
302 else
303 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -G -o
304 endif
305 endif
306 DEFAULT_LIB_SHARED =    defined
307 endif
308 ifneq (,$(findstring alpha-dec-osf,$(MACHINE)))
309 ifndef SHARED_LIB_GEN
310 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -shared -o
311 endif
312 DEFAULT_LIB_SHARED =    defined
313 endif
314 ifneq (,$(findstring linux,$(MACHINE)))
315 ifndef SHARED_LIB_GEN
316 SHARED_LIB_GEN =        $(CXX) $(CXXFLAGS) -shared -o
317 endif
318 DEFAULT_LIB_SHARED =    defined
319 endif
321 ifdef DEFAULT_LIB_SHARED
322 ifndef INSTALL_SHARED_LIB
323 INSTALL_SHARED_LIB =    true
324 endif
325 ifndef INSTALL_STATIC_LIB
326 INSTALL_STATIC_LIB =    false
327 endif
328 else
329 ifndef INSTALL_SHARED_LIB
330 INSTALL_SHARED_LIB =    false
331 endif
332 ifndef INSTALL_STATIC_LIB
333 INSTALL_STATIC_LIB =    true
334 endif
335 endif
337 ifeq ($(INSTALL_SHARED_LIB),true)
338 LIBNAME_SET_A = $(SHARED_LIBNAME)
339 endif
340 ifeq ($(INSTALL_STATIC_LIB),true)
341 LIBNAME_SET_B = $(STATIC_LIBNAME)
342 endif
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
357 endif
359 ifeq (egcs,$(COMPILER_NAME))
360 LIB_CLOSURE_GEN =       $(CXX) $(CXXFLAGS) -o
361 endif
363 ifeq (,$(PUREHOME))
364 PUREHOME =      /usr/local/pure
365 endif
366 PURE =          $(PUREHOME)/purify
367 ifneq (,$(PURE_COLLECTOR))
368 PURE_FLAGS =    -collector=$(PURE_COLLECTOR)
369 endif
370 GNU_MAKE =      $(MAKE_COMMAND)
372 ifndef PACKAGE_NAME
373 PACKAGE_NAME =  $(TARGET)
374 endif
375 ifndef TARGET_EXECUTABLES
376 TARGET_EXECUTABLES =    $(TARGET)
377 endif
378 ifndef SUPER_PACKAGES_PATH
379 PACKAGE_FULL_NAME = $(PACKAGE_NAME)
380 else
381 PACKAGE_FULL_NAME = $(SUPER_PACKAGES_PATH)/$(PACKAGE_NAME)
382 endif