Repository navigation
Expand file tree
/
Copy pathmakeg95.env
More file actions
437 lines (368 loc) · 13.7 KB
/
Copy pathmakeg95.env
File metadata and controls
437 lines (368 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
#
# makeg95.env
# Common makefile settings for wxWindows programs
# This file is included by all the other makefiles, thus changes
# made here take effect everywhere (except where overriden).
# The settings are for GnuWin32-derived compilers, i.e. Cygwin and Mingw32.
#
# Customize this file to match your own settings.
#
# CVS_ID: $Id$
#
# The MINGW32 and MINGW32VERSION variables are preconfigured for
# MinGW gcc version 3.x and must both be changed for any version
# earlier than 3.0 or for cygwin. Editing this file is one way to
# change them. An easier way, at least with GNU make, is to override
# them on the command line, e.g.
# make MINGW32=0 MINGW32VERSION=2.8 -f makefile.g95
# If using Mingw32 (any version), set this to 1.
# If using Cygwin (any version), set this to 0.
#
# This agrees with the instructions given in docs/msw/install.txt .
# Earlier versions of this makefile suggested setting MINGW32=1 for
# recent versions of cygwin, but that would give the wrong dll entry
# point in src/msw/makefile.g95 .
#
# With cygwin, there are still some problems compiling wxWindows
# this way; './configure && make' may work better.
#
MINGW32=1
# set MIN_SUFFIX to nothing if you use only MinGW compiler, set it to
# something MinGW-specific if you want to build wxWindows with more than one
# compiler
ifeq ($(MINGW32),1)
MIN_SUFFIX=_min
else
MIN_SUFFIX=_cyg
endif
# Set to your gcc version. Generally 'gcc --version' tells you
# which version you have. But it cannot distinguish between
# 2.95.2-1 and earlier suffix versions of 2.95 . In that case,
# inspect the dates of bin/gcc.exe and bin/ld.exe ; if they
# are at least
# 2000-01-21 for gcc.exe and
# 2000-02-04 for ld.exe
# then use '2.95-late'.
#
# gcc 2.8.x and earlier require struct-return workaround
#MINGW32VERSION=2.8
#
# gcc 2.95.2 and earlier requires special thunk option
#MINGW32VERSION=2.9-early
#
# mingw gcc-2.95.2-1 supports '-shared'
# windres provided with gcc-2.95.2-1 supports temp file option
#MINGW32VERSION=2.95-late
#
# gcc 3.x provides a win32api.h header
MINGW32VERSION=3.0
# If you want to compile on Wine, simply uncomment this variable
# If you don't want to edit the file, you can simply define it
# on the command line like so: make WINE=1 -f makefile.g95
#WINE=1
# Set this if you are using a cross-compiler, i.e. compiling on one system
# the program for another one
# CROSS=i386-mingw32-
# If we're using MSYS, or other utilities that use forward slashes,
# you need to set this when invoking the makefile from DOS, or the
# wrong separators will be assumed. However, if you're using MSYS,
# you really ought to invoke the makefile from MSYS--or, even better,
# use the './configure && make' technique that MSYS is designed for.
ifndef WINE
#OSTYPE=msys
else
OSTYPE=msys
endif
# If building DLL, the version
include $(WXDIR)/src/version.mak
WXVERSION=$(wxMAJOR_VERSION)$(wxMINOR_VERSION)$(wxRELEASE_NUMBER_IFUNSTABLE)
ifndef UNICODE
UNICODE=0
endif
ifndef FINAL
FINAL=0
endif
ifndef wxUSE_GUI
wxUSE_GUI=1
endif
# Set to the appropriate remove command (must support forward slashes)
# You can get a suitable rm.exe from ports/mingw32/extra.zip on the ftp site.
RM=rm -f
# Set to the appropriate copy command (must support forward slashes)
# You can get a suitable cp.exe from ports/mingw32/extra.zip on the ftp site.
COPY=cp
########################## Compiler ##################################
ifneq (,$(findstring $(MINGW32VERSION),2.8))
# According to Guillermo Rodriguez Garcia <guille@iies.es>, the
# -fno-pcc-struct-return option is needed to make the standard div()
# function work - otherwise it returns absolutely incorrect results
# which breaks the wxImage class. This was fixed on 1998-08-14 for
# mingw and cygwin. It is preferable not to use this option where it
# is not required, because it is documented to cause binary API
# incompatibility.
_STRUCT_RETURN_WORKAROUND=-fno-pcc-struct-return
# Really old versions of cygwin are thought to require extra headers.
ifneq ($(MINGW32),1)
GNUWIN32EXTRA=-I$(WXDIR)/include/wx/msw/gnuwin32
endif
endif
ifneq (,$(findstring $(MINGW32VERSION),2.8 2.9-early))
# Earlier versions of this makefile defined the following macros
# explicitly; mingw versions since at least '2.95-late' define
# them already.
OBSOLETE_DEFINES = -D_X86_=1 -DWIN32 -D_WIN32 -D__WIN32__
endif
# But cygwin doesn't define them, at least through its version
# 2.95.3-4 of gcc.
ifneq ($(MINGW32),1)
OBSOLETE_DEFINES = -D_X86_=1 -DWIN32 -D_WIN32 -D__WIN32__
endif
ifneq (,$(findstring $(MINGW32VERSION),2.8 2.9-early 2.95-late))
# Versions prior to 3.0 require -fvtable-thunks for OLE support.
# All code must be built with this option, even C++ libraries you
# only link to, including system libraries. This option can cause
# subtle problems with multiple inheritance.
_THUNK_WORKAROUND=-fvtable-thunks
endif
ifeq (,$(findstring $(MINGW32VERSION),2.8 2.9-early))
# Versions since 2.95.2-1 support '-shared', which makes linking
# a dll *much* faster; and the accompanying windres supports
# '--use-temp-file', which is more robust.
LD_SUPPORTS_SHARED=yes
_USE_TEMP_FILE_IF_SUPPORTED=--use-temp-file
# Use the WIN32 wxDirDialog only if we have a recent mingw version
RECENT_MINGW=yes
endif
ifeq (,$(findstring $(MINGW32VERSION),2.8 2.9-early 2.95-late))
# Versions since 3.0 provide win32api.h . An old comment said to
# define this 'if you have w32api >= 0.5', but mingw 2.95.2-1
# has no such header.
ifndef WINE
_USE_W32API_HEADER_IF_SUPPORTED = -DHAVE_W32API_H
endif
#
# Revision 1.70.2.6 of this file suggested '--pipe' for mingw but
# not for cygwin, and only for version 3.0 or later. Since then,
# the advice given here
# http://mail.gnu.org/pipermail/autoconf/2000-July/005479.html
# is followed, and '--pipe' is not used unless you specify it on
# the make command line, e.g.
# make CXXFLAGS=--pipe CFLAGS=--pipe -f makefile.g95
#
endif
# Define the C++ and C compiler respectively
ifndef WINE
CXX = $(CROSS)g++
CC = $(CROSS)gcc
else
CXX = wineg++
CC = winegcc
endif
# Compiler used for LEX generated C
# For now at least, it can be the same as the regular C compiler
CCLEX = $(CROSS)$(CC)
# This shouldn't be needed as make is supposed to define this
# variable itself. Uncomment it if your make complains.
#MAKE=make
# LEX (currently unused)
# LEX=flex # -t -L
# YACC (currently unused)
# YACC=byacc
# YACC=bison
# Settings for Cyginw/Mingw32
# Some versions of windres cannot cope with the --preprocessor
# option. Uncomment the RCPREPROCESSOR line below if yours can.
ifndef WINE
RESCOMP=$(CROSS)windres $(_USE_TEMP_FILE_IF_SUPPORTED)
else
RESCOMP=wrc
endif
RCINPUTSWITCH=-i
RCOUTPUTSWITCH=-o
RCINCSWITCH=--include-dir
RCDEFSWITCH=--define
# Note that this can cause windres to fail (Win95/98 problem?)
# but commenting out RCPREPROCESSOR then does the trick.
#RCPREPROCESSOR=--preprocessor "$(CXX) -c -E -xc-header -DRC_INVOKED"
# Don't make this too long (e.g. by adding contrib/include/wx) because it will
# truncate the command line
RESFLAGS=$(RCPREPROCESSOR) $(RCINCSWITCH) $(WXDIR)/include $(RCEXTRAINC) $(RCDEFSWITCH) __WIN32__ $(RCDEFSWITCH) __WIN95__ $(RCDEFSWITCH) __GNUWIN32__
# Needed to build a DLL if your linker does not support --shared option.
AS = $(CROSS)as
DLLTOOL = $(CROSS)dlltool
########################## Compiler flags #############################
# Unicode defines
ifeq ($(UNICODE),1)
UNICODE_OPT = -D_UNICODE -DUNICODE -DwxUSE_UNICODE=1
else
UNICODE_OPT =
endif
# Miscellaneous compiler options
OPTIONS = -DSTRICT $(_USE_W32API_HEADER_IF_SUPPORTED)
# Add "-mthreads" if you want to have threads under mingw32
# Add "-mno-cygwin" if you want to link with msvcrt.dll in Cywin and Wine
# Otherwise, you link against the native runtime (cygwin.dll
# or libc). Having the flag in mingw32 does not hurt as you
# always link against msvcrt.dll By default it should be on,
# to minimize dependencies on Cygwin, and have more correct
# filename behaviour in Wine.
COMMON_FLAGS = -mno-cygwin # -mthreads
# Debugging information
ifeq ($(FINAL),0)
DEBUGFLAGS = -g -D__WXDEBUG__
endif
WIN95=1
ifeq ($(WIN95),0)
# With 3.50, Win95 will use your existing icons to show smaller ones.
# With 4.0, you'll have to follow Win95 procedures for icons or you'll get the
# default Windows icon.
APPVER=3.50
WINVERSION=-DWINVER=0x0350 -D__GNUWIN32__ # Generic WIN32
else
APPVER=4.0 # 3.50
# This means 'enable Windows 95 features' (in wxWindows and in the compiler).
WINVERSION=-DWINVER=0x0400 -D__GNUWIN32__
endif
# This is never used and should be expunged.
# CPU=i386
# Suffixes
OBJSUFF=o
SRCSUFF=cpp
LIBPREFIX=lib
LIBSUFF=a
EXESUFF=.exe
RESSUFF=res
RSCSUFF=rsc
# Warnings
WARN = -Wall
# build wxbase/wxMSW
ifeq ($(wxUSE_GUI),1)
CD56
TOOLKIT=msw
GUI =
else
TOOLKIT=base
GUI = -DwxUSE_GUI=0
endif
ifeq ($(FINAL),1)
OPT = -O2 -fno-rtti -fno-exceptions
else
OPT = -fno-rtti -fno-exceptions
endif
# Options for ar archiver
AROPTIONS = ruv
AR = $(CROSS)ar
RANLIB = $(CROSS)ranlib
# Extra compiler libraries
COMPLIBS=
# Compiler or system-specific include paths
COMPPATHS=
########################## Directories ###############################
OLELIBS=-lole32 -loleaut32 -luuid
BASELIBS=-lstdc++ -lgcc -lodbc32 -lwsock32
ifeq ($(wxUSE_GUI),1)
WINLIBS= $(BASELIBS) \
-lwinspool -lwinmm -lshell32 \
-lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 \
-lodbc32 -lwsock32 -lopengl32 -lglu32 $(OLELIBS) # -loldnames
else
WINLIBS=$(BASELIBS)
endif
#WINLIBS=-lstdc++ -lgcc \
# -lwinspool -lwinmm -lshell32 \
# -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lwsock32 # -loldnames
# Shouldn't need to change these...
WXSRC=$(WXDIR)/src/msw
WXINC=$(WXDIR)/include
WXBASESRC=$(WXDIR)/src/common
#ifeq ($(MINGW32),1)
#INC = -I$(WXINC) -I$(WXDIR)/contrib/include -I$(WXDIR)/src/png -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/zlib -I$(WXDIR)/src/tiff $(EXTRAINC) $(COMPPATHS)
#else
INC = -I$(WXDIR)/lib/$(TOOLKIT)$(INCEXT) -I$(WXINC) -I$(WXDIR)/contrib/include -I$(WXDIR)/src/regex -I$(WXDIR)/src/png -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/zlib -I$(WXDIR)/src/tiff $(EXTRAINC) $(COMPPATHS) $(GNUWIN32EXTRA)
#endif
RCLFLAGS=-cpp "cpp -lang-c++ $(OBSOLETE_DEFINES) -DRCL_INVOKED -I$(WXWIN)/include"
ifdef WXUSINGDLL
# png, jpeg, etc are exported from wx dll, so skip and save on link time.
LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(COMPLIBS)
else
LIBS = $(EXTRALIBS) $(WXLIB) -lregex$(MIN_SUFFIX) -lpng$(MIN_SUFFIX) -ljpeg$(MIN_SUFFIX) -lzlib$(MIN_SUFFIX) -ltiff$(MIN_SUFFIX) $(WINLIBS) $(COMPLIBS)
endif
WINFLAGS = $(OBSOLETE_DEFINES) $(WINVERSION)
#for windows 95
XINCLUDE=$(WINFLAGS)
XLIB=$(LIBS)
LDLIBS = $(LIBS)
# Directory for object files (don't change)
# OBJDIR = objects$(GUISUFFIX)
OBJDIR = .
ifeq ($(FINAL),1)
DEBEXT=
else
DEBEXT=d
endif
ifeq ($(UNICODE),1)
UNIEXT=u
else
UNIEXT=
endif
ifeq ($(WXMAKINGDLL)$(WXUSINGDLL),)
INCEXT=$(UNIEXT)$(DEBEXT)
else
INCEXT=dll$(UNIEXT)$(DEBEXT)
endif
WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx$(TOOLKIT)$(UNIEXT)$(DEBEXT).$(LIBSUFF)
ifdef WXMAKINGDLL
EXTRADLLFLAGS = -DWXMAKINGDLL=1 -D_DLL=1 -D_WINDLL=1
WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx$(TOOLKIT)$(WXVERSION)$(UNIEXT)$(DEBEXT)$(MIN_SUFFIX).$(LIBSUFF)
endif
ifdef WXUSINGDLL
EXTRADLLFLAGS = -DWXUSINGDLL=1
WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx$(TOOLKIT)$(WXVERSION)$(UNIEXT)$(DEBEXT)$(MIN_SUFFIX).$(LIBSUFF)
endif
ifeq ($(wxUSE_GUI),1)
WINDOWSLDFLAGS=-Wl,--subsystem,windows
WINDOWSLDLIBS=-mwindows
endif
# Note: WIN32_LEAN_AND_MEAN is defined only for C and not for C++ compiles.
# Defining this macro means that a great deal of less commonly used stuff
# is ignored in the windows headers, resulting in faster compiles. It can't
# be used with some C++ source files. It just so happens that it can be
# used with all C source files.
CFLAGS = -DWIN32_LEAN_AND_MEAN
WXLIBDIRS = -L$(WXDIR)/lib -L$(WXDIR)/contrib/lib
# You shouldn't need to change these flags, which are merely composed of
# the options selected above. You can add more flags by specifying them on
# the make command line, e.g.
# make CXXFLAGS='-O3 -march=i686' -f makefile.g95
# The gnu make manual says
# 'Users expect to be able to specify CFLAGS freely themselves'
# That was unsafe with older versions of this makefile, but now it works.
#
# C preprocessor flags
# Some makefiles pass extra flags in $(EXTRACPPFLAGS); although earlier
# versions of this file used CPPFLAGS as C++ compiler flags (instead of
# as C preprocessor flags), it is OK to add them to the preprocessor
# flags, which are always used for C++ compiles. Because other makefiles
# use this method to override these flags, they are added after $(CPPFLAGS),
# which would normally come last.
ALL_CPPFLAGS = $(XINCLUDE) $(INC) $(CPPFLAGS) $(EXTRACPPFLAGS)
# C and C++ compiler flags for compatibility with old gcc versions
REQUIRED_GCC_FLAGS = $(_STRUCT_RETURN_WORKAROUND) $(_THUNK_WORKAROUND)
# C++ compiler flags
ALL_CXXFLAGS = $(COMMON_FLAGS) $(REQUIRED_GCC_FLAGS) $(UNICODE_OPT) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRADLLFLAGS) $(CXXFLAGS)
# C compiler flags
ALL_CFLAGS = $(COMMON_FLAGS) $(REQUIRED_GCC_FLAGS) $(UNICODE_OPT) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRADLLFLAGS) $(CFLAGS)
# Linker flags
ALL_LDFLAGS = $(COMMON_FLAGS) $(WINDOWSLDFLAGS) $(WINDOWSLDLIBS) $(WXLIBDIRS) $(EXTRALDFLAGS) $(LDFLAGS)
# under Cygwin, Dlls must not be linked with subsystem=windows
ALL_LDFLAGS_DLL = $(COMMON_FLAGS) $(WINDOWSLDLIBS) $(WXLIBDIRS) $(EXTRALDFLAGS) $(LDFLAGS)
.SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .cxx .cc .c
.c.o:
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ $*.c
.cc.o:
$(CXX) -c $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -o $@ $*.cc
.cxx.o:
$(CXX) -c $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -o $@ $*.cxx
# This '.cpp.o' rule is apparently written this way because
# the 'tmake' file g95.t expects it.
.$(SRCSUFF).$(OBJSUFF):
$(CXX) -c $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -o $@ $*.$(SRCSUFF)