# Open Watcom C++

.SUFFIXES:
.SUFFIXES: .res .rc .obj .asm .c .cpp

MFLAGS     = -h
MDUMMY     = .SYMBOLIC

OBJ        = .obj
CO         = .obj
LBI        = .lib
LBO        = .lib
RES        = .res

CC         = wcl386
CFLAGS     = -zq -zro -zm -bm -ei -dOS2 -w3 -sg
CFLAGS_DLL = -bd
CFLAGS_DBG = -d2 -dDEBUG=$(DEBUG)
CFLAGS_OPT = -otexan -5r -fp5

CL         = wlink
LFLAGS     = option quiet
LFLAGS_DLL =
LFLAGS_DBG = debug all
LFLAGS_OPT = option eliminate
LFLAGS_OUT = name .\
LDEF_PREFX = @
LDEF_SUFFX = _wcc.def
LOBJ_PREFX = file {
LOBJ_SUFFX = }
LLIB_PREFX = library {
LLIB_SUFFX = }

AS         = nasm
AFLAGS     = -fobj -DUNDERSCORE

LB         = wlib -b -c -q
LBENDL     =

LI         = wlib -b -c -q
IFLAGS_OUT =

RC         = wrc
RFLAGS     = -q

LIBS_TCP   =
LIBS_MM    = mmpm2.lib
LIBS_UNI   = libconv.lib libuls.lib

%INCLUDE   = $(INCDIR);$(%INCLUDE)

!ifdef TCP40
!error The Open Watcom C++ does not support the TCP/IP v4.0.
!endif

!ifdef DEBUG
CFLAGS = $(CFLAGS) $(CFLAGS_DBG)
LFLAGS = $(LFLAGS) $(LFLAGS_DBG)
MFLAGS = $(MFLAGS) DEBUG=$(DEBUG)
!else
CFLAGS = $(CFLAGS) $(CFLAGS_OPT)
LFLAGS = $(LFLAGS) $(LFLAGS_OPT)
!endif

!ifdef DLL
CFLAGS = $(CFLAGS) $(CFLAGS_DLL)
LFLAGS = $(LFLAGS) $(LFLAGS_DLL)
!endif

.default
   @wtouch -c $@

.c.obj:
   $(CC) $(CFLAGS) -c $[@

.cpp.obj:
   $(CC) $(CFLAGS) -c $[@

.rc.res:
   $(RC) $(RFLAGS) -r $<

.asm.obj:
   $(AS) $(AFLAGS) $<
