#
# Copyright (C) 2008-Present 	  Sigma Designs
#
# Name       History
# Ken        Optimized to support the recursive make
# Ken        Supported install/uninstall
#
# 
# Contact Info:
# <ken_zhai@sdesigns.com>
# 
# Sigma Designs
# 1778 McCarthy BLVD
# Milpitas CA 95035, USA
#
#
-include ../../.makefile.in
-include $(TOPDIR)/.config
-include $(TOPDIR)/Makefile.in
BUILD_DIR:=$(BASE_DIR)/toolchain/cs_toolchain
SIGMA_HOST_TOOLS_DIR:=$(BASE_DIR)/host/bin

TARGETS+=cs_toolchain
-include $(BASE_DIR)/makefile.rules

cs_toolchain-clean: cs_toolchain-uninstall
cs_toolchain-dirclean: cs_toolchain-clean
cs_toolchain-install: cs_toolchain

.PHONY: cs_toolchain-uninstall
cs_toolchain-uninstall:
	@#-rm -fr $(HOST_DIR)

$(SIGMA_HOST_TOOLS_DIR)/.installed:
	@[ -d $(@D) ] || mkdir -p $(@D)
	@bash $(BUILD_DIR)/install_cswrapper.bash $(BUILD_DIR) $(SIGMA_HOST_TOOLS_DIR)
	@touch $@

cs_toolchain: $(SIGMA_HOST_TOOLS_DIR)/.installed

