This allows building (and running) codec_unittest for android.
This explicitly needs to go at the end of the LDFLAGS, since both
this and -lgtest etc. are static libraries, and code in gtest
relies on the STL. Since this explicitly needs to be at the end,
a separate makefile variable is added for it.
The main purpose is to make sure that the build doesn't fail
if the build directory contains the gtest subdirectory, although
the unittests also could be run on a device.
MSVC doesn't export any functions at all by default, contrary to
gcc which exports all global functions by default.
Doing the same for linux/OS X isn't too hard, but they use yet
two other, different syntaxes for the corresponding symbol file.
This is enabled for platforms/compilers that support the -MMD
option, which creates a dependency file named out.d when compiling
to a file named out.o, only including local, not system headers.
The additional -MP option adds phony targets for all included
headers, to avoid having make error out due to "no rule to make
target foo.h" if a header is renamed/removed.
This makes sure that all the right files are rebuilt if a header
is changed, avoiding the need for a full rebuild if only a few
files are affected.
This probably simplifies the default case for most users of the
library, and reduces the risk of people accidentally trying to use
an unoptimized build.
On fresh clone of repo, "make test" used to give,
"make: *** No rule to make target `codec_unittest', needed by `test'. Stop."
because gtest was not available. This message is not very helpful. Instead printing
that gtest is not available and the command to run to obtain gtest.
By setting an overridable variable in the main makefile, we avoid
having to move the default -DUNIX64 into each of the other unix
platform makefiles, but still allowing the mingw platform to
override it.
This makes sure a "make codec_unittest" succeeds without any
prior make invocation. The usage of the encoder libraries in
the unit test was added in 6f58a0c1.
This makes sure that all the dependency libs are built before trying
to link them together, fixing parallel make (which occasionally
failed due to trying to link the encoder or decoder command line
binaries before the libs had been built) and also fixes building an
individual component by e.g. "make h264enc".