aboutsummaryrefslogtreecommitdiffstats
path: root/build_test.mk
diff options
context:
space:
mode:
authorGravatar Fred Sundvik <fsundvik@gmail.com>2016-08-22 09:16:08 +0300
committerGravatar Fred Sundvik <fsundvik@gmail.com>2016-08-27 21:57:49 +0300
commit8a9aac6e3237a505682cc7249a8dfff6cb964343 (patch)
treeae1882bcf8e8f9a9f81e792d3ffcb9bd4dfb49f3 /build_test.mk
parent27a673f5cf75747fe73641059aae60e9b53a1c78 (diff)
downloadqmk_firmware-8a9aac6e3237a505682cc7249a8dfff6cb964343.tar.gz
Rules for compiling and linking google test
Diffstat (limited to 'build_test.mk')
-rw-r--r--build_test.mk42
1 files changed, 40 insertions, 2 deletions
diff --git a/build_test.mk b/build_test.mk
index 37ed8b568..dac59a8f4 100644
--- a/build_test.mk
+++ b/build_test.mk
@@ -1,5 +1,43 @@
+ifndef VERBOSE
+.SILENT:
+endif
+
+.DEFAULT_GOAL := all
+
include common.mk
+TARGET=test/$(TEST)
+
+GTEST_OUTPUT = $(BUILD_DIR)/gtest
+
+OUTPUTS := $(GTEST_OUTPUT)
+
+GTEST_INC := \
+ $(LIB_PATH)/googletest/googletest/include\
+ $(LIB_PATH)/googletest/googlemock/include\
+
+GTEST_INTERNAL_INC :=\
+ $(LIB_PATH)/googletest/googletest\
+ $(LIB_PATH)/googletest/googlemock
+
+$(GTEST_OUTPUT)_SRC :=\
+ googletest/src/gtest-all.cc\
+ googletest/src/gtest_main.cc\
+ googlemock/src/gmock-all.cc
+
+$(GTEST_OUTPUT)_DEFS :=
+$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
+
+LDFLAGS += -lstdc++ -lpthread -shared-libgcc
+
+VPATH +=\
+ $(LIB_PATH)/googletest\
+ $(LIB_PATH)/googlemock
+
+all: elf
+
+include $(TMK_PATH)/native.mk
+include $(TMK_PATH)/rules.mk
+
+$(shell mkdir $(BUILD_DIR)/test 2>/dev/null)
-all:
- echo Done $(TEST) \ No newline at end of file