# Makefile - makefile for target/src/debug/tcfagent
#
# Copyright (c) 2011,2016 Wind River Systems, Inc.
#
# The right to copy, distribute, modify or otherwise make use of this software
# may be licensed only pursuant to the terms of an applicable Wind River
# license agreement.
#
#
# modification history
# --------------------
# 01d,07nov16.jmp  Fixed mips and solaris build.
# 01c,18oct16,jmp  Added support for Workbench 4 TCF Agent.
# 01b,22feb11,rlp  Added a rule for precomp
# 01a,14feb11,rlp  written.
#
# DESCRIPTION
# This is the top level Makefile for building the TCF Agent component during
# GPP builds.
#
# Note that this file is a temporary work-waround and will be obsoleted when
# GPP build infratstructure is fixed to build components outside $TGT_DIR,
# for example components in $WIND_HOME/components.
#

TGT_DIR = $(WIND_BASE)/target

include $(TGT_DIR)/h/make/defs.library
ifneq ($(VX_CPU_FAMILY),$(filter $(VX_CPU_FAMILY),mips simso))
ifeq ($(COMP_TCF_AGENT),tcf_agent-1.4)
TCF_AGENT_COMP_SRC=$(WRVX_COMPBASE)/$(COMP_TCF_AGENT)/agent/src
HOSTFS_SRC=$(WRVX_COMPBASE)/$(COMP_TCF_AGENT)/agent/hostfs/src
ADDITIONAL_FLAGS="TGT_DIR=$(TGT_DIR)"
else
TCF_AGENT_COMP_SRC=$(WRVX_COMPBASE)/$(COMP_TCF_AGENT)
ADDITIONAL_FLAGS=
endif

ifneq ($(wildcard $(WRVX_COMPBASE)/$(COMP_TCF_AGENT)/Makefile),)

default:
	$(MAKE) -C $(TCF_AGENT_COMP_SRC) TOOL=$(_WRS_CONFIG_APP_TOOL) _VSB_CONFIG_ADDEDCFLAGS=$(__VSB_ADDEDCFLAGSAPP) CPU=$(CPU) VSB_DIR=$(VSB_DIR) OPT=$(OPT) $(ADDITIONAL_FLAGS)
	$(MAKE) -C $(HOSTFS_SRC)         TOOL=$(_WRS_CONFIG_APP_TOOL) _VSB_CONFIG_ADDEDCFLAGS=$(__VSB_ADDEDCFLAGSAPP) CPU=$(CPU) VSB_DIR=$(VSB_DIR) OPT=$(OPT) $(ADDITIONAL_FLAGS)

clean:
	$(MAKE) -C $(TCF_AGENT_COMP_SRC) TOOL=$(_WRS_CONFIG_APP_TOOL) _VSB_CONFIG_ADDEDCFLAGS=$(__VSB_ADDEDCFLAGSAPP) CPU=$(CPU) VSB_DIR=$(VSB_DIR) OPT=$(OPT) $(ADDITIONAL_FLAGS) clean
	$(MAKE) -C $(HOSTFS_SRC)         TOOL=$(_WRS_CONFIG_APP_TOOL) _VSB_CONFIG_ADDEDCFLAGS=$(__VSB_ADDEDCFLAGSAPP) CPU=$(CPU) VSB_DIR=$(VSB_DIR) OPT=$(OPT) $(ADDITIONAL_FLAGS) clean

rclean:
	$(MAKE) -C $(TCF_AGENT_COMP_SRC) TOOL=$(_WRS_CONFIG_APP_TOOL) _VSB_CONFIG_ADDEDCFLAGS=$(__VSB_ADDEDCFLAGSAPP) CPU=$(CPU) VSB_DIR=$(VSB_DIR) OPT=$(OPT) $(ADDITIONAL_FLAGS) rclean
	$(MAKE) -C $(HOSTFS_SRC)         TOOL=$(_WRS_CONFIG_APP_TOOL) _VSB_CONFIG_ADDEDCFLAGS=$(__VSB_ADDEDCFLAGSAPP) CPU=$(CPU) VSB_DIR=$(VSB_DIR) OPT=$(OPT) $(ADDITIONAL_FLAGS) rclean

man:
	$(MAKE) -C $(TCF_AGENT_COMP_SRC) TOOL=$(_WRS_CONFIG_APP_TOOL) _VSB_CONFIG_ADDEDCFLAGS=$(__VSB_ADDEDCFLAGSAPP) CPU=$(CPU) VSB_DIR=$(VSB_DIR) OPT=$(OPT) $(ADDITIONAL_FLAGS) man

synopsis:
	$(MAKE) -C $(TCF_AGENT_COMP_SRC) TOOL=$(_WRS_CONFIG_APP_TOOL) _VSB_CONFIG_ADDEDCFLAGS=$(__VSB_ADDEDCFLAGSAPP) CPU=$(CPU) VSB_DIR=$(VSB_DIR) OPT=$(OPT) $(ADDITIONAL_FLAGS) synopsis


release: default
else
# the tcf_agent component is not present - nothing to do
default:

clean:

rclean:

release:

endif
endif

# rules that do nothing for tcf_agent
precomp:

% :
	@echo nothing to be done for target $@
