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).
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.
11 # make -f makefile.unix DEBUG=''
13 # You may prefer to use the GNU configure script than raw makefiles -
14 # see contrib/wxshlib.
17 ########################## Compiler ##################################
20 # For AIX/CSet++: use CC = xlC
21 # For IRIX: use CC = CC
25 # C compiler for pure C programs
26 # Typical: CC=g++ , CCC=gcc
27 # CC=cl386 /Tp, CCC=cl386
29 # (Used only for XView, file sb_scrol.c)
33 # Compiler used for LEX generated C
42 # YACC. byacc or bison
49 RESFLAGS=--include-dir $(WXDIR)/include --define __WIN32__ --define __WIN95__ --define __GNUWIN32__
51 ########################## Compiler flags #############################
53 # Miscellaneous compiler options
55 # Solaris/GCC, dynamic library: -DSVR4 -fPIC
56 # FreeBDS 2.0: does not need -D_BSD - always defined
57 # AIX/CSet++: -+ -qsrcmsg -DSYSV
58 # AIX/GCC: -DSYSV -DAIX
60 # HP: -D_HPUX_SOURCE +a1 -Aa +d -z
62 OPTIONS= # -D__MINGW32__ # -D__EGCS__
64 # Debugging information
67 DEBUGFLAGS = -ggdb -D__DEBUG__
69 # Debug/trace mode. 1 or more for debugging.
75 # With 3.50, Win95 will use your existing icons to show smaller ones.
76 # With 4.0, you'll have to follow Win95 procedures for icons or you'll get the
77 # default Windows icon.
79 WINVERSION=-DWINVER=0x0350 -D__GNUWIN32__ -D__WIN32__ # Generic WIN32
82 # This means 'enable Windows 95 features' (in wxWindows and in VC++ 4.0).
83 WINVERSION=-DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__
99 # IRIX: -w -wlint,-fpiv
100 # These are for the GNU compiler. We now get the compiler to check for as
101 # many things as we can, to catch portability problems sooner.
104 # -pedantic -Wpointer-arith -Wtraditional -Wcast-align \
105 # -Wenum-clash -Wnested-externs -Woverloaded-virtual \
106 # -Winline -Wconversion
108 # not good with too few 'const' decls in wxWindows
109 # -Wcast-qual -Wwrite-strings
111 # too hard (problems with system header files)
112 # -Wstrict-prototypes -Wmissing-prototypes
115 # Which GUI, -Dwx_xview or -Dwx_motif (don't change this)
120 # FreeBSD 2.0 with i486: OPT = -O2 -m486
121 # IRIX: -O2 #-O0 : no, -O1: quick, -O2: global -O3: full(register)
122 # Linux: -m486 # -O2 for optimization
125 # Options for ar archiver
126 # AROPTIONS = crs # For IRIX and Solaris (both SYSVR4).
129 # RANLIB = echo # Uncomment this line for IRIX and Solaris
131 # Compiler libraries: defaults to GCC libraries
132 # Solaris: -lgen -ldl -lsocket -lnsl
133 # and/or possibly -lucb, whatever that is... (-lucb CAUSES MOTIF FILE SELECTION PROBLEMS)
134 # or possibly -lgen -lsocket -L/usr/ccs/lib linbnsl.a
135 # GCC > 2.7.1 on Solaris: -lstdc++ -lc -lgen -ldl -lsocket -lnsl -lucb
137 # FreeBSD 2.0: -lg++ -lcompat
138 # FreeBSD 1.x: -lcompat doesn`t need, only -lg++ needed
140 # G++ 2.7.0 requires -liostream too.
146 # Compiler or system-specific include paths
147 # E.g. some SPARCStations need
148 # -I/usr/ucbinclude/sys
152 # HP-specific compiler library: an AIAI convenience
155 # LDLIBS for specific GUIs
157 # The following for LINUX and Motif 2.0:
158 #MOTIFLDLIBS = -lwx_motif $(COMPLIBS) -lXm -lXmu -lXpm -lXt -lXext -lX11 -lm
160 #BASICMOTIFLDLIBS = -lwx_motif /aiai/packages/motif1.2.1/motif/sun4/lib/libXm.a /aiai/packages/motif1.2.1/motif/sun4/lib/libXmu.a /aiai/packages/motif1.2.1/motif/sun4/lib/libXt.a /aiai/packages/motif1.2.1/motif/sun4/lib/libX11.a -lm
161 # Apparently libg++ (in COMPLIBS) should go before libXm because of a clash of
162 # function name: re_create.
163 #BASICMOTIFLDLIBS = -lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm
165 #MOTIFLDLIBS = $(BASICMOTIFLDLIBS) $(COMPLIBS)
167 #XVIEWLDLIBS = -lwx_ol -lxview -lolgx -lX11 -lm $(COMPLIBS)
168 #HPLDLIBS=-lwx_hp -lXm -lXmu -lXt -lX11 -lm
170 # Default LDLIBS for XView (don't change this)
171 #LDLIBS = $(CYGNUSLDLIBS)
173 # _ol or _motif (don't need to change, the makefiles will take
174 # care of it if you use motif/hp/xview targets)
177 ########################## Directories ###############################
180 WINLIBS=-lstdc++ -lgcc \
181 -lwinspool -lwinmm -lshell32 -loldnames \
182 -lcomctl32 -lctl3d32 -lodbc32
184 # Shouldn't need to change these...
185 WXSRC=$(WXDIR)/src/msw
186 WXINC=$(WXDIR)/include
187 WXBASESRC=$(WXDIR)/src/common
188 WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx.$(LIBSUFF)
189 INC = -I$(WXINC) $(COMPPATHS)
190 RCLFLAGS=-cpp "cpp -lang-c++ -DWIN32 -D_WIN32 -DRCL_INVOKED -I$(WXWIN)\include"
192 #LIBS = -lctl3d32 $(WXLIB) $(WINLIBS) $(COMPLIBS)
193 LIBS = $(WXLIB) $(WINLIBS) $(COMPLIBS)
195 WINFLAGS=-D_X86_=1 -DWIN32 -D_WIN32 $(WINVERSION)
202 # Directory for object files (don't change)
203 OBJDIR = objects$(GUISUFFIX)
205 # You shouldn't need to change these...
206 CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(WARN) $(OPT)
207 CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(WARN) $(OPT)
208 LDFLAGS = -Wl,--subsystem,windows -mwindows -L$(WXDIR)/lib
210 # Extra patch link for XView
211 #XVIEW_LINK = $(WXDIR)/src/x/objects_ol/sb_scrol.o # $(WXDIR)/src/x/objects_ol/xvwinlp.o
213 .SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .c
215 # Set these in a batch file instead e.g. install/cygnus.bat
216 # RCINCLUDE="$(WXDIR)/include/msw;$(WXDIR)/contrib/fafa;$(WXDIR)/contrib/itsybits"; \
217 # 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; \
218 # export CPLUS_INCLUDE_PATH RCINCLUDE; \
220 .rc.$(RESSUFF): $< $(WXDIR)/include/msw/wx.rc
221 $(RC) $(RESFLAGS1) $< $(RESFLAGS2) $*.$(RESSUFF) $(RCLFLAGS)
223 .$(RESSUFF).$(RSCSUFF): $<
224 $(CVTRES) $< $*.$(RSCSUFF)
226 .$(SRCSUFF).$(OBJSUFF):
227 $(CC) -c $(CPPFLAGS) -o $@ $*.$(SRCSUFF)
230 $(CC) -c $(CPPFLAGS) -o $@ $*.c