makeg95.env edited for Mingw32/gcc 2.95 compilation; _T not redefined for
[wxWidgets.git] / src / makeg95.env
1 # makeg95.env
2 # Common makefile settings for wxWindows programs
3 # This file is included by all the other makefiles, thus changes 
4 # made here take effect everywhere (except where overriden).
5 #
6 # An alternative to editing this file is to create a shell script
7 # to export specific variables, and call make with the -e switch
8 # to override makefile variables. See wx/install/install.txt.
9 # And you can override specific variables on the make command line, e.g.
10 #
11 # make -f makefile.unix WXDEBUG=''
12 #
13 # You may prefer to use the GNU configure script than raw makefiles -
14 # see contrib/wxshlib.
15 #
16
17 ########################## Compiler ##################################
18
19 # C++ compiler
20 # For AIX/CSet++: use CC = xlC
21 # For IRIX: use CC = CC
22 # CC = gcc-2.6.2
23 CC = gcc --pipe -fvtable-thunks
24
25 # C compiler for pure C programs
26 # Typical: CC=g++ , CCC=gcc
27 #          CC=cl386 /Tp, CCC=cl386
28 #
29 # (Used only for XView, file sb_scrol.c)
30 #
31 CCC = $(CC)
32
33 # Compiler used for LEX generated C
34 CCLEX=gcc
35
36 MAKE=make
37
38 # LEX
39 LEX=flex # -t -L
40
41 # YACC. yacc or bison
42 YACC=byacc
43 #YACC=bison
44
45 # Settings for Cyginw/Mingw32
46 RESCOMP=windres.exe
47 RCINPUTSWITCH=-i
48 RCOUTPUTSWITCH=-o
49 RCINCSWITCH=--include-dir
50 RCDEFSWITCH=--define
51
52 RESFLAGS=$(RCINCSWITCH) $(WXDIR)/include $(RCDEFSWITCH) __WIN32__ $(RCDEFSWITCH) __WIN95__ $(RCDEFSWITCH) __GNUWIN32__
53
54 ########################## Compiler flags #############################
55
56 # Miscellaneous compiler options
57 # GRG: The __EGCS__ symbol is not needed anymore!
58 OPTIONS= -DSTRICT # -D__MINGW32__ # -D__EGCS__
59
60 # Debugging information
61 # AIX: comment out.
62 # IRIX: -g3
63 DEBUGFLAGS = -D__WXDEBUG__
64
65 WIN95=1
66
67 ifeq ($(WIN95),0)
68 # With 3.50, Win95 will use your existing icons to show smaller ones.
69 # With 4.0, you'll have to follow Win95 procedures for icons or you'll get the
70 # default Windows icon.
71 APPVER=3.50
72 WINVERSION=-DWINVER=0x0350 -D__GNUWIN32__ -D__WIN32__ # Generic WIN32
73 else
74 APPVER=3.50 # 4.0
75 # This means 'enable Windows 95 features' (in wxWindows and in VC++ 4.0).
76 WINVERSION=-DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__
77 endif
78
79 CPU=i386
80
81 # Suffixes
82 OBJSUFF=o
83 SRCSUFF=cpp
84 LIBPREFIX=lib
85 LIBSUFF=a
86 EXESUFF=.exe
87 RESSUFF=res
88 RSCSUFF=rsc
89
90 # Warnings
91 WARN = -Wall
92
93 # Which GUI, -Dwx_xview or -Dwx_motif (don't change this)
94 GUI = -D__WXMSW__ -D__WINDOWS__
95
96 # according to Guillermo Rodriguez Garcia <guille@iies.es> this flag is
97 # needed to make the standard div() function work - otherwise it returns
98 # absolutely incorrect results and completely breaks the wxImage class
99 # (where it's used extensively)
100 # GRG: at least it is needed in mingw32-gcc2.8.1
101 OPT = -fno-pcc-struct-return -O2 -fno-rtti -fno-exceptions
102
103 # Options for ar archiver
104 # AROPTIONS = crs # For IRIX and Solaris (both SYSVR4).
105 AROPTIONS = ruv
106 RANLIB = ranlib
107
108 # Extra compiler libraries
109 COMPLIBS=
110
111 # Compiler or system-specific include paths
112 COMPPATHS=
113
114 ########################## Directories ###############################
115
116 WINLIBS=-lstdc++ -lgcc \
117         -lwinspool -lwinmm -lshell32 \
118         -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 \
119         -lole32 -loleaut32 -luuid \
120         -lodbc32 -lwsock32#  -loldnames
121
122 #WINLIBS=-lstdc++ -lgcc \
123 #       -lwinspool -lwinmm -lshell32 \
124 #    -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lwsock32 # -loldnames
125
126 # Shouldn't need to change these...
127 WXSRC=$(WXDIR)/src/msw
128 WXINC=$(WXDIR)/include
129 WXBASESRC=$(WXDIR)/src/common
130 WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx.$(LIBSUFF)
131 INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/zlib $(EXTRAINC) $(COMPPATHS) # -I$(WXDIR)/include/wx/msw/gnuwin32 
132 RCLFLAGS=-cpp "cpp -lang-c++ -DWIN32 -D_WIN32 -DRCL_INVOKED -I$(WXWIN)/include"
133
134 #LIBS = -lctl3d32 $(WXLIB) $(WINLIBS) $(COMPLIBS)
135 LIBS = $(WXLIB) $(WINLIBS) $(COMPLIBS) $(EXTRALIBS)
136
137 WINFLAGS=-D_X86_=1 -DWIN32 -D_WIN32 $(WINVERSION)
138
139 #for windows 95
140 XINCLUDE=$(WINFLAGS)
141 XLIB=$(LIBS)
142 LDLIBS = $(LIBS)
143
144 # Directory for object files (don't change)
145 # OBJDIR = objects$(GUISUFFIX)
146 OBJDIR = .
147
148 # You shouldn't need to change these...
149 CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRACPPFLAGS)
150 CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRACFLAGS)
151 WINDOWSLDFLAGS=-Wl,--subsystem,windows -mwindows
152 LDFLAGS = $(WINDOWSLDFLAGS) -L$(WXDIR)/lib $(EXTRALDFLAGS)
153
154 .SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .c
155
156 # Set these in a batch file instead e.g. install/cygnus.bat
157 #       RCINCLUDE="$(WXDIR)/include/msw;$(WXDIR)/contrib/fafa;$(WXDIR)/contrib/itsybits"; \
158 #       CPLUS_INCLUDE_PATH=/usr/H-i386-cygwin32/i386-cygwin32/include:/usr/H-i386-cygwin32/lib/gcc-lib/i386-cygwin32/cygnus-2.7.2-961023/include:$(WXDIR)/include/common:$(WXDIR)/include/msw:$(WXDIR)/contrib/fafa:$(WXDIR)/contrib/itsybits; \
159 #       export CPLUS_INCLUDE_PATH RCINCLUDE;  \
160
161 #.rc.$(RESSUFF):  $< $(WXDIR)/include/msw/wx.rc
162 #       $(RC) $(RESFLAGS1) $< $(RESFLAGS2) $*.$(RESSUFF) $(RCLFLAGS)
163
164 #.$(RESSUFF).$(RSCSUFF): $<
165 #       $(CVTRES) $< $*.$(RSCSUFF)
166
167 .$(SRCSUFF).$(OBJSUFF):
168         $(CC) -c $(CPPFLAGS) -o $@ $*.$(SRCSUFF)
169
170 .c.o:
171         $(CC) -c $(CPPFLAGS) -o $@ $*.c
172
173