]>
Commit | Line | Data |
---|---|---|
2bda0e17 KB |
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). | |
f3ef286f | 5 | # The settings are for GnuWin32-derived compilers, i.e. Cygwin and Mingw32. |
2bda0e17 | 6 | # |
f3ef286f JS |
7 | |
8 | # If using Cygwin, set this to 0. | |
9 | # If using Mingw32, set this to 1. | |
1a7f3062 JS |
10 | MINGW32=1 |
11 | ||
12 | # Set to the version you have | |
13 | MINGW32VERSION=2.95 | |
2bda0e17 KB |
14 | |
15 | ########################## Compiler ################################## | |
16 | ||
17 | # C++ compiler | |
f3ef286f JS |
18 | # Put a comment before --pipe for Cygwin, remove comment for Mingw32 2.95 |
19 | ||
20 | ifeq ($(MINGW32),1) | |
1a7f3062 JS |
21 | ifeq ($(MINGW32VERSION),2.95) |
22 | CC = gcc --pipe -fvtable-thunks | |
23 | else | |
24 | CC = gcc | |
25 | endif | |
f3ef286f | 26 | else |
1a7f3062 | 27 | CC = gcc |
f3ef286f | 28 | endif |
2bda0e17 KB |
29 | |
30 | # C compiler for pure C programs | |
2bda0e17 KB |
31 | CCC = $(CC) |
32 | ||
33 | # Compiler used for LEX generated C | |
8704bf74 | 34 | CCLEX=gcc |
2bda0e17 KB |
35 | |
36 | MAKE=make | |
37 | ||
38 | # LEX | |
8870c26e | 39 | LEX=flex # -t -L |
2bda0e17 | 40 | |
57c208c5 | 41 | # YACC. yacc or bison |
2662e49e RR |
42 | YACC=byacc |
43 | #YACC=bison | |
2bda0e17 | 44 | |
57c208c5 | 45 | # Settings for Cyginw/Mingw32 |
2bda0e17 | 46 | RESCOMP=windres.exe |
57c208c5 JS |
47 | RCINPUTSWITCH=-i |
48 | RCOUTPUTSWITCH=-o | |
49 | RCINCSWITCH=--include-dir | |
50 | RCDEFSWITCH=--define | |
2bda0e17 | 51 | |
6a570331 | 52 | RESFLAGS=$(RCINCSWITCH) $(WXDIR)/include $(RCDEFSWITCH) __WIN32__ $(RCDEFSWITCH) __WIN95__ $(RCDEFSWITCH) __GNUWIN32__ |
2bda0e17 KB |
53 | |
54 | ########################## Compiler flags ############################# | |
55 | ||
56 | # Miscellaneous compiler options | |
f3ef286f | 57 | OPTIONS= -DSTRICT # -D__MINGW32__ |
2bda0e17 KB |
58 | |
59 | # Debugging information | |
e4d18e7f | 60 | DEBUGFLAGS = -D__WXDEBUG__ |
2bda0e17 | 61 | |
2bda0e17 KB |
62 | WIN95=1 |
63 | ||
64 | ifeq ($(WIN95),0) | |
65 | # With 3.50, Win95 will use your existing icons to show smaller ones. | |
66 | # With 4.0, you'll have to follow Win95 procedures for icons or you'll get the | |
67 | # default Windows icon. | |
68 | APPVER=3.50 | |
69 | WINVERSION=-DWINVER=0x0350 -D__GNUWIN32__ -D__WIN32__ # Generic WIN32 | |
70 | else | |
71 | APPVER=3.50 # 4.0 | |
72 | # This means 'enable Windows 95 features' (in wxWindows and in VC++ 4.0). | |
73 | WINVERSION=-DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ | |
74 | endif | |
75 | ||
76 | CPU=i386 | |
77 | ||
78 | # Suffixes | |
79 | OBJSUFF=o | |
80 | SRCSUFF=cpp | |
81 | LIBPREFIX=lib | |
82 | LIBSUFF=a | |
83 | EXESUFF=.exe | |
84 | RESSUFF=res | |
85 | RSCSUFF=rsc | |
86 | ||
87 | # Warnings | |
2bda0e17 KB |
88 | WARN = -Wall |
89 | ||
2bda0e17 | 90 | # Which GUI, -Dwx_xview or -Dwx_motif (don't change this) |
34138703 | 91 | GUI = -D__WXMSW__ -D__WINDOWS__ |
2bda0e17 | 92 | |
881eba2c GRG |
93 | # according to Guillermo Rodriguez Garcia <guille@iies.es> this flag is |
94 | # needed to make the standard div() function work - otherwise it returns | |
95 | # absolutely incorrect results and completely breaks the wxImage class | |
96 | # (where it's used extensively) | |
97 | # GRG: at least it is needed in mingw32-gcc2.8.1 | |
e4d18e7f | 98 | OPT = -fno-pcc-struct-return -O2 -fno-rtti -fno-exceptions |
2bda0e17 KB |
99 | |
100 | # Options for ar archiver | |
101 | # AROPTIONS = crs # For IRIX and Solaris (both SYSVR4). | |
102 | AROPTIONS = ruv | |
103 | RANLIB = ranlib | |
2bda0e17 | 104 | |
b4fe5125 JS |
105 | # Extra compiler libraries |
106 | COMPLIBS= | |
2bda0e17 KB |
107 | |
108 | # Compiler or system-specific include paths | |
48d1144b | 109 | COMPPATHS= |
2bda0e17 | 110 | |
2bda0e17 KB |
111 | ########################## Directories ############################### |
112 | ||
2bda0e17 | 113 | WINLIBS=-lstdc++ -lgcc \ |
8870c26e | 114 | -lwinspool -lwinmm -lshell32 \ |
b4fe5125 JS |
115 | -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 \ |
116 | -lole32 -loleaut32 -luuid \ | |
117 | -lodbc32 -lwsock32# -loldnames | |
118 | ||
119 | #WINLIBS=-lstdc++ -lgcc \ | |
120 | # -lwinspool -lwinmm -lshell32 \ | |
121 | # -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lwsock32 # -loldnames | |
2bda0e17 KB |
122 | |
123 | # Shouldn't need to change these... | |
6a570331 RR |
124 | WXSRC=$(WXDIR)/src/msw |
125 | WXINC=$(WXDIR)/include | |
126 | WXBASESRC=$(WXDIR)/src/common | |
127 | WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx.$(LIBSUFF) | |
f3ef286f | 128 | |
1a7f3062 JS |
129 | GNUWIN32EXTRA=-I$(WXDIR)/include/wx/msw/gnuwin32 |
130 | ||
131 | ifeq ($(MINGW32),1) | |
132 | ifeq ($(MINGW32),2.95) | |
133 | GNUWIN32EXTRA= | |
134 | endif | |
135 | endif | |
136 | ||
f3ef286f JS |
137 | ifeq ($(MINGW32),1) |
138 | INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/zlib $(EXTRAINC) $(COMPPATHS) | |
139 | else | |
140 | INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/zlib $(EXTRAINC) $(COMPPATHS) -I$(WXDIR)/include/wx/msw/gnuwin32 | |
141 | endif | |
142 | ||
6a570331 | 143 | RCLFLAGS=-cpp "cpp -lang-c++ -DWIN32 -D_WIN32 -DRCL_INVOKED -I$(WXWIN)/include" |
2bda0e17 | 144 | |
dbda9e86 | 145 | LIBS = $(WXLIB) $(WINLIBS) $(COMPLIBS) $(EXTRALIBS) |
2bda0e17 KB |
146 | |
147 | WINFLAGS=-D_X86_=1 -DWIN32 -D_WIN32 $(WINVERSION) | |
148 | ||
149 | #for windows 95 | |
150 | XINCLUDE=$(WINFLAGS) | |
151 | XLIB=$(LIBS) | |
152 | LDLIBS = $(LIBS) | |
153 | ||
154 | # Directory for object files (don't change) | |
dbda9e86 | 155 | # OBJDIR = objects$(GUISUFFIX) |
881eba2c | 156 | OBJDIR = . |
2bda0e17 KB |
157 | |
158 | # You shouldn't need to change these... | |
dbda9e86 JS |
159 | CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRACPPFLAGS) |
160 | CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRACFLAGS) | |
57c208c5 | 161 | WINDOWSLDFLAGS=-Wl,--subsystem,windows -mwindows |
dbda9e86 | 162 | LDFLAGS = $(WINDOWSLDFLAGS) -L$(WXDIR)/lib $(EXTRALDFLAGS) |
2bda0e17 | 163 | |
2bda0e17 KB |
164 | .SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .c |
165 | ||
2bda0e17 KB |
166 | .$(SRCSUFF).$(OBJSUFF): |
167 | $(CC) -c $(CPPFLAGS) -o $@ $*.$(SRCSUFF) | |
168 | ||
169 | .c.o: | |
170 | $(CC) -c $(CPPFLAGS) -o $@ $*.c | |
171 | ||
172 |