CC312: Fix Windows build

On windows shell tools return POSIX PATHs which is
not understood by native executables (make and compiler).
This patch converts problematic paths to mixed mode. For
details please see comment at line 44 in Makefile.defs.

On Windows GCC does not find some include files, because
it ignores the ./ include path. (gcc -v returns :
ignoring non existent directory "./".)
Using . instead solves the problem.

Details:
Makefile.defs:
 - Added windows build environment identification.
 - For Cygwin and MSYS PWD and HOST_PROJ_ROOT is converted
   to "mixed" path. (See comment in file.)
 - Working around GCC not finding ./ include path on Windows.

Makefile.rules:
 - Added a new variable to CC312 makefiles to allow passing
   variables from the command line. This is needed to work
   around the make behavior where it stops makefiles
   modifying variables passed on the command line.

.../Makefile:
 - Removed $(shell pwd) calls.

BuildCC312.cmake:
 - Made the build fail on windows only if build has been started
   off a non POSIX environnement.
 - Removed CC312_ENV as passing options to ExternalProject_Add()
   was failing on Windows.
 - Modified ExternalProject starting the cc312 build to not pass
   C flags embedded into CC (the compiler command). This resulted
   in problems when compiler was under Program Files (x86).
 - Fix configuration step commands.
 - Disable log file generation on windows to avoid generating
   command lines longer than 8192 bytes.
 - Use cmake to generate project specific config file to extend
   CFLAGS list and add extra folders to CC312's include path.
 - Some minor clean-up.

Change-Id: Ib6fbe9e9a2046ff75cb9e101a02ad594f9e60573
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
30 files changed