# 
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This software is dual-licensed to you under the MIT License (MIT) and the Universal Permissive License (UPL).  See the LICENSE file in the root directory for license terms.  You may choose
# either license, or both.
#

#
#  Base configuration options:
#
#     PORT              set default platform port configuration
#     CC_CFG            set default compiler configuration
#     LIB_CFG           set default library configuration
#
#  Targets:
#
#     all               calls 'build' target
#     build             builds sample
#     clean             cleans the build
#

override PORT=windows
CC_CFG?=cl
ifeq ($(shell uname -s),Darwin)
    CC_CFG=gcc-darwin
    LINK_ICONV=true
endif
LIB_CFG?=ts_md_vs_gw

MAKE_DIR=.
include $(MAKE_DIR)/config/paths.cfg

# includes predefined library configuration
include $(LIB_CONFIG)
# includes additional custom sample configurations
include $(SMPL_SHARED_CUSTOM_CONFIG)
include $(SMPL_PORT_CUSTOM_CONFIG)
# includes architecture configuration
include $(COMPILER_CONFIG)
# includes common samples definitions
include $(SAMPLE_COMMON_DEFS)
# includes platform depended targets implementation and definitions
include $(SAMPLE_PORT_IMPL)

.DEFAULT_GOAL := all
.PHONY: all
all: build

.PHONY: build
build: .pre_build .build_impl .post_build

.PHONY: clean
clean: .pre_clean .clean_impl .post_clean
