|
Main / Scons
This is an alternative to make. Written like Python (and in fact, the interpretation tool is Python-based). NotesYou can assign values to variables as arguments at the scons command, i.e. scons toolpath=<path> It saves the arguments you define in options.cache. If you get an error about Source directory cannot be under variant directory. then try re-specifying the arguments, like builddir. Construction VariablesThis page describes how you would set up something like a license server port: https://scons.org/doc/2.0.1/HTML/scons-user.html#sect-execution-environments For example
#construction environment creation, with construction variables
env = Environment(
ENV=os.environ,
tools=["gcc", "gnulink", "as"],
CC= compilerName,
AS= compilerName,
LINK= compilerName,
OBJCOPY= compilerObjCopy,
)
env["ENV"]["RLM_LICENSE"] = "5053@10.21.51.205"
Invoking Shell CommandsUse the Python construct
from subprocess import call
call("pwd")
OR you can use the Command Builder which doesn't require the instantiation of a new builder: Here's an example that works (given a couple previously defined variables):
DOXYGEN_DIR = OUTPUT_DIR.Dir("doxygen")
DOXYFILE_NAME = PROJECT_DIR.File("Doxyfile")
doxyfile_builder = Builder(action = 'doxygen $SOURCE' )
env.Append(BUILDERS = {'Doxygen' : doxyfile_builder})
env.Doxygen(DOXYGEN_DIR, DOXYFILE_NAME)
env.Clean(DOXYGEN_DIR, DOXYGEN_DIR)
|