This reduces the build time from 69 s to 30 s, reduces the size of
the built wels.lib from 30 MB to 3.9 MB, and reduces the number of
warnings when building wels.lib.
Disambiguate between arm and arm64 sources by checking the directory
names.
The arm assembly sources can be assembled on arm64 and vice versa
without any effect since all of the implementation is hidden behind
the HAVE_NEON and HAVE_NEON_AARCH64 defines, but it still is cleaner
to not build extra empty object files than to build all *.S files
on all arm variants. (The iOS project files build all of the arm
assembly files, regardless of the target architecture, since
individual files can't easily be excluded based on the target
architecture there.)
The architecture handling is now decoupled from the main
platform file. Now you can build for Windows Phone for x86 (for
the emulator) by "make OS=msvc-wp ARCH=x86".
Windows Phone lacks the old CreateThread/beginthreadex APIs for
creating threads. (Technically, the functions still do exist,
but they aren't officially supported and aren't visible in the
headers when targeting Windows Phone.)
Building code that uses the Windows Runtime language extensions
requires building with the -ZW option.
There's no need to return to the original directory at the end of
a script - the current working directory within the subshell that
executes the script doesn't affect the working directory in the
calling shell.
When inside a git repo, attempt to change to the root dir
before running python script. Prevents a bunch of errors
when mktargets.sh is executed from the wrong dir.
This avoids having to update the makefile just to change the SDK
version whenever the iOS SDK is updated (since the previous
version is removed on updates).
Treating warnings as error is useless if no warning is activated.
Several build systems enable -Wall in the CLFAGS, which in combination
with -Werror can trigger undesired build errors.
This requires using the external gas-preprocessor tool that
converts the gnu assembler format sources to armasm format at
build time. This allows keeping the source files in one single
format but only converting while building.
The --prefix parameter differs between yasm and nasm; nasm
requires --prefix _ while yasm requires --prefix=_. Using the
define instead (as on windows) allows easier switching between
the two otherwise mostly compatible assemblers.
This fixes building with yasm on OS X in 32 bit mode. For 64 bit,
a few more tweaks are still required.
This avoids spurious changes to the targets.mk files when mktargets
is rerun on different platforms and different file systems.
In particular, OS X seems to mostly return files sorted
alphabetically, case insensitively, while they are returned in
a file system specific order on linux.
Building with "make OS=android APP_ABI=armeabi" will
produce arm binaries that will conform to the armeabi
ABI - not using any features outside of armv5te by
default (but still optionally using the NEON functions at
runtime if detected - even though such devices should rather
use the default armeabi-v7a build).
In 70360cb11, the ASM variable was moved to the x86-common file
even though the android build file didn't include neither
platform-arch.mk nor platform-x86-common.mk.
Instead of explicitly declaring ASM here, include platform-arch.mk
and remove setting of the flags that platform-arch.mk sets.
This is inspired by and based on a patch by Licai Guo.