tests: automatically build dependencies.

Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
Michael Hope 2015-06-28 17:00:32 +02:00
parent 31f13e3d9c
commit b8a9df2aa4
1 changed files with 7 additions and 1 deletions

View File

@ -31,7 +31,8 @@ COMMON_FLAGS = \
-ggdb3 \ -ggdb3 \
-O0 \ -O0 \
-DUNIT_TEST \ -DUNIT_TEST \
-isystem $(GTEST_DIR)/inc -isystem $(GTEST_DIR)/inc \
-MMD -MP
# Flags passed to the C compiler. # Flags passed to the C compiler.
C_FLAGS = $(COMMON_FLAGS) \ C_FLAGS = $(COMMON_FLAGS) \
@ -130,6 +131,9 @@ LIBCLEANFLIGHT_SRC = \
LIBCLEANFLIGHT_OBJ = $(LIBCLEANFLIGHT_SRC:%.c=$(OBJECT_DIR)/%.o) LIBCLEANFLIGHT_OBJ = $(LIBCLEANFLIGHT_SRC:%.c=$(OBJECT_DIR)/%.o)
DEPS = $(LIBCLEANFLIGHT_OBJ:%.o=%.d) \
$(TEST_BINARIES:%=%.d)
LIBS = $(OBJECT_DIR)/libcleanflight.a $(OBJECT_DIR)/gtest_main.a LIBS = $(OBJECT_DIR)/libcleanflight.a $(OBJECT_DIR)/gtest_main.a
$(OBJECT_DIR)/libcleanflight.a: $(LIBCLEANFLIGHT_OBJ) $(OBJECT_DIR)/libcleanflight.a: $(LIBCLEANFLIGHT_OBJ)
@ -366,3 +370,5 @@ test: $(TESTS:%=test-%)
test-%: $(OBJECT_DIR)/% test-%: $(OBJECT_DIR)/%
$< $<
-include $(DEPS)