From d5a947b32495625970d220349ca8f47e4cb2992a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 13:49:04 +0300 Subject: [PATCH] Also depend on the gcc version --- tmk_core/rules.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index ebcd372cac..69f82dc836 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -393,21 +393,21 @@ BEGIN = gccversion check_submodule sizebefore define GEN_OBJRULE # Compile: create object files from C source files. -$1/%.o : %.c $1/%.d $1/cflags.txt | $(BEGIN) +$1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD) $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$$(BUILD_CMD) # Compile: create object files from C++ source files. -$1/%.o : %.cpp $1/%.d $1/cppflags.txt | $(BEGIN) +$1/%.o : %.cpp $1/%.d $1/cppflags.txt $1/compiler.txt | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD) $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$(BUILD_CMD) # Assemble: create object files from assembler source files. -$1/%.o : %.S $1/asflags.txt | $(BEGIN) +$1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN) @mkdir -p $$(@D) @$(SILENT) || printf "$$(MSG_ASSEMBLING) $$<" | $$(AWK_CMD) $$(eval CMD=$$(CC) -c $$(ALL_ASFLAGS) $$< -o $$@) @@ -430,6 +430,8 @@ $1/ldflags.txt: $1/force $1/obj.txt: $1/force echo '$$(OBJ)' | cmp -s - $$@ || echo '$$(OBJ)' > $$@ +$1/compiler.txt: $1/force + $$(CC) --version | cmp -s - $$@ || $$(CC) --version > $$@ endef # We have to use static rules for the .d files for some reason