From: Daniel Carl <danielcarl@gmx.de>
Date: Mon, 9 Jun 2014 13:13:26 +0000 (+0200)
Subject: Don't relink the libvimb before each test.
X-Git-Url: https://git.owens.tech/dummy.html/dummy.html/git?a=commitdiff_plain;h=8ea85ae8db6ecd494cc0530948ff9cad209c864c;p=vimb.git

Don't relink the libvimb before each test.
---

diff --git a/Makefile b/Makefile
index ff2cdc5..b8dcf74 100644
--- a/Makefile
+++ b/Makefile
@@ -29,9 +29,10 @@ uninstall:
 
 clean: test-clean
 	$(RM) src/*.o src/*.do src/*.lo src/hints.js.h
-	$(RM) tests/$(LIBTARGET) $(TARGET) $(DTARGET)
+	$(RM) $(TARGET) $(DTARGET)
 
 test-clean:
+	$(RM) $(LIBTARGET)
 	@$(MAKE) $(MFLAGS) -C tests clean
 
 dist: dist-clean
@@ -62,8 +63,8 @@ $(DTARGET): $(DOBJ)
 	@$(CC) $(DOBJ) -o $@ $(DLDFLAGS)
 
 $(LIBTARGET): $(LOBJ)
-	@echo "$(CC) tests/$@"
-	@$(CC) -shared ${LOBJ} -o ./tests/$(LIBTARGET) $(LDFLAGS)
+	@echo "$(CC) $@"
+	@$(CC) -shared ${LOBJ} -o $@ $(LDFLAGS)
 
 src/config.h:
 	@echo create $@ from src/config.def.h
@@ -81,4 +82,4 @@ src/config.h:
 	@echo "${CC} $@"
 	@$(CC) -DTESTLIB $(DFLAGS) -fPIC -c -o $@ $<
 
-.PHONY: clean debug all install uninstall options dist test
+.PHONY: clean debug all install uninstall options dist dist-clean test test-clean
diff --git a/config.mk b/config.mk
index d0eeb4d..4f7b656 100644
--- a/config.mk
+++ b/config.mk
@@ -60,7 +60,7 @@ DEPS      = $(OBJ:%.o=%.d)
 
 TARGET    = $(PROJECT)
 DTARGET   = $(TARGET)_dbg
-LIBTARGET = lib$(PROJECT).so
+LIBTARGET = tests/lib$(PROJECT).so
 DIST_FILE = $(PROJECT)_$(VERSION).tar.gz
 MANDIR1   = $(MANDIR)/man1
 MAN1      = $(PROJECT).1
diff --git a/tests/Makefile b/tests/Makefile
index abe6b5b..9998f1a 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -11,7 +11,7 @@ TEST_PROGS = test-handlers \
 all: $(TEST_PROGS)
 	LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):." gtester --verbose $(TEST_PROGS)
 
-${TEST_PROGS}: $(LIBTARGET)
+${TEST_PROGS}: $(notdir $(LIBTARGET))
 
 clean:
 	rm -f $(TEST_PROGS)