Blame Makerules/Maketargets.toplevel

Packit 857059
# BEGIN_ICS_COPYRIGHT8 ****************************************
Packit 857059
# 
Packit 857059
# Copyright (c) 2015, Intel Corporation
Packit 857059
# 
Packit 857059
# Redistribution and use in source and binary forms, with or without
Packit 857059
# modification, are permitted provided that the following conditions are met:
Packit 857059
# 
Packit 857059
#     * Redistributions of source code must retain the above copyright notice,
Packit 857059
#       this list of conditions and the following disclaimer.
Packit 857059
#     * Redistributions in binary form must reproduce the above copyright
Packit 857059
#       notice, this list of conditions and the following disclaimer in the
Packit 857059
#       documentation and/or other materials provided with the distribution.
Packit 857059
#     * Neither the name of Intel Corporation nor the names of its contributors
Packit 857059
#       may be used to endorse or promote products derived from this software
Packit 857059
#       without specific prior written permission.
Packit 857059
# 
Packit 857059
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit 857059
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 857059
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit 857059
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
Packit 857059
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 857059
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Packit 857059
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Packit 857059
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Packit 857059
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 857059
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 857059
# 
Packit 857059
# END_ICS_COPYRIGHT8   ****************************************
Packit 857059
#=============================================================================#
Packit 857059
Packit 857059
# Rules:
Packit 857059
#-----------------------------------------------------------------------------#
Packit 857059
# These rules iterate on all the directories in DIRS
Packit 857059
# if DIRS is "", we ifdef out all these rules
Packit 857059
ifneq "$(strip $(DIRS))" ""
Packit 857059
Packit 857059
Packit 857059
ifneq "$(STOP_ON_ERROR)" "yes"
Packit 857059
TEST_EXIT=
Packit 857059
else
Packit 857059
ERROR_EXIT_STATUS=127
Packit 857059
TEST_EXIT=if test $$? -ne 0; then exit $(ERROR_EXIT_STATUS); fi
Packit 857059
endif
Packit 857059
Packit 857059
# if DIR itself is specified as a target, run install build in it
Packit 857059
$(DIRS):
Packit 857059
	cd $@ && $(MAKE) $(MFLAGS) install
Packit 857059
.PHONY: $(DIRS)
Packit 857059
Packit 857059
# iterate on sub-directories for simple targets
Packit 857059
# for CMDS, STAGE, INSTALL and RUNTEST we can directly invoke them
Packit 857059
# we know an earlier pass (ie. libs) build the dependency files
Packit 857059
Packit 857059
# if CMDS_FIRMWARE_ONLY is yes and make has been invoked in TL_DIR,
Packit 857059
# only do the CMDS phase in the firmware directory. Do nothing if
Packit 857059
# it is set and make has not been invoked in TL_DIR.
Packit 857059
Packit 857059
ifeq "$(CMDS_FIRMWARE_ONLY)" "yes"
Packit 857059
Packit 857059
ifeq "$(CARD_TYPE)" ""
Packit 857059
FIRMWARE_DIR		= Firmware
Packit 857059
else
Packit 857059
FIRMWARE_DIR		= $(PROJ_FILE_DIR)/Firmware
Packit 857059
endif
Packit 857059
Packit 857059
clean clobber cleandepend depend force STAGE INSTALL RUNTEST build_dsfiles clobber_dsfiles lint cflow ::
Packit 857059
	$(VS)for d in $(DIRS) ;\
Packit 857059
	do \
Packit 857059
          echo "cd $$d && $(MAKE) $(MFLAGS) $@";\
Packit 857059
          ( cd $$d && $(MAKE) $(MFLAGS) $@ ); \
Packit 857059
          $(TEST_EXIT) \
Packit 857059
	done
Packit 857059
Packit 857059
CMDS::
Packit 857059
ifeq ($(TL_DIR),$(PWD))
Packit 857059
	echo "cd $(FIRMWARE_DIR) && $(MAKE) $(MFLAGS) cmdsonly";\
Packit 857059
	  ( cd $(FIRMWARE_DIR) && $(MAKE) $(MFLAGS) cmdsonly ); \
Packit 857059
	  $(TEST_EXIT)
Packit 857059
endif
Packit 857059
ifeq ($(TL_DIR)/All_Emb,$(PWD))
Packit 857059
	echo "cd $(TL_DIR)/$(FIRMWARE_DIR) && $(MAKE) $(MFLAGS) cmdsonly";\
Packit 857059
	  ( cd $(TL_DIR)/$(FIRMWARE_DIR) && $(MAKE) $(MFLAGS) cmdsonly ); \
Packit 857059
	  $(TEST_EXIT)
Packit 857059
endif
Packit 857059
Packit 857059
else # CMDS_FIRMWARE_ONLY is not yes
Packit 857059
Packit 857059
clean clobber cleandepend depend force STAGE INSTALL RUNTEST build_dsfiles clobber_dsfiles lint cflow ::
Packit 857059
	$(VS)for d in $(DIRS) ;\
Packit 857059
	do \
Packit 857059
          echo "cd $$d && $(MAKE) $(MFLAGS) $@";\
Packit 857059
          ( cd $$d && $(MAKE) $(MFLAGS) $@ ); \
Packit 857059
          $(TEST_EXIT) \
Packit 857059
	done
Packit 857059
CMDS::
Packit 857059
	$(VS)for d in $(DIRS) ;\
Packit 857059
	do \
Packit 857059
          echo "cd $$d && $(MAKE) $(MFLAGS) cmdsonly";\
Packit 857059
          ( cd $$d && $(MAKE) $(MFLAGS) cmdsonly ); \
Packit 857059
          $(TEST_EXIT) \
Packit 857059
	done
Packit 857059
endif # if CMDS_FIRMWARE_ONLY
Packit 857059
Packit 857059
# special clobber used between BSP builds during weeklybuild
Packit 857059
# only hits directories which are bsp specific, hence speeding up
Packit 857059
# overall weeklybuild performance for multi-bsp products
Packit 857059
clobber_bsp_specific::
Packit 857059
ifneq "$(BSP_SPECIFIC_DIRS)" ""
Packit 857059
	$(VS)for d in $(BSP_SPECIFIC_DIRS) ;\
Packit 857059
		do \
Packit 857059
			echo "cd $$d && $(MAKE) $(MFLAGS) clobber";\
Packit 857059
			( cd $$d && $(MAKE) $(MFLAGS) clobber ); \
Packit 857059
			$(TEST_EXIT) \
Packit 857059
		done 
Packit 857059
endif
Packit 857059
Packit 857059
Packit 857059
# descend the tree while building a DSP file
Packit 857059
# add the directory names to the GROUP and ../ to the Filename
Packit 857059
# so that everything in the DSP can stay as relative pathnames
Packit 857059
dsp_body ::
Packit 857059
	$(VS)for d in $(DIRS) ;\
Packit 857059
	do \
Packit 857059
          echo "cd $$d && $(MAKE) $(MFLAGS) dsp_group" ;\
Packit 857059
          ( cd $$d && $(MAKE) $(MFLAGS) dsp_group DSP_TMP_FILE=../$(DSP_TMP_FILE) \
Packit 857059
                   DSP_GROUP=$(DSP_GROUP)/$$d ); \
Packit 857059
          $(TEST_EXIT) \
Packit 857059
	done
Packit 857059
Packit 857059
# For ALL we must iterate the sub-directories for INCLUDES, LIBS then CMDS
Packit 857059
# we can't simply iterate for ALL/all because of possible cross-dependencies
Packit 857059
# for include files and libraries between directories
Packit 857059
# We use the lowercase targets here so that makedepend can be properly
Packit 857059
# invoked as needed
Packit 857059
ALL :: INCLUDES LIBS CMDS
Packit 857059
#ALL :: LIBS CMDS
Packit 857059
INCLUDES::
Packit 857059
	$(VS)for d in $(DIRS) ;\
Packit 857059
	do \
Packit 857059
          echo "cd $$d && $(MAKE) $(MFLAGS) includes";\
Packit 857059
          ( cd $$d && $(MAKE) $(MFLAGS) includes ); \
Packit 857059
          $(TEST_EXIT) \
Packit 857059
	done
Packit 857059
LIBS ::
Packit 857059
	$(VS)for d in $(DIRS) ;\
Packit 857059
	do \
Packit 857059
          echo "cd $$d && $(MAKE) $(MFLAGS) libsonly";\
Packit 857059
          ( cd $$d && $(MAKE) $(MFLAGS) libsonly ); \
Packit 857059
          $(TEST_EXIT) \
Packit 857059
	done
Packit 857059
endif # DIRS
Packit 857059
Packit 857059
.DELETE_ON_ERROR:
Packit 857059
#=============================================================================#