Build: refactor BL32 build rules
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 26 Jan 2018 02:42:01 +0000 (11:42 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 1 Feb 2018 11:20:03 +0000 (20:20 +0900)
commit9cd152397d3847370781c00ee8991062e100df03
tree562d407d80443e2ccf63102179678963cefc4d73
parent76d27d24d4a71637a6e7a4a4e87cf9ec1d4c3d61
Build: refactor BL32 build rules

This complicated if-conditional combo was introduced by commit
70d1fc5383b9 ("Fix build error when `BL32` is not defined") in order
to fix the compile error of "make all" when SPD=opteed is given.

The requirement for the build system is like follows:

 - If both BL32 and BL32_SOURCES are defined, the former takes
   precedence.

 - If BL32 is undefined but BL32_SOURCES is defined, we compile
   BL32 from the source files.

 - We want to let the build fail if neither of them is defined,
   but we want to check it only when we are building FIP.

Refactor the code to not call FIP_ADD_IMG twice.  The behavior is
still the same.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile