From: Daniel Carl <danielcarl@gmx.de>
Date: Wed, 27 Jun 2018 22:37:42 +0000 (+0200)
Subject: Use explicit rules to make test targets.
X-Git-Url: https://git.owens.tech/112-editable-focus.html/112-editable-focus.html/git?a=commitdiff_plain;h=2d8967584306c63f162d8c54ff3456b208dfcb6c;p=vimb.git

Use explicit rules to make test targets.
---

diff --git a/tests/Makefile b/tests/Makefile
index 75aed18..25b1169 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -6,9 +6,13 @@ TEST_PROGS = test-util \
 			 test-shortcut
 
 all: $(TEST_PROGS)
-	LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):." gtester --verbose $(TEST_PROGS)
+	$(Q)LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):." gtester --verbose $(TEST_PROGS)
 
 ${TEST_PROGS}: ../$(SRCDIR)/vimb.so
 
+test-%: test-%.c
+	@echo "${CC} $@"
+	$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< ../$(SRCDIR)/vimb.so
+
 clean:
-	$(RM) -f $(TEST_PROGS)
+	$(RM) $(TEST_PROGS)