]> git.donarmstrong.com Git - qmk_firmware.git/blob - build_test.mk
[Keymap] Update Planck Layer Diagram To Match Layer (#6712)
[qmk_firmware.git] / build_test.mk
1 ifndef VERBOSE
2 .SILENT:
3 endif
4
5 .DEFAULT_GOAL := all
6
7 include common.mk
8
9 TARGET=test/$(TEST)
10
11 GTEST_OUTPUT = $(BUILD_DIR)/gtest
12
13 TEST_OBJ = $(BUILD_DIR)/test_obj
14
15 OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)
16
17 GTEST_INC := \
18         $(LIB_PATH)/googletest/googletest/include\
19         $(LIB_PATH)/googletest/googlemock/include\
20         
21 GTEST_INTERNAL_INC :=\
22         $(LIB_PATH)/googletest/googletest\
23         $(LIB_PATH)/googletest/googlemock
24
25 $(GTEST_OUTPUT)_SRC :=\
26         googletest/src/gtest-all.cc\
27         googletest/src/gtest_main.cc\
28         googlemock/src/gmock-all.cc
29
30 $(GTEST_OUTPUT)_DEFS := 
31 $(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
32
33 LDFLAGS += -lstdc++ -lpthread -shared-libgcc
34 CREATE_MAP := no
35
36 VPATH +=\
37         $(LIB_PATH)/googletest\
38         $(LIB_PATH)/googlemock
39
40 all: elf
41
42 VPATH += $(COMMON_VPATH)
43 PLATFORM:=TEST
44
45 ifneq ($(filter $(FULL_TESTS),$(TEST)),)
46 include tests/$(TEST)/rules.mk
47 endif
48
49 include common_features.mk
50 include $(TMK_PATH)/common.mk
51 include $(QUANTUM_PATH)/serial_link/tests/rules.mk
52 ifneq ($(filter $(FULL_TESTS),$(TEST)),)
53 include build_full_test.mk
54 endif
55
56 $(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
57 $(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
58 $(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
59 $(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG)
60
61 include $(TMK_PATH)/native.mk
62 include $(TMK_PATH)/rules.mk
63
64
65 $(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
66 $(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
67