#
# sf-graph makefile
# run `wmake all' to get dual os/2-dos executable
#
.ERASE

!ifndef form
form=dos
!endif
!ifeq form os2
vlib=lib $(%WATCOM)\lib386\os2\os2286
!ifdef stub
target=sf-graph.exe
lstub=op stub=sf-grapd.exe
!else
target=sf-grap2.exe
!endif
!else
!ifeq form dos
target=sf-grapd.exe
!else
!error incorrect form
!endif
!endif

.obj: OBJ\$(form)

__MODEL__ = c
!ifdef debug
__COMP_DEB__ = /d2
__LINK_DEB__ = D All
!endif
!ifdef map
__MAPKEY__ = op map
!endif

Compile_Flags =  /m$(__MODEL__)/zmf/zq/zp1/2/onax/s/wx/bt=$(form)$(__COMP_DEB__)

Objs = &
    sf-graph.obj &
    getlng.obj   &
    print.obj    &

$(target) : $(Objs) sf-graph.lnk
    wlink $(__LINK_DEB__) $(__MAPKEY__) name $(target) path obj\$(form) @sf-graph.lnk system $(form) $(lstub) $(vlib)

sf-graph.lnk : makefile
  echo option eliminate,vfr >$@
  echo file { >>$@
  for %i in ($(Objs)) do echo %i >>$@
  echo } >>$@


obj : .SYMBOLIC
    -@mkdir obj     >&nul
    -@mkdir obj\os2 >&nul
    -@mkdir obj\dos >&nul
    -@echo object directories created

all: .SYMBOLIC
 wmake /h obj
 wmake /h form=dos /a
 wmake /h form=os2 stub=dos /a


.cpp.obj :
    wpp $]@ /fo=obj\$(form)\$^. $(Compile_Flags)/xd

.c.obj :
    wcc $]@ /fo=obj\$(form)\$^. $(Compile_Flags)

.asm.obj :
    masm $(__MSM__) $]@, obj\$(form)\$^. ;

SF-GRAPH.obj : sf-graph.h fidomsg.h listdef.hpp SF-GRAPH.CPP
GETLNG.obj : sf-lng.h sf-graph.h fidomsg.h listdef.hpp GETLNG.CPP
PRINT.obj : sf-graph.h fidomsg.h listdef.hpp PRINT.CPP
