SubDir TOP apps bootstrap ;

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

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

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

  #
  # The plugins that we need
  #
  STATIC.PLUGINLIST =
    bindoc
    bruteblock
    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
    nullmesh
    nullmeshldr
    odedynam
    particles
    particlesldr
    ptanimimg
    rendloop_loader
    rendstep_std
    reporter
    sequence
    shadermgr
    skeleton
    skelldr
    spr2d
    spr3d
    spr3dbin
    spr3dldr
    stdrep
    terrainldr
    thing
    thingldr
    vfs
    xmlread
    xmlshader
    ;

  #
  # The plugins that are nice to have if present
  #
  STATIC.OPTIONALPLUGINLIST =
    cspython
    glshader_cg
    glshader_ps1
    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 bootstrap_static : $(STATIC.PLUGINLIST) : $(STATIC.OPTIONALPLUGINLIST)
  : CRYSTAL
  ;

  LinkStaticPlugins bootstrap_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
    pfmesh
    pfmove
    pfmover
    pfportal
    pfquest
    pfsound
    pftest
    pftools
    pftrigger
    pfwheeled
    pfzone
    pfprojectile
    stdphyslayer
    xmlpersist
  : blpython
  ;

  ExternalLibs bootstrap_static : CRYSTAL CEL ;
  SubVariant ;
}


