Blame Makerules/Maketargets.toplevel

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