#default target
default: all

#includes

include ./make/architecture.mk
include ./make/derivate.mk

include ./make/variables.mk
include ./make/variables_pure.mk
include ./make/variables_$(ARCHITECTURE).mk

include ./make/rules.mk
include ./make/rules_$(ARCHITECTURE).mk

#
# TARGETS
#

all: $(LIB_FILE)

info:
	@echo 
	@echo "--------------"
	@echo "Making EZS-Stubs"
	@echo "-----------------------------------------------"
	@echo "  Compiler = $(CXX) $(CXXFLAGS)"
	@echo "------------"
	@echo "  Linker   = $(LD) $(LDFLAGS) <objects> "
	@echo "-----------------------------------------------"
	@echo 

help:
	@echo 
	@echo "Make targets:"
	@echo "-------------"
	@echo "  help                :      show this help"
	@echo "  all                 :      compile and archive EZ-Stubs library"
	@echo "  copy_back           :      copy configured files back to original place"
	@echo "                             (!! Original source files may be lost !!)"
	@echo "  showtests           :      show all available test programs"
	@echo "  buildtests          :      build all test programms"
	@echo "  <test>.elf          :      compile and link test program"
	@echo "  <test>.clean        :      clean up the testcase"
	@echo "  <test>.sim_exec     :      run test program in the simulator"
	@echo "  <test>.sim_gdb      :      debug test program in the simulator (with gdb)"
	@echo "  <test>.sim_ddd      :      debug test program in the simulator (with ddd)"
	@echo "  <test>.target_exec  :      run test program on the target"
	@echo "  <test>.target_debug :      debug test program on the target"
	@echo "  EXERCISE=aufgabeX   :      copy trunk to tags folder and start tests."
	@echo 
	@echo "  doxygen             :      generate documentation for generated source"
	@echo 

# copy configured files back to original place (!)
copy_back:
	./make/copy_changed_configured_files.sh

abgabe:
	perl ./make/abgabe.pl $(EXERCISE)

.PHONY: help clean info all copy_back default abgabe

