aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index fa94044..b3ad02f 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,8 @@ DOCUMENTATION_DIR := doc
SOURCE_NAMES_LIB := sqlitepp.cpp
SOURCE_NAMES_TEST := sqlitepp_test.cpp
-TARGET_LIB := $(LIBRARY_DIR)/libsqlitepp.so
+TARGET_NAME_LIB := sqlitepp
+TARGET_LIB := $(LIBRARY_DIR)/lib$(TARGET_NAME_LIB).so
SOURCES_LIB := $(foreach source,$(SOURCE_NAMES_LIB),$(SOURCE_DIR)/$(source))
OBJECTS_LIB := $(SOURCES_LIB:$(SOURCE_DIR)/%.cpp=$(OBJECT_DIR)/%.o)
DEPENDS_LIB := $(OBJECTS_LIB:.o=.d)
@@ -28,7 +29,7 @@ DEPENDS := $(DEPENDS_LIB) $(DEPENDS_TEST)
CPPFLAGS += -MMD -MP -I$(INCLUDE_DIR)
CXXFLAGS += -fPIC
LDFLAGS += $(LDFLAGS_SQLITE3)
-LDFLAGS_TEST += -L$(LIBRARY_DIR) -lsqlitepp $(LDFLAGS_GTEST)
+LDFLAGS_TEST += -L$(LIBRARY_DIR) -l$(TARGET_NAME_LIB) $(LDFLAGS_GTEST) -Wl,-rpath,$(LIBRARY_DIR)
ifdef VERBOSE
QUIET :=
@@ -54,10 +55,10 @@ doc: $(INCLUDES)
doxygen
memcheck: $(TARGET_TEST)
- LD_LIBRARY_PATH=$(LIBRARY_DIR) valgrind --tool=memcheck ./$(TARGET_TEST)
+ valgrind --tool=memcheck ./$(TARGET_TEST)
test: $(TARGET_TEST)
- LD_LIBRARY_PATH=$(LIBRARY_DIR) ./$(TARGET_TEST)
+ ./$(TARGET_TEST)
$(TARGET_LIB): $(OBJECTS_LIB)
$(info (CXX) $@)