# Dogfood... STBuild conf to build SemiTwist D Tools targets
# Expansions:
#   $(TARGET): Target
#   $(MODE):   Mode (ie, "debug" or "release")
#   $(OS):     OS Name
#   $():       Nothing at the moment
# NOTE: If you change this file, you'll need to
#       clean all ("stbuild all all -clean") before compiling again.

target stbuild, _
       echo, seterrorlevel, showargs, ini2urlencode, pwd, _
       cmdSample, _
       cmdparsertest, deferAssertTest, unittests _

# -- Where to find main(): --
# STManage
[stbuild : all]
flags $()src/semitwist/apps/stmanage/$(TARGET)/main.d
# MiniApps
[echo, seterrorlevel, showargs, ini2urlencode, pwd : all]
flags $()src/semitwist/apps/miniapps/$(TARGET)/main.d
# Samples
[cmdSample:all]
flags $()src/semitwist/apps/samples/$(TARGET)/main.d
# Tests
[cmdparsertest, deferAssertTest, unittests : all]
flags $()src/semitwist/apps/tests/$(TARGET)/main.d

# -- xfBuild "reverse module order" fix: --
[cmdSample, stbuild : all]
flags +rmo

# -- unittests --
[unittests : all]
flags -debug=SemiTwistDLib_unittest
[deferAssertTest : all]
flags -debug=deferAssertTest_unittest

# -- Common --
[all:all]
flags -Isrc

# -- Debug --
[all:debug]
flags -ofbin/semitwist-$(TARGET)-$(MODE) _
      -debug -g -C-unittest _
      -C-wi

# -- Release --
[all:release]
flags -ofbin/semitwist-$(TARGET) _
      -release -C-O _
      -C-wi
      
