forked from daos-stack/raft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DAOS-1310 Build raft using the Makefile target
Currently we build raft by [re]defining it's build recipe in an SConsscript file. This will leave us continually chasing changes upstream makes in how it's built. Instead, we should use the make target supplied by the upstream Makefile. While we are at it, we might as well use the Makefile to build the test_main test tool so that it doesn't have to be done at test run-time. To continue to support our Variant building with scons, add support to the raft Makefile for building into a separate named directory. Add a call to "make clean" when scons -c is run to clean up the build product. Add the ability to disable gcov support in the raft Makefile and disable it during our build from scons.
- Loading branch information
1 parent
19c8593
commit 63d9e07
Showing
2 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
Import('env') | ||
env = env.Clone() | ||
env.AppendUnique(CPPPATH = ['../include']) | ||
env.Library('raft', | ||
['raft_server.c', 'raft_server_properties.c', 'raft_node.c', | ||
'raft_log.c']) | ||
topdir = env.Dir("#").abspath | ||
builddir = env.Dir('.').abspath | ||
libraft = env.Command('libraft.a', '', 'make -C src/rdb/raft/ BUILDDIR=%s GCOV_CCFLAGS= static' % builddir) | ||
test_main = env.Command('tests_main', libraft, 'make -C src/rdb/raft/ BUILDDIR=%s GCOV_CCFLAGS= tests_main' % builddir) | ||
# even though these are AlwaysBuild() they are still inexpensive as the | ||
# make to build them will bail out if they don't actually need rebuilding | ||
AlwaysBuild(libraft) | ||
AlwaysBuild(test_main) | ||
|
||
def CleanAction(env, action): | ||
if env.GetOption('clean'): | ||
env.Execute(action) | ||
|
||
env.AddMethod(CleanAction, 'CleanAction') | ||
|
||
env.CleanAction(Action(['make -C %s/src/rdb/raft/ BUILDDIR=%s clean' % (topdir, builddir)])) |