Reputation: 11289
I have a library that needs to by built as a dependency for my target. The library is distributed with a Makefile and there's nothing special needed to build it other than to run:
make my_target
How would I run this command as part of my SConstruct file if my file looks something like:
env = Environment()
flags = env.ParseFlags( CCFLAGS + LDFLAGS )
env.MergeFlags( flags )
env.Program( target = 'my_prog', source = SRC )
Upvotes: 4
Views: 2473
Reputation: 992707
Create a Command
builder with the name of the library as the target:
env.Command("other/lib/libother.a", "", "cd other && make my_target")
Be sure to add this library to your Program
line:
env.Program(target="my_prog", source=SRC, LIBS=["other/lib/libother.a"])
Upvotes: 5