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 WXDEBUG=''
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__WXDEBUG__
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 # Which GUI, -Dwx_xview or -Dwx_motif (don't change this)
105 GUI = -D__WXMSW__ -D__WINDOWS__
109 # FreeBSD 2.0 with i486: OPT = -O2 -m486
110 # IRIX: -O2 #-O0 : no, -O1: quick, -O2: global -O3: full(register)
111 # Linux: -m486 # -O2 for optimization
114 # Options for ar archiver
115 # AROPTIONS = crs # For IRIX and Solaris (both SYSVR4).
119 # Compiler libraries: defaults to GCC libraries
120 # Solaris: -lgen -ldl -lsocket -lnsl
121 # and/or possibly -lucb, whatever that is... (-lucb CAUSES MOTIF FILE SELECTION PROBLEMS)
122 # or possibly -lgen -lsocket -L/usr/ccs/lib linbnsl.a
123 # GCC > 2.7.1 on Solaris: -lstdc++ -lc -lgen -ldl -lsocket -lnsl -lucb
125 # FreeBSD 2.0: -lg++ -lcompat
126 # FreeBSD 1.x: -lcompat doesn`t need, only -lg++ needed
128 # G++ 2.7.0 requires -liostream too.
134 # Compiler or system-specific include paths
135 # E.g. some SPARCStations need
136 # -I/usr/ucbinclude/sys
140 ########################## Directories ###############################
143 WINLIBS=-lstdc++ -lgcc \
144 -lwinspool -lwinmm -lshell32 -loldnames \
145 -lcomctl32 -lctl3d32 -lodbc32
147 # Shouldn't need to change these...
148 WXSRC=$(WXDIR)/src/msw
149 WXINC=$(WXDIR)/include
150 WXBASESRC=$(WXDIR)/src/common
151 WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx.$(LIBSUFF)
152 INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/include/wx/msw/gnuwin32 -I$(WXDIR)/src/zlib $(EXTRAINC)$(COMPPATHS)
153 RCLFLAGS=-cpp "cpp -lang-c++ -DWIN32 -D_WIN32 -DRCL_INVOKED -I$(WXWIN)\include"
155 #LIBS = -lctl3d32 $(WXLIB) $(WINLIBS) $(COMPLIBS)
156 LIBS = $(WXLIB) $(WINLIBS) $(COMPLIBS)
158 WINFLAGS=-D_X86_=1 -DWIN32 -D_WIN32 $(WINVERSION)
165 # Directory for object files (don't change)
166 OBJDIR = objects$(GUISUFFIX)
168 # You shouldn't need to change these...
169 CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DWXDEBUG='$(WXDEBUG)' $(WARN) $(OPT)
170 CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DWXDEBUG='$(WXDEBUG)' $(WARN) $(OPT)
171 LDFLAGS = -Wl,--subsystem,windows -mwindows -L$(WXDIR)/lib
173 .SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .c
175 # Set these in a batch file instead e.g. install/cygnus.bat
176 # RCINCLUDE="$(WXDIR)/include/msw;$(WXDIR)/contrib/fafa;$(WXDIR)/contrib/itsybits"; \
177 # 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; \
178 # export CPLUS_INCLUDE_PATH RCINCLUDE; \
180 .rc.$(RESSUFF): $< $(WXDIR)/include/msw/wx.rc
181 $(RC) $(RESFLAGS1) $< $(RESFLAGS2) $*.$(RESSUFF) $(RCLFLAGS)
183 .$(RESSUFF).$(RSCSUFF): $<
184 $(CVTRES) $< $*.$(RSCSUFF)
186 .$(SRCSUFF).$(OBJSUFF):
187 $(CC) -c $(CPPFLAGS) -o $@ $*.$(SRCSUFF)
190 $(CC) -c $(CPPFLAGS) -o $@ $*.c