Merge pull request #926 from EvanLloyd/win_make_4
authordavidcunado-arm <david.cunado@arm.com>
Mon, 8 May 2017 22:32:52 +0000 (23:32 +0100)
committerGitHub <noreply@github.com>
Mon, 8 May 2017 22:32:52 +0000 (23:32 +0100)
Minor makefile fixes

1  2 
Makefile
make_helpers/build_macros.mk
make_helpers/unix.mk
make_helpers/windows.mk

diff --combined Makefile
index b59d785c01dcf387fd6d5c9f7b52e0d565f43eda,984fbdae36041c7856b7c7a55a3d50c067a2d2ba..b644b20186970c74adeee06bcae56ac143cabc0b
+++ b/Makefile
@@@ -1,7 -1,31 +1,7 @@@
  #
  # Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
  #
 -# Redistribution and use in source and binary forms, with or without
 -# modification, are permitted provided that the following conditions are met:
 -#
 -# Redistributions of source code must retain the above copyright notice, this
 -# list of conditions and the following disclaimer.
 -#
 -# Redistributions in binary form must reproduce the above copyright notice,
 -# this list of conditions and the following disclaimer in the documentation
 -# and/or other materials provided with the distribution.
 -#
 -# Neither the name of ARM nor the names of its contributors may be used
 -# to endorse or promote products derived from this software without specific
 -# prior written permission.
 -#
 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 -# POSSIBILITY OF SUCH DAMAGE.
 +# SPDX-License-Identifier: BSD-3-Clause
  #
  
  #
@@@ -629,18 -653,18 +629,18 @@@ ${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} 
  ifneq (${GENERATE_COT},0)
  fwu_certificates: ${FWU_CRT_DEPS} ${CRTTOOL}
        ${Q}${CRTTOOL} ${FWU_CRT_ARGS}
-       @echo
+       @${ECHO_BLANK_LINE}
        @echo "Built $@ successfully"
        @echo "FWU certificates can be found in ${BUILD_PLAT}"
-       @echo
+       @${ECHO_BLANK_LINE}
  endif
  
  ${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL}
        ${Q}${FIPTOOL} create ${FWU_FIP_ARGS} $@
        ${Q}${FIPTOOL} info $@
-       @echo
+       @${ECHO_BLANK_LINE}
        @echo "Built $@ successfully"
-       @echo
+       @${ECHO_BLANK_LINE}
  
  fiptool: ${FIPTOOL}
  fip: ${BUILD_PLAT}/${FIP_NAME}
index 2d23ef8b1d84b6a27a8d43f22bce1ba18803b6ea,2cdbfa30029f37e5be9b4724344337b5b0f5bf00..36f220e08c965c1e7bce2f32678c4f99ff063581
@@@ -1,7 -1,31 +1,7 @@@
  #
  # Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
  #
 -# Redistribution and use in source and binary forms, with or without
 -# modification, are permitted provided that the following conditions are met:
 -#
 -# Redistributions of source code must retain the above copyright notice, this
 -# list of conditions and the following disclaimer.
 -#
 -# Redistributions in binary form must reproduce the above copyright notice,
 -# this list of conditions and the following disclaimer in the documentation
 -# and/or other materials provided with the distribution.
 -#
 -# Neither the name of ARM nor the names of its contributors may be used
 -# to endorse or promote products derived from this software without specific
 -# prior written permission.
 -#
 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 -# POSSIBILITY OF SUCH DAMAGE.
 +# SPDX-License-Identifier: BSD-3-Clause
  #
  
  # Report an error if the eval make function is not available.
@@@ -284,14 -308,16 +284,16 @@@ define MAKE_B
          $(eval BL_LINKERFILE := $(BL$(call uppercase,$(1))_LINKERFILE))
          # We use sort only to get a list of unique object directory names.
          # ordering is not relevant but sort removes duplicates.
-         $(eval TEMP_OBJ_DIRS := $(sort $(BUILD_DIR)/ $(dir ${OBJS} ${LINKERFILE})))
+         $(eval TEMP_OBJ_DIRS := $(sort $(dir ${OBJS} ${LINKERFILE})))
          # The $(dir ) function leaves a trailing / on the directory names
          # Rip off the / to match directory names with make rule targets.
          $(eval OBJ_DIRS   := $(patsubst %/,%,$(TEMP_OBJ_DIRS)))
  
  # Create generators for object directory structure
  
- $(eval $(foreach objd,${OBJ_DIRS},$(call MAKE_PREREQ_DIR,${objd},)))
+ $(eval $(call MAKE_PREREQ_DIR,${BUILD_DIR},))
+ $(eval $(foreach objd,${OBJ_DIRS},$(call MAKE_PREREQ_DIR,${objd},${BUILD_DIR})))
  
  .PHONY : bl${1}_dirs
  
@@@ -321,9 -347,9 +323,9 @@@ $(DUMP): $(ELF
  $(BIN): $(ELF)
        @echo "  BIN     $$@"
        $$(Q)$$(OC) -O binary $$< $$@
-       @echo
+       @${ECHO_BLANK_LINE}
        @echo "Built $$@ successfully"
-       @echo
+       @${ECHO_BLANK_LINE}
  
  .PHONY: bl$(1)
  bl$(1): $(BIN) $(DUMP)
diff --combined make_helpers/unix.mk
index 61b1368b2d4d44dd580d4e823f1aa6e9086c9ec2,6f7020080dd7f0fa8789cb631256fabfabd84135..17f8a7c279c7a6eed1401fb975ad84e7605e08bc
@@@ -1,7 -1,31 +1,7 @@@
  #
- # Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
+ # Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
  #
 -# Redistribution and use in source and binary forms, with or without
 -# modification, are permitted provided that the following conditions are met:
 -#
 -# Redistributions of source code must retain the above copyright notice, this
 -# list of conditions and the following disclaimer.
 -#
 -# Redistributions in binary form must reproduce the above copyright notice,
 -# this list of conditions and the following disclaimer in the documentation
 -# and/or other materials provided with the distribution.
 -#
 -# Neither the name of ARM nor the names of its contributors may be used
 -# to endorse or promote products derived from this software without specific
 -# prior written permission.
 -#
 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 -# POSSIBILITY OF SUCH DAMAGE.
 +# SPDX-License-Identifier: BSD-3-Clause
  #
  #
  
@@@ -43,11 -67,14 +43,14 @@@ ifndef UNIX_M
  
      # ${1} is the directory to be generated.
      # ${2} is optional, and allows a prerequisite to be specified.
+     # Do nothing if $1 == $2, to ignore self dependencies.
      define MAKE_PREREQ_DIR
+         ifneq (${1},${2})
  
  ${1} : ${2}
        ${Q}mkdir -p  "${1}"
  
+         endif
      endef
  
      define SHELL_REMOVE_DIR
diff --combined make_helpers/windows.mk
index f6e8d55bdb5e19dc272f4c8ca148b1901ba3a189,5138d1b9ca2ac9211359c11a124b8d61baa49047..69f6a017158c90e04337dcbc0932a23662760d2b
@@@ -1,7 -1,31 +1,7 @@@
  #
- # Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
+ # Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
  #
 -# Redistribution and use in source and binary forms, with or without
 -# modification, are permitted provided that the following conditions are met:
 -#
 -# Redistributions of source code must retain the above copyright notice, this
 -# list of conditions and the following disclaimer.
 -#
 -# Redistributions in binary form must reproduce the above copyright notice,
 -# this list of conditions and the following disclaimer in the documentation
 -# and/or other materials provided with the distribution.
 -#
 -# Neither the name of ARM nor the names of its contributors may be used
 -# to endorse or promote products derived from this software without specific
 -# prior written permission.
 -#
 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 -# POSSIBILITY OF SUCH DAMAGE.
 +# SPDX-License-Identifier: BSD-3-Clause
  #
  #
  
@@@ -51,12 -75,15 +51,15 @@@ ifndef WINDOWS_M
  
      # ${1} is the directory to be generated.
      # ${2} is optional, and allows prerequisites to be specified.
+     # Do nothing if $1 == $2, to ignore self dependencies.
      define MAKE_PREREQ_DIR
+         ifneq (${1},${2})
  
  ${1} : ${2}
        $(eval tmp_dir:=$(subst /,\,${1}))
        -@if not exist "$(tmp_dir)"  mkdir "${tmp_dir}"
  
+         endif
      endef
  
      # ${1} is the directory to be removed.