SubDir TOP apps celstart ;

Application celstart : [ Wildcard *.cpp *.h ] ;
CFlags celstart : "-DLIBDIR='\"$(INSTALLDIR.PLUGIN)/\"'" ;
LinkWith celstart : celtool ;
ExternalLibs celstart : CRYSTAL ;

if $(HAVE_STATIC_PLUGINS) = "yes"
{
  SubVariant static ;

  Application celstart_static : [ Wildcard *.cpp *.h ]
        [ Wildcard [ ConcatDirs behaviours ] : *.cpp *.h ]
        [ Wildcard [ ConcatDirs screens ] : *.cpp *.h ] :
     independent noinstall ;
  CFlags celstart_static : [ FDefines CS_STATIC_LINKED ] ;
  MsvcDefine celstart_static : CS_STATIC_LINKED ;
  LinkWith celstart_static : cel_staticplugins celtool ;

  #
  # The plugins that we need
  #
  STATIC.PLUGINLIST =
    bindoc
    bruteblock
    simpleformer
    simpleformerldr
    bugplug
    csbmpimg
    csconin
    csconout
    csddsimg
    csfont
    csgifimg
    csjngimg
    csjpgimg
    csopcode
    csparser
    cspngimg
    cssynldr
    cstgaimg
    dsplex
    dynavis
    emit
    emitldr
    engine
    engseq
    imgplex
    fontplex
    freefnt2
    frustvis
    genmesh
    gl3d
    glshader_arb
    glshader_fixed
    gmeshldr
    gmeshskelanim2
    lghtng
    null2d
    null3d
    nullmesh
    nullmeshldr
    odedynam
    physldr
    particles
    particlesldr
    ptanimimg
    rendloop_loader
    rendstep_std
    reporter
    sequence
    shadermgr
    skeleton
    skelldr
    spr2d
    spr3d
    sprcal3d
    spr3dbin
    spr3dldr
    spr2dldr
    sprcal3dldr
    stdrep
    terrainldr
    thing
    thingldr
    vfs
    xmlread
    xmlshader
    ;

  #
  # The plugins that are nice to have if present
  #
  STATIC.OPTIONALPLUGINLIST =
    cspython
    glshader_cg
    glshader_ps/
    sndmanager
    sndsyssoft
    sndsysloader
    sndsysogg
    sndsyswav
    ;

  if $(TARGET.OS) = "WIN32" { STATIC.PLUGINLIST += glwin32 joywin sndsyswin ; }
  if $(TARGET.OS) = "MACOS_X" { STATIC.PLUGINLIST += glosx2d sndsyscoreaudio ; }
  if $(TARGET.OS) = "UNIX"
  {
    STATIC.PLUGINLIST += glx2d ;
    STATIC.PLUGINLIST += joylin ;
    STATIC.PLUGINLIST += x2d ;
    STATIC.PLUGINLIST += xwin ;
    STATIC.OPTIONALPLUGINLIST += sndsysoss ;
    STATIC.OPTIONALPLUGINLIST += sndsysalsa ;
  }

  LinkStaticPlugins celstart_static : $(STATIC.PLUGINLIST) : $(STATIC.OPTIONALPLUGINLIST)
  : CRYSTAL
  ;

  LinkStaticPlugins celstart_static :
    addon_celentity
    addon_celentitytpl
    addon_questdef
    addon_xmlscripts
    blxml
    celconsole
    cpersist
    mgr_quests
    mgr_billboard
    pfactormove
    pfbillboard
    pfdamage
    pfdefcam
    pfengine
    pfinput
    pfinv
    pflight
    pfmechanics
    pfhover
    pfmesh
    pfmove
    pfmover
    pfportal
    pfquest
    pfsound
    pftest
    pftools
    pftrigger
    pfwheeled
    pfzone
    pfprojectile
    stdphyslayer
    xmlpersist
  : blpython
  ;

  ExternalLibs celstart_static : CRYSTAL CEL ;
  SubVariant ;
}


