try to create smaller executables

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-02-04 20:34:43 +00:00
parent 9d1e1be463
commit 205b0c9c6a
2 changed files with 25 additions and 26 deletions

View File

@ -29,8 +29,9 @@ $(RESFILE): $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc
$(LNK) : makefile.wat
%create $(LNK)
@%append $(LNK) $(LDFLAGS)
@%append $(LNK) $(DEBUGINFO)
@%append $(LNK) system $(LINKOPTION)
@%append $(LNK) system $(LINKSYSTEM)
@%append $(LNK) $(STACK)
@%append $(LNK) name $(OUTPUTDIR)$(PROGRAM).exe
@for %i in ($(OBJECTS)) do @%append $(LNK) file %i

View File

@ -28,6 +28,22 @@ FINAL=0
# compiler
WATCOM_SUFFIX=_w
# change/remove this if you want to create programs for older Windows versions,
# increase the version to be able to use more Win2K+-only features
WINVERFLAGS = /dWINVER=0x400 /d_WIN32_IE=0x0300
# optimize for space/time: /os or /ot
!ifeq FINAL 1
OPTFLAGS=/oails /5r
!else
OPTFLAGS=/od
!endif
###############################################################################
# You shouldn't have to modify anything after this point
###############################################################################
.EXTENSIONS:
.EXTENSIONS: .exe .obj .c .cc .cpp .res .rc .def
@ -69,10 +85,10 @@ DEBUGSUFFIX =
!ifeq wxUSE_GUI 0
TOOLKIT = base
BASEDIRPREFIX = Base
LINKOPTION = nt
LINKSYSTEM = nt
!else
TOOLKIT = msw
LINKOPTION = nt_win
LINKSYSTEM = nt_win
BASEDIRPREFIX =
!endif
@ -103,16 +119,12 @@ PRECOMP = /fh=$(OUTPUTDIR)watcom.pch
# the basename of the library
LIBNAME=wx$(TOOLKIT)$(DEBUGSUFFIX)$(WATCOM_SUFFIX)
# You shouldn't have to modify anything after this point
########################################################
# only LEVEL=386 is currently supported, 16 bit compilation is probably broken
LEVEL = 386
CXX = wpp$(LEVEL)
CC = wcc$(LEVEL)
LIB = wlib /q
RC = wrc
WINVERFLAGS = /dWINVER=0x400
BINDCOMMAND = wrc
WATLIBDIR = $(WATCOMDIR)\lib386\nt
STACK = option stack=64k
@ -137,23 +149,6 @@ IFLAGS = -i=$(ARCHINCDIR);$(WXDIR)\include &
-i=$(WXDIR)\include\wx\msw\gnuwin32
RESFLAGS = -q -r -bt=nt /i$(WXDIR)\include /i$(WXDIR)\contrib\include $(WINVERFLAGS)
# Here are some possible optimization flags:
# /5r Pentium timings
# /fp5 /fpi87 Inline 80x87 instructions optimized for Pentium: coprocessor must be present
# /ox Standard optimizations
# /or Reordering for Pentium timings (included in /ox)
# The Watcom-recommended flags for optimum Pentium speed are:
# /oneatx /zp4 /5 /fpi87 /fp5
# for PPro:
# OPTFLAGS=/oneatx /oh /oi+ /ei /zp8 /6 /fp6
#
# optimize for space/time: /os or /ot
!ifeq FINAL 1
OPTFLAGS=/oails /5r
!else
OPTFLAGS=/od
!endif
# NB: /bm switch is needed for thread-safe runtime, if you don't use
# wxThread you may remove it
CPPFLAGS = /dWIN32 /bm /fo=$(OUTPUTDIR) /fr /zq $(IFLAGS) $(OPTFLAGS) $(WINVERFLAGS) $(EXTRACPPFLAGS)
@ -161,8 +156,11 @@ CPPFLAGS = /dWIN32 /bm /fo=$(OUTPUTDIR) /fr /zq $(IFLAGS) $(OPTFLAGS) $(WINVERFL
CPPFLAGS += /dwxUSE_GUI=0
!endif
CFLAGS = $(CPPFLAGS) $(DEBUGCFLAGS) $(EXTRACFLAGS)
CXXFLAGS = $(CPPFLAGS) $(DEBUGCXXFLAGS) $(PRECOMP) /w=8 $(EXTRACXXFLAGS)
# zm and zv as well as the liker options below are used to make the resulting
# .exe smaller
CFLAGS = $(CPPFLAGS) $(DEBUGCFLAGS) $(EXTRACFLAGS) /zm
CXXFLAGS = $(CPPFLAGS) $(DEBUGCXXFLAGS) $(PRECOMP) /zm /zv /w=8 $(EXTRACXXFLAGS)
LDFLAGS = option eliminate, vfremoval
.cpp.obj: # $< # .AUTODEPEND
*$(CXX) $(CXXFLAGS) $<