# File:         makewat.env
# Purpose:      Watcom environments for wxWindows makefiles.
# Author:       Julian Smart and others
#
# The main things to change are:
#
#   WATCOM:    set to where the compiler is installed
#   WXDIR:     set to where the wxWindows is installed
#   MODE:      set to windows [16 bit windows], nt [win32s], or win386 [32-bit non-WIN32]

FINAL=0
WATCOMDIR=$(%WATCOM)

.EXTENSIONS:
.EXTENSIONS: .exe .obj .c .cc .cpp .res .rc .def

#WXDIR = d:\wx2\wxwind~1
WXDIR = $(%WXWIN)
WXINC = $(WXDIR)\include

# Suffixes
OBJSUFF=obj
SRCSUFF=cpp

WXDEBUG=0

!ifneq NOPRECOMP 1
PRECOMP     = /fh=$(WXDIR)\src\msw\watcom.pch
!endif

!ifeq WXDEBUG 1
DEBUGFLAGS     = /D__WXDEBUG__ /o1
DEBUGINFO   = debug all
!else
DEBUGFLAGS     =
DEBUGINFO   =
!endif

RC = wrc

LEVEL       = 386
CCC         = wpp$(LEVEL)
CC         =  wcc$(LEVEL)
OS_TARGET   = nt_win
MODEL       =
# If you use win95, assumptions will be made about Win95 icon format etc.
# so nt_win is probably better for simultaneous Win32s/Win95/NT operation.
LINKOPTION  = nt_win # win95
BINDCOMMAND = wrc
WATLIBDIR   = $(WATCOMDIR)\lib386\nt
MINDATA     =
MAXDATA     =
STACK       = option stack=64k
LIBS   = $(WXDIR)\lib\wx.lib $(WXDIR)\lib\zlib.lib $(WXDIR)\lib\png.lib $(WXDIR)\lib\tiff.lib $(WXDIR)\lib\jpeg.lib &
      $(WATLIBDIR)\comctl32.lib $(WATLIBDIR)\comdlg32.lib &
      $(WATLIBDIR)\ole32.lib $(WATLIBDIR)\oleaut32.lib $(WATLIBDIR)\opengl32.lib &
      $(WATLIBDIR)\uuid.lib $(WXDIR)\lib\watcom\odbc32.lib 
IFLAGS      = -i=$(WXINC) -i=$(WXDIR)\contrib\include -i=$(%watcom)\h;$(%watcom)\h\nt;$(WXDIR)\src\png;$(WXDIR)\src\zlib;$(WXDIR)\src\jpeg;$(WXDIR)\src\tiff;$(WXDIR)\include\wx\msw\gnuwin32
RESFLAGS1   = -r -bt=nt /i$(WXDIR)\include /i$(WXDIR)\contrib\include
RESFLAGS2   = -R $(name) /i$(WXDIR)\include /i$(WXDIR)\contrib\include

# 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

OPTFLAGS=/ox /5r

# /d1 for line numbers only: anything else produces an enormous wx32.lib
CPPFLAGS    = /bt=nt /w1 /DWIN32 /D__WIN32__ /D__WIN95__ /D__WINDOWS__ /zq $(OPTFLAGS) $(MODEL) $(PRECOMP) $(DEBUGFLAGS) /d__WXMSW__ $(EXTRACPPFLAGS) # /d__WATCOMC__

.cpp.obj: # $< # .AUTODEPEND
    *$(CCC) $(CPPFLAGS) $(IFLAGS) $<

.c.obj: # $< # .AUTODEPEND
    *$(CC) $(CPPFLAGS) $(IFLAGS) $<

# This doesn't work for wcc
#    %create tmp.lbc
#    @%append tmp.lbc $(CPPFLAGS) $(IFLAGS) $<
#    echo $<
#    $(CC) @tmp.lbc

dummy:  .SYMBOLIC
    @echo Please give a target for wxWin makefiles: the usual one is 'all'.

erasepch:   .SYMBOLIC
    -erase $(WXDIR)\src\msw\watcom.pch