!ifndef OS
OS                      = DOS
!endif
!ifndef DEBUG
DEBUG                   = TRUE
!endif

DIR                    +=\$(OS)
!ifeq DEBUG TRUE
DIR                    +=\DEBUG
!endif

.SILENT
.ERASE

# -wc  ; Max warning level
# -zpw ; Warning if structure change
# -ei  ; force enums to int
# -db  ; Build browser info
# -wcd=; Disable warning number

!ifeq DEBUG TRUE

MAKEC                   = *wcc386 -D__$(OS)__ -I=$(INCLUDE) -wx -ei -zq -d2 -5r -fpi87 -fp5 -fh=$^*.pch -fo=$^*.obj $[@
MAKEASM                 = ml /nologo /c /Cp /Zi /Fo$^*.obj $[@
MAKELIB                 = *wlib -c -b -q $^@
MAKEBIN                 = bin2obj $[@ $^@
!ifeq OS DOS
LINK                    = *wlink option map,caseexact,quiet,stack=1m debug all system dos4g name $^@
#LINK                    = *wlink option map,caseexact,quiet,stack=1m debug all system dos4g name $^@
!else ifeq OS NT
LINK                    = *wlink option map,caseexact,quiet,stack=1m debug all system nt name $^@
!else
LINK                    = *wlink option caseexact,quiet,stack=1m debug all system nt name $^@
!endif

!else

MAKEC                   = *wcc386 -D__$(OS)__ -I=$(INCLUDE) -wx -ei -zq -oneatx -oh -ob -ol+ -ei -zp8 -5r -fpi87 -fp5 -fh=$^*.pch -fo=$^*.obj $[@
MAKEASM                 = ml /nologo /c /Cp /Fo$^*.obj $[@
MAKELIB                 = *wlib -c -b -s -q $^@
MAKEBIN                 = bin2obj $[@ $^@
!ifeq OS DOS
#LINK                    = *wlink option caseexact,quiet,stack=1m system dos4g name $^@
LINK                    = *wlink option caseexact,quiet,stack=1m system dos4g name $^@
!else ifeq OS NT
LINK                    = *wlink option caseexact,quiet,stack=1m system nt name $^@
!else
LINK                    = *wlink option caseexact,quiet,stack=1m name $^@
!endif

!endif


#!ifdef __LOADDLL__
#!loaddll wcc386 wccd386
#!loaddll wlink wlink
#!loaddll wlib wlibd
#!endif


.c.obj:                 .AUTODEPEND
                        !if not direxist %@PATH[$^@] mkdir /s %@PATH[$^@]
                        echo ` Compiling.: $[@`
                        $(MAKEC)

.asm.obj:               .AUTODEPEND
                        !if not direxist %@PATH[$^@] mkdir /s %@PATH[$^@]
                        $(MAKEASM)

