]> git.ipfire.org Git - thirdparty/zstd.git/commit
%.o objects files in /tests
authorYann Collet <cyan@fb.com>
Wed, 27 Dec 2017 16:49:18 +0000 (17:49 +0100)
committerYann Collet <cyan@fb.com>
Wed, 27 Dec 2017 16:58:27 +0000 (17:58 +0100)
commit2126ca8a5f3a4cb2a19c5b2923f4f9bb7f41f630
treebcc52fbf26408d78d13c1db23d836175b1d251f4
parent88798028660dd233e8a9c179028e42daf2efe68b
%.o objects files in /tests

Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.

This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.

It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.

It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.

I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.

For targets requiring some different setting, build from source *.c remain the rule.

The new rules have been tested within `-j` parallel compilation, and work fine with it.
tests/Makefile
tests/namespaceTest.c [deleted file]