Commit 88a1cf1e authored by Sami Mujawar's avatar Sami Mujawar
Browse files

Update makefile to build fiptool for Windows



Although support for building fiptool on a Windows host was present,
the binary was not built when the top level makefile was invoked.

This patch makes the necessary changes to the to support building of
fiptool on a Windows host PC from the main makefile.

Change-Id: I0c01ba237fa3010a027a1b324201131210cf4d7c
Signed-off-by: default avatarSami Mujawar <sami.mujawar@arm.com>
parent cb5c08b6
......@@ -1157,7 +1157,13 @@ endif
clean:
@echo " CLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_PLAT})
ifdef UNIX_MK
${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
else
# Clear the MAKEFLAGS as we do not want
# to pass the gnumake flags to nmake.
${Q}set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) clean
endif
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} clean
${Q}${MAKE} --no-print-directory -C ${ROMLIBPATH} clean
......@@ -1166,7 +1172,13 @@ realclean distclean:
@echo " REALCLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_BASE})
$(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*)
ifdef UNIX_MK
${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
else
# Clear the MAKEFLAGS as we do not want
# to pass the gnumake flags to nmake.
${Q}set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) realclean
endif
${Q}${MAKE} --no-print-directory -C ${SPTOOLPATH} clean
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} realclean
......@@ -1252,7 +1264,16 @@ fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME}
.PHONY: ${FIPTOOL}
${FIPTOOL}:
@${ECHO_BLANK_LINE}
@echo "Building $@"
ifdef UNIX_MK
${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} --no-print-directory -C ${FIPTOOLPATH}
else
# Clear the MAKEFLAGS as we do not want
# to pass the gnumake flags to nmake.
${Q}set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL))
endif
@${ECHO_BLANK_LINE}
sptool: ${SPTOOL}
.PHONY: ${SPTOOL}
......
#
# Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
......@@ -86,3 +86,5 @@ define MAKE_BUILD_STRINGS
$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -x c -c - -o $1
endef
MSVC_NMAKE := nmake.exe
#
# Copyright (c) 2019, Arm Limited. All rights reserved.
# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
......@@ -7,24 +7,31 @@
CC = cl.exe
LD = link.exe
FIPTOOL = fiptool.exe
OBJECTS = fiptool.obj tbbr_config.obj win_posix.obj
# FIPTOOLPATH and FIPTOOL are passed from the main makefile.
OBJECTS = $(FIPTOOLPATH)\fiptool.obj \
$(FIPTOOLPATH)\tbbr_config.obj \
$(FIPTOOLPATH)\win_posix.obj
INC = -I$(FIPTOOLPATH) -Iinclude\tools_share
INC = -I. -I..\..\include\tools_share
CFLAGS = $(CFLAGS) /nologo /Za /Zi /c /O2 /MT
all: $(FIPTOOL)
$(FIPTOOL): $(OBJECTS)
$(LD) /INCREMENTAL:NO /debug /nodefaultlib:libc.lib /out:$@ $(LIBS) $**
$(LD) /nologo /INCREMENTAL:NO /debug /nodefaultlib:libc.lib /out:$@ $(LIBS) $**
.PHONY: clean realclean
clean:
del /f /q $(OBJECTS) > nul
-@del /f /q $(OBJECTS) > nul
-@del /f /q $(FIPTOOLPATH)\*.pdb > nul
realclean:
del /f /q $(OBJECTS) $(FIPTOOL) > nul
-@del /f /q $(OBJECTS) > nul
-@del /f /q $(FIPTOOLPATH)\*.pdb > nul
-@del /f /q $(FIPTOOL) > nul
.c.obj:
$(CC) -c $(CFLAGS) $(INC) $< -Fo$@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment