how to run make correctly to get a good build, and otherwise understand the build system
56
62%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.claude/skills/running-make-to-build/SKILL.mdThe build is a recursive make structure, with several projects vendored in to
lib that use their own Makefiles and also one primary src/Makefile.am that
defines most of the build.
make -j $(nproc) to get full parallelism2>&1 | tail -N to limit outputgit add <somefile> && ./make-mks after adding <somefile> to
ensure it is included in the build.make -C <somedir> for any other directorycargo manually, let make run itMakefile or Makefile.in, only ever edit Makefile.amThe main targets are:
all -- the implicit target, builds src/stellar-corecheck -- builds all then runs unit and integration testsclean -- removes build artifactsformat -- auto-formats source code with standard rulesIf anything goes wrong or is confusing in the build, start by running make clean and trying again. You should have configured with --enable-ccache which
means that rebuilding will typically be very cheap. Especially if you run with
make -j $(nproc)
The src/Makefile.am also delegates to cargo to build the rust components
of stellar-core in src/rust as well as all the submodules in src/rust/soroban.
The integration is quite subtle. You should always let src/Makefile.am handle
invoking cargo.
Several source files are generated. All .x files in src/protocol-{curr,next}
are turned into .cpp and .h files by the xdrpp code-generator in lib/xdrpp.
Parts of the XDR query system in src/util/xdrquery are built by flex and
bison.
Files like src/main/StellarCoreVersion.cpp bake the current version
information into a string constant in stellar-core.
And finally the rust bridge src/rust/RustBridge.{cpp,h} is generated by the
cxxbridge tool from src/rust/bridge.rs.
Most of the time you won't need to edit Makefile.am or src/Makefile.am at all.
Files included in the build are driven by the script ./make-mks which
lists files tracked by git and defines makefile variables based on them.
As soon as you add a .cpp or .h file to git and re-run ./make-mks
it will be added to the build.
457f20b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.