summaryrefslogtreecommitdiffstats
path: root/tmk_core/rules.mk
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-07-31 12:24:25 +0200
committerFred Sundvik <fsundvik@gmail.com>2016-07-31 12:24:25 +0200
commitf11a0275a8e11a9e8393d8d64b45b62a1a018512 (patch)
tree13110197000c868440fbbb0b61b8329e48a4e886 /tmk_core/rules.mk
parent79067662c8c71129a84a41b0147edc63b33db709 (diff)
downloadqmk_firmware-f11a0275a8e11a9e8393d8d64b45b62a1a018512.tar.gz
qmk_firmware-f11a0275a8e11a9e8393d8d64b45b62a1a018512.tar.xz
Enable vpath seraching for source files only
Diffstat (limited to 'tmk_core/rules.mk')
-rw-r--r--tmk_core/rules.mk12
1 files changed, 11 insertions, 1 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index c81fa6854..f6819d7c3 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -15,6 +15,16 @@
# Carlos Lamas
#
+# Enable vpath seraching for source files only
+# Without this, output files, could be read from the wrong .build directories
+VPATH_SRC := $(VPATH)
+vpath %.c $(VPATH_SRC)
+vpath %.h $(VPATH_SRC)
+vpath %.cpp $(VPATH_SRC)
+vpath %.hpp $(VPATH_SRC)
+vpath %.S $(VPATH_SRC)
+VPATH :=
+
# Output format. (can be srec, ihex, binary)
FORMAT = ihex
@@ -71,7 +81,7 @@ BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [
# Each directory must be seperated by a space.
# Use forward slashes for directory separators.
# For a directory that has spaces, enclose it in quotes.
-EXTRAINCDIRS += $(subst :, ,$(VPATH))
+EXTRAINCDIRS += $(subst :, ,$(VPATH_SRC))
# Compiler flag to set the C Standard level.