##
## Copyright 2016 Intel Corporation.
##
##
## This software and the related documents are Intel copyrighted materials, and your use of them is governed by
## the express license under which they were provided to you ('License'). Unless the License provides otherwise,
## you may not use, modify, copy, publish, distribute, disclose or transmit this software or the related
## documents without Intel's prior written permission.
## This software and the related documents are provided as is, with no express or implied warranties, other than
## those that are expressly stated in the License.
##

#
# Base make configuaration
#
include ../../common/Makefile_base.mk

#
# Define paths for build targets
#
MAKE_IW                 := $(MAKE) -C ./iw
MAKE_COMMON             := $(MAKE) -C ../../common G_USETBB=0 G_CONF_TBB=$(G_CONF)
MAKE_COMMON_TBB         := $(MAKE) -C ../../common
MAKE_RESIZE             := $(MAKE) -C ./examples/iw_resize
MAKE_ADV_TILING_DEMO    := $(MAKE) -C ./examples/iw_advanced_tiling_demo
MAKE_ADV_THREADING      := $(MAKE) -C ./examples/iw_advanced_tiling_benchmark


all: libs examples

prebuilt: examples_prebuilt

libs:
	+$(MAKE_IW)

common:
	+$(MAKE_COMMON)
	+$(MAKE_COMMON_TBB)

examples: libs common
	+$(MAKE_RESIZE)
	+$(MAKE_ADV_TILING_DEMO)
	+$(MAKE_ADV_THREADING)

examples_prebuilt: common
	+$(MAKE_RESIZE)          PREBUILT=1
	+$(MAKE_ADV_TILING_DEMO) PREBUILT=1
	+$(MAKE_ADV_THREADING)   PREBUILT=1

clean:
	+$(MAKE_IW)              clean
	+$(MAKE_COMMON)          clean
	+$(MAKE_COMMON_TBB)      clean
	+$(MAKE_RESIZE)          clean
	+$(MAKE_ADV_TILING_DEMO) clean
	+$(MAKE_ADV_THREADING)   clean
