build system: extend src-to-obj for non-.c/.S files

It also creates file names in the build directory and with
the stage sliced in, but keeps the extension for anything
not .c or .S.

Also some handling for non-.c/.S files was adapted to match.

This is inspired by the commit listed below, but rewritten to match
upstream, and split in smaller pieces to keep intent clear.

Change-Id: If8f89a7daffcf51f430b64c3293d2a817ae5120f
Signed-off-by: Patrick Georgi <>
Based-On-Change-Id: I50af7dacf616e0f8ff4c43f4acc679089ad7022b
Based-On-Signed-off-by: Julius Werner <>
Reviewed-by: Aaron Durbin <>
Tested-by: build bot (Jenkins)
6 files changed