Commit 6ae5546c authored by Matthias Braun's avatar Matthias Braun
Browse files

Makefile: Improve unittest rules

The executables are no longer removed when the unittest fails.
parent 62592dcb
......@@ -205,13 +205,18 @@ UNUSED2 := $(shell \
# Unit tests
UNITTESTS_SOURCES = $(subst $(srcdir)/unittests/,,$(wildcard $(srcdir)/unittests/*.c))
UNITTESTS = $(UNITTESTS_SOURCES:%.c=$(builddir)/%.exe)
UNITTESTS_OK = $(UNITTESTS_SOURCES:%.c=$(builddir)/%.ok)
$(builddir)/%.exe: $(srcdir)/unittests/%.c $(libfirm_a)
@echo TEST $<
@echo LINK $<
$(Q)$(LINK) $(CFLAGS) $(CPPFLAGS) $(libfirm_CPPFLAGS) "$<" $(libfirm_a) -lm -o "$@"
$(builddir)/%.ok: $(builddir)/%.exe
@echo EXEC $<
$(Q)$< && touch "$@"
.PHONY: test
test: $(UNITTESTS)
-include $(libfirm_DEPS)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment