#
# Makefile for simple Tricore test programs
#

# default target 
default : all


# Root directory of CiAO
ROOT_DIR ?= ../../..
include $(ROOT_DIR)/make/standard.mk

APP     := blinkingleds

# Compile and link the test sources
SRC_DIR := $(TESTS_DIR)/native/$(APP)
OUT_DIR := .
MODULES	:= architecture compile gcc 


# Additional g++ Flags
CXXFLAGS += -g


# include modules
ifneq "$(MODULES)" ""
    include $(patsubst %,$(MODULES_DIR)/%.mk,$(MODULES))
endif

MODULES_CLEAN += app
MODULES_ALL   += app

all_app: $(APP).elf

clean_app:
	@find $(OUT_DIR) -name "*.o" -name "*.acc" -name "$(APP).elf" -delete


# process 'all' targets in every MODULE and generate object files
all: $(patsubst %,all_%,$(MODULES_ALL))  
	
# process 'clean' targets in every MODULE and generate object files
clean: $(patsubst %,clean_%,$(MODULES_CLEAN))
	
.PHONY: all clean all_app clean_app
	