]> git.donarmstrong.com Git - qmk_firmware.git/blob - build_test.mk
add GON NerD
[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
44 include $(TMK_PATH)/common.mk
45 include $(QUANTUM_PATH)/serial_link/tests/rules.mk
46
47 $(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
48 $(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
49 $(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
50
51 include $(TMK_PATH)/native.mk
52 include $(TMK_PATH)/rules.mk
53
54
55 $(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
56 $(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
57