# This program was created by AXELL CORPORATION.
# Copyright (C) 2015 AXELL CORPORATION, all rights reserved.

# Build path definition
#-------------------------------------------------------------------------------
BUILD_ROOT			=	$(shell pwd)
BUILD_PATH			=	$(BUILD_ROOT)/build
LIB_PATH			=	$(BUILD_ROOT)/lib
INC_PATH			=	$(BUILD_ROOT)/include
OS_PATH				=	$(BUILD_ROOT)/os

ifeq ($(EXEGCC), ON)
PLATFORM			=	iTRON/uC3_exeGCC
else
PLATFORM			=	iTRON/uC3
endif

export BUILD_ROOT
export BUILD_PATH
export LIB_PATH
export INC_PATH
export OS_PATH
export PLATFORM

# To build and follow the hierarchy
#-------------------------------------------------------------------------------
MAKE_DIRS			=	src

.PHONY: all sample clean allclean depend

all:
	@for subdir in $(MAKE_DIRS) ; do \
		$(MAKE) -C $$subdir ; \
	done

sample:
	$(MAKE) -C sample

clean:
	@for subdir in $(MAKE_DIRS) ; do \
		$(MAKE) -C $$subdir clean ; \
	done

allclean: clean
	$(MAKE) -C sample clean

depend:
	@for subdir in $(MAKE_DIRS) ; do \
		$(MAKE) -C $$subdir depend ; \
	done
