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 ...@@ -1157,7 +1157,13 @@ endif
clean: clean:
@echo " CLEAN" @echo " CLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_PLAT}) $(call SHELL_REMOVE_DIR,${BUILD_PLAT})
ifdef UNIX_MK
${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean ${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 ${CRTTOOLPATH} clean
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} clean ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} clean
${Q}${MAKE} --no-print-directory -C ${ROMLIBPATH} clean ${Q}${MAKE} --no-print-directory -C ${ROMLIBPATH} clean
...@@ -1166,7 +1172,13 @@ realclean distclean: ...@@ -1166,7 +1172,13 @@ realclean distclean:
@echo " REALCLEAN" @echo " REALCLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_BASE}) $(call SHELL_REMOVE_DIR,${BUILD_BASE})
$(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*) $(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*)
ifdef UNIX_MK
${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean ${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} --no-print-directory -C ${SPTOOLPATH} clean
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} realclean ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} realclean
...@@ -1252,7 +1264,16 @@ fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} ...@@ -1252,7 +1264,16 @@ fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME}
.PHONY: ${FIPTOOL} .PHONY: ${FIPTOOL}
${FIPTOOL}: ${FIPTOOL}:
@${ECHO_BLANK_LINE}
@echo "Building $@"
ifdef UNIX_MK
${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} --no-print-directory -C ${FIPTOOLPATH} ${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} sptool: ${SPTOOL}
.PHONY: ${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 # SPDX-License-Identifier: BSD-3-Clause
# #
...@@ -86,3 +86,5 @@ define MAKE_BUILD_STRINGS ...@@ -86,3 +86,5 @@ define MAKE_BUILD_STRINGS
$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -x c -c - -o $1 $$(CC) $$(TF_CFLAGS) $$(CFLAGS) -x c -c - -o $1
endef 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 # SPDX-License-Identifier: BSD-3-Clause
# #
CC = cl.exe CC = cl.exe
LD = link.exe LD = link.exe
FIPTOOL = fiptool.exe # FIPTOOLPATH and FIPTOOL are passed from the main makefile.
OBJECTS = fiptool.obj tbbr_config.obj win_posix.obj
OBJECTS = $(FIPTOOLPATH)\fiptool.obj \
INC = -I. -I..\..\include\tools_share $(FIPTOOLPATH)\tbbr_config.obj \
CFLAGS = $(CFLAGS) /nologo /Za /Zi /c /O2 /MT $(FIPTOOLPATH)\win_posix.obj
all: $(FIPTOOL) INC = -I$(FIPTOOLPATH) -Iinclude\tools_share
$(FIPTOOL): $(OBJECTS) CFLAGS = $(CFLAGS) /nologo /Za /Zi /c /O2 /MT
$(LD) /INCREMENTAL:NO /debug /nodefaultlib:libc.lib /out:$@ $(LIBS) $**
all: $(FIPTOOL)
.PHONY: clean realclean
$(FIPTOOL): $(OBJECTS)
clean: $(LD) /nologo /INCREMENTAL:NO /debug /nodefaultlib:libc.lib /out:$@ $(LIBS) $**
del /f /q $(OBJECTS) > nul
.PHONY: clean realclean
realclean:
del /f /q $(OBJECTS) $(FIPTOOL) > nul clean:
-@del /f /q $(OBJECTS) > nul
.c.obj: -@del /f /q $(FIPTOOLPATH)\*.pdb > nul
$(CC) -c $(CFLAGS) $(INC) $< -Fo$@
realclean:
-@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