Have one list of source files, instead of a bunch of separate
architecture-specific lists that need to be combined together. This
will simplify the work on pregenerating assembly language sources.
Previously build.rs was relying on gcc.rs to output the link metadata
to link ring-core and ring-test. But, if only one of the libraries
changed, then we won't run gcc.rs on the one that didn't change, and
the linker metadata for that unchanged library wouldn't be output,
causing linking to fail due to missing symbols. Fix that by having
build.rs output the linker metadata itself.
Treat a missing source file as an error, whereas before we were
treating it as indicating that the target needs to be rebuilt. Because
we do dependency checking bottom-up, not top-down, the source file
always exists. If it doesn't, then that's an error. In particular, it
probably means that build.rs lists some source files that have been
removed. (See the previous commit.)
Also, the original purpose of this commit is to memoize the
modification time of the most recently modified include file, instead
of `stat()`ing each include file over and over again for each source
file. So do that too.
Finally, in the name of simplicity, don't bother tracking test vs.
non-test includes separately. It's rare when any include file changes,
and we don't save much by separating things, so K.I.S.S. to reduce the
chance that things get screwed up.
These entries would cause recompilation to recompile all the C code,
since an error retrieving the files' metadata would trigger a rebuild
of every file. (See the next commit.)
This is a step towards dropping the use of MSBuild on Windows. It also
should allow *ring* to build correctly on BSDs and other platforms that
weren't explicitly mentioned.
target_build_utils has too many dependencies, which slows down the
initial download/build. It also seems mostly unnecessary since Cargo
now passes the target info in the environment.
- build.rs
* Default to `gmake` on BSD systems
* Support `MAKE` variable for pointing to correct `make`
- mk/top_of_makefile.mk
* Allow target triple on BSD* not to have abi (e.g. x86_64-unknown-freebsd)
- BUILDING.md
* Add descriptions about `MAKE` variable.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
Cargo/rustc wasn't resolving "pregenerated" to an absolute path, so
while the previous scheme for finding the pregenerated libraries worked
for "sh mk/package.sh", it didn't work when building other libraries,
when the current working directory isn't the *ring* source directory.