aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 3cac760..3501abd 100644
--- a/Makefile
+++ b/Makefile
@@ -9,16 +9,18 @@ DOCUMENTATION_DIR := doc
SOURCE_NAMES_LIB := sqlitepp.cpp
SOURCE_NAMES_TEST := sqlitepp_test.cpp
-TARGETS := $(LIBRARY_DIR)/libsqlitepp.so $(BINARY_DIR)/sqlitepp_test
+TARGET_LIB := $(LIBRARY_DIR)/libsqlitepp.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)
+TARGET_TEST := $(BINARY_DIR)/sqlitepp_test
SOURCES_TEST := $(foreach source,$(SOURCE_NAMES_TEST),$(SOURCE_DIR)/$(source))
OBJECTS_TEST := $(SOURCES_TEST:$(SOURCE_DIR)/%.cpp=$(OBJECT_DIR)/%.o)
DEPENDS_TEST := $(OBJECTS_TEST:.o=.d)
+TARGETS := $(TARGET_LIB) $(TARGET_TEST)
INCLUDES := $(INCLUDE_DIR)/sqlitepp/sqlitepp.h
OBJECTS := $(OBJECTS_LIB) $(OBJECTS_TEST)
DEPENDS := $(DEPENDS_LIB) $(DEPENDS_TEST)
@@ -51,15 +53,15 @@ clean:
doc: $(INCLUDES)
doxygen
-$(LIBRARY_DIR)/libsqlitepp.so: $(OBJECTS_LIB)
+$(TARGET_LIB): $(OBJECTS_LIB)
$(info (CXX) $@)
$(QUIET)mkdir -p $(LIBRARY_DIR)
$(QUIET)$(CXX) -shared $(LDFLAGS) $(LDFLAGS_LIB) -o $@ $^
-$(BINARY_DIR)/sqlitepp_test: $(OBJECTS_TEST)
+$(TARGET_TEST): $(OBJECTS_TEST) $(TARGET_LIB)
$(info (CXX) $@)
$(QUIET)mkdir -p $(BINARY_DIR)
- $(QUIET)$(CXX) $(LDFLAGS) $(LDFLAGS_TEST) $< -o $@
+ $(QUIET)$(CXX) $(LDFLAGS) $(LDFLAGS_TEST) $(OBJECTS_TEST) -o $@
$(OBJECTS): $(OBJECT_DIR)/%.o: $(SOURCE_DIR)/%.cpp
$(info (CXX) $@)