#
# to build complete set of libraries issue command:
# wmake os=all
#

.ERASE

O_Opsys = gvidseg.obj slice.obj osdetect.obj osdata.obj
O_Vioimage = videf.obj viinit.obj viterm.obj visave.obj virest.obj
O_Vidmgr = vmdata.obj _stattr.obj _prf.obj _prfc.obj _prfb.obj _xprf.obj    &
           _xprfc.obj _xprfb.obj _pcs.obj _pcl.obj _pcb.obj _ps.obj _pl.obj &
           _peol.obj _clss.obj _cll.obj _clel.obj _flls.obj _flll.obj       &
           _fllel.obj _cscr.obj _clrel.obj _vln.obj _frm.obj
O_Vmgr =   vinit.obj vdone.obj vgetinf.obj vgetsw.obj vgetsh.obj vgetss.obj &
           vwhx.obj vwhy.obj vgotoxy.obj vkbhit.obj vgetch.obj vgetchxy.obj &
           vgetaxy.obj vxgetcxy.obj vsetcst.obj vputch.obj vputs.obj        &
           vxputch.obj vxputs.obj vputa.obj vpcb.obj vpb.obj vclb.obj       &
           vfillb.obj vgettx.obj vputtx.obj vhline.obj

O_Dos  =   vscrptr.obj viscolor.obj vgetsmod.obj vsetsmod.obj vsetcurs.obj  &
           vgetcurs.obj

Objs = $(O_Opsys) $(O_Vidmgr) $(O_Vioimage) $(O_Vmgr)
CFLAGS=/onatx/zp1/zq/wx/we/s

CPU = 386
!ifeq os os2
!ifndef model
model = f
!endif
OsSrc = vmgros2
!ifeq model f
CFLAGS +=/5$(call)/bt=OS2
Target = $(model)$(call)
!else
CFLAGS +=/bt=OS2
Target = $(model)
CPU =
!endif
!else
!ifeq os 386
model = f
OsSrc = vmgrdos
O_Vmgr += $(O_Dos)
CFLAGS +=/5$(call)/bt=DOS
Target = $(model)$(call)
!else     
!ifeq os ergo
model = f
OsSrc = vmgrdos
O_Vmgr += $(O_Dos)
CFLAGS +=/5$(call)/bt=DOS/d__PHARLAP__
Target = $(call)
!else     
!ifeq os dos
OsSrc = vmgrdos
O_Vmgr += $(O_Dos)
CFLAGS +=/2/bt=DOS
Target = $(model)
call =
CPU =
!else
!ifeq os wnt
OsSrc = vmgrwnt
O_Vmgr = $(OsSrc).obj
CFLAGS +=/5$(call)/bt=NT/zm
model = f
Target = $(call)
!else
!ifeq os clean
foo: .SYMBOLIC
 @wmake /h nocheck=1 clean

OsSrc=Undef
!else
!ifeq os all
foo: .SYMBOLIC
 wmake /h nocheck=1 all

OsSrc=Undef
!else
!ifndef nocheck
!error Should specify os macro
!else
OsSrc=Undef
!endif
!endif
!endif
!endif
!endif
!endif
!endif
!endif

!ifeq CPU 386
CFLAGS+=/of+/en
!endif

vid$(os)$(Target).lib: $(Objs)
 dir /b *.obj>vidmgr.lst
 wlib /t/b/n $@ @vidmgr.lst

$(O_Opsys): Opsys.c
 wcc$(CPU) $(CFLAGS)/m$(model)/fo=$* /nm=$*/d$* $<

$(O_Vidmgr): Vidmgr.c
 wcc$(CPU) $(CFLAGS)/m$(model)/fo=$* /nm=$*/d$* $<

$(O_Vioimage): Vioimage.c
 wcc$(CPU) $(CFLAGS)/m$(model)/fo=$* /nm=$*/d$* $<

$(O_Vmgr): $(OsSrc).c
 wcc$(CPU) $(CFLAGS)/m$(model)/fo=$* /nm=$*/d$* $<

clean: .SYMBOLIC
 -del *.obj
 -del vidmgr.lst

all: .SYMBOLIC
 -del vid*.lib
 @wmake /h nocheck=1 clean
 wmake /h os=wnt call=r
 @wmake /h nocheck=1 clean
 wmake /h os=os2 call=r
 @wmake /h nocheck=1 clean
 wmake /h os=os2 model=s
 @wmake /h nocheck=1 clean
 wmake /h os=os2 model=c
 @wmake /h nocheck=1 clean
 wmake /h os=os2 model=m
 @wmake /h nocheck=1 clean
 wmake /h os=os2 model=l
 @wmake /h nocheck=1 clean
 wmake /h os=386 call=r
 @wmake /h nocheck=1 clean
 wmake /h os=ergo call=r
 @wmake /h nocheck=1 clean
 wmake /h os=dos model=c
 @wmake /h nocheck=1 clean
 wmake /h os=dos model=s
 @wmake /h nocheck=1 clean
 wmake /h os=dos model=l
 @wmake /h nocheck=1 clean
 wmake /h os=dos model=m
 @wmake /h nocheck=1 clean
 wmake /h os=dos model=h
 @wmake /h nocheck=1 clean

