+#$(foreach a, $(ALGORITHMS), \
+# $(if $(def $(a)_DIR), \
+# $(eval $(call Assert_Template, \
+# $(a)_DIR, \
+# . \
+# ) \
+# )) \
+#)
+#
+#$(foreach a, $(ALGORITHMS), \
+# $(if $(call seq($(strip($($(a)_DIR))),)), \
+# $(eval $(call Assert_Template, \
+# $(a)_DIR, \
+# . \
+# ) \
+# )) \
+#)
+
+#-------------------------------------------------------------------------------
+#
+### ifeq 'blafoo' ''
+### $(error no source ($(2)) for $(1) in TargetSource_Template)
+### endif
+
+define TargetSource_Template
+$(1): $(2)
+ @echo "[cc]: $(1) <-- $(2)"
+ @mkdir -p $(dir $(1))
+ @$(CC) $(CFLAGS_A) -I./$(strip $(3)) -c -o $(1) $(2)
+endef
+
+$(foreach a, $(ALGORITHMS), \
+ $(foreach b, $($(a)_OBJ), \
+ $(eval $(call TargetSource_Template, \
+ $(BIN_DIR)$(call lc, $(a))/$(b), \
+ $(filter %.S %.c, $(wildcard $($(a)_DIR)$(notdir $(patsubst %.o,%,$(b))).*)), \
+ $($(a)_DIR) \
+ )) \
+ ) \
+)
+
+$(foreach a, $(ALGORITHMS), \
+ $(foreach b, $($(a)_TEST_BIN), \
+ $(eval $(call TargetSource_Template, \
+ $(BIN_DIR)$(call lc, $(a))/$(TEST_DIR)$(b), \
+ $(if $(call sne,$(strip $(filter %.S %.c, $(wildcard $(TESTSRC_DIR)$(notdir $(patsubst %.o,%,$(b))).*))),), \
+ $(filter %.S %.c, $(wildcard $(TESTSRC_DIR)$(notdir $(patsubst %.o,%,$(b))).*)), \
+ $(filter %.S %.c, $(wildcard ./$(notdir $(patsubst %.o,%,$(b))).*))\
+ ), \
+ $($(a)_DIR) \
+ )) \
+ ) \
+)
+#-------------------------------------------------------------------------------
+
+define MainTestElf_Template
+$(1): $(2) $(3)
+ @echo "[ld]: $(1)"
+ @$(CC) $(CFLAGS_A) $(LDFLAGS)$(patsubst %.elf,%.map,$(1)) -o \
+ $(1) \
+ $(2) $(3) \
+ $(LIBS)
+endef
+
+$(foreach a, $(ALGORITHMS), \
+ $(eval $(call MainTestElf_Template, \
+ $(BIN_DIR)$(call lc, $(a))/$(TEST_DIR)main-$(call lc, $(a))-test.elf, \
+ $($(a)_BINOBJ), \
+ $($(a)_TESTBINOBJ) \
+ )) \
+)