aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-07-31 13:49:04 +0300
committerFred Sundvik <fsundvik@gmail.com>2016-07-31 13:49:04 +0300
commitd5a947b32495625970d220349ca8f47e4cb2992a (patch)
tree0aa8068d4d0f7abd8fbae8aeaaff07e6dcc51460
parent97817a773eb667045144ac820df673ed8d3471a0 (diff)
downloadqmk_firmware-d5a947b32495625970d220349ca8f47e4cb2992a.tar.gz
qmk_firmware-d5a947b32495625970d220349ca8f47e4cb2992a.zip
Also depend on the gcc version
-rw-r--r--tmk_core/rules.mk8
1 files changed, 5 insertions, 3 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index ebcd372ca..69f82dc83 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -393,21 +393,21 @@ BEGIN = gccversion check_submodule sizebefore
393 393
394define GEN_OBJRULE 394define GEN_OBJRULE
395# Compile: create object files from C source files. 395# Compile: create object files from C source files.
396$1/%.o : %.c $1/%.d $1/cflags.txt | $(BEGIN) 396$1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN)
397 @mkdir -p $$(@D) 397 @mkdir -p $$(@D)
398 @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD) 398 @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD)
399 $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) 399 $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP))
400 @$$(BUILD_CMD) 400 @$$(BUILD_CMD)
401 401
402# Compile: create object files from C++ source files. 402# Compile: create object files from C++ source files.
403$1/%.o : %.cpp $1/%.d $1/cppflags.txt | $(BEGIN) 403$1/%.o : %.cpp $1/%.d $1/cppflags.txt $1/compiler.txt | $(BEGIN)
404 @mkdir -p $$(@D) 404 @mkdir -p $$(@D)
405 @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD) 405 @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD)
406 $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) 406 $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP))
407 @$(BUILD_CMD) 407 @$(BUILD_CMD)
408 408
409# Assemble: create object files from assembler source files. 409# Assemble: create object files from assembler source files.
410$1/%.o : %.S $1/asflags.txt | $(BEGIN) 410$1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN)
411 @mkdir -p $$(@D) 411 @mkdir -p $$(@D)
412 @$(SILENT) || printf "$$(MSG_ASSEMBLING) $$<" | $$(AWK_CMD) 412 @$(SILENT) || printf "$$(MSG_ASSEMBLING) $$<" | $$(AWK_CMD)
413 $$(eval CMD=$$(CC) -c $$(ALL_ASFLAGS) $$< -o $$@) 413 $$(eval CMD=$$(CC) -c $$(ALL_ASFLAGS) $$< -o $$@)
@@ -430,6 +430,8 @@ $1/ldflags.txt: $1/force
430$1/obj.txt: $1/force 430$1/obj.txt: $1/force
431 echo '$$(OBJ)' | cmp -s - $$@ || echo '$$(OBJ)' > $$@ 431 echo '$$(OBJ)' | cmp -s - $$@ || echo '$$(OBJ)' > $$@
432 432
433$1/compiler.txt: $1/force
434 $$(CC) --version | cmp -s - $$@ || $$(CC) --version > $$@
433endef 435endef
434 436
435# We have to use static rules for the .d files for some reason 437# We have to use static rules for the .d files for some reason