aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tmk_core/native.mk5
-rw-r--r--tmk_core/rules.mk7
2 files changed, 12 insertions, 0 deletions
diff --git a/tmk_core/native.mk b/tmk_core/native.mk
index 3caf64454..f609fd0e6 100644
--- a/tmk_core/native.mk
+++ b/tmk_core/native.mk
@@ -1,4 +1,5 @@
1SYSTEM_TYPE := $(shell gcc -dumpmachine) 1SYSTEM_TYPE := $(shell gcc -dumpmachine)
2GCC_VERSION := $(shell gcc --version 2>/dev/null)
2 3
3CC = gcc 4CC = gcc
4OBJCOPY = 5OBJCOPY =
@@ -12,7 +13,9 @@ BIN =
12 13
13 14
14COMPILEFLAGS += -funsigned-char 15COMPILEFLAGS += -funsigned-char
16ifeq ($(findstring clang, ${GCC_VERSION}),)
15COMPILEFLAGS += -funsigned-bitfields 17COMPILEFLAGS += -funsigned-bitfields
18endif
16COMPILEFLAGS += -ffunction-sections 19COMPILEFLAGS += -ffunction-sections
17COMPILEFLAGS += -fdata-sections 20COMPILEFLAGS += -fdata-sections
18COMPILEFLAGS += -fshort-enums 21COMPILEFLAGS += -fshort-enums
@@ -21,7 +24,9 @@ COMPILEFLAGS += -mno-ms-bitfields
21endif 24endif
22 25
23CFLAGS += $(COMPILEFLAGS) 26CFLAGS += $(COMPILEFLAGS)
27ifeq ($(findstring clang, ${GCC_VERSION}),)
24CFLAGS += -fno-inline-small-functions 28CFLAGS += -fno-inline-small-functions
29endif
25CFLAGS += -fno-strict-aliasing 30CFLAGS += -fno-strict-aliasing
26 31
27CXXFLAGS += $(COMPILEFLAGS) 32CXXFLAGS += $(COMPILEFLAGS)
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 597f7aa82..5a7f29910 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -105,7 +105,10 @@ endif
105#CFLAGS += -Wundef 105#CFLAGS += -Wundef
106#CFLAGS += -Wunreachable-code 106#CFLAGS += -Wunreachable-code
107#CFLAGS += -Wsign-compare 107#CFLAGS += -Wsign-compare
108GCC_VERSION := $(shell gcc --version 2>/dev/null)
109ifeq ($(findstring clang, ${GCC_VERSION}),)
108CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst) 110CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
111endif
109CFLAGS += $(CSTANDARD) 112CFLAGS += $(CSTANDARD)
110 113
111# This fixes lots of keyboards linking errors but SHOULDN'T BE A FINAL SOLUTION 114# This fixes lots of keyboards linking errors but SHOULDN'T BE A FINAL SOLUTION
@@ -137,7 +140,9 @@ endif
137#CXXFLAGS += -Wstrict-prototypes 140#CXXFLAGS += -Wstrict-prototypes
138#CXXFLAGS += -Wunreachable-code 141#CXXFLAGS += -Wunreachable-code
139#CXXFLAGS += -Wsign-compare 142#CXXFLAGS += -Wsign-compare
143ifeq ($(findstring clang, ${GCC_VERSION}),)
140CXXFLAGS += -Wa,-adhlns=$(@:%.o=%.lst) 144CXXFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
145endif
141#CXXFLAGS += $(CSTANDARD) 146#CXXFLAGS += $(CSTANDARD)
142 147
143#---------------- Assembler Options ---------------- 148#---------------- Assembler Options ----------------
@@ -150,11 +155,13 @@ CXXFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
150# -listing-cont-lines: Sets the maximum number of continuation lines of hex 155# -listing-cont-lines: Sets the maximum number of continuation lines of hex
151# dump that will be displayed for a given single line of source input. 156# dump that will be displayed for a given single line of source input.
152ASFLAGS += $(ADEFS) 157ASFLAGS += $(ADEFS)
158ifeq ($(findstring clang, ${GCC_VERSION}),)
153ifeq ($(strip $(DEBUG_ENABLE)),yes) 159ifeq ($(strip $(DEBUG_ENABLE)),yes)
154 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 160 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
155else 161else
156 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100 162 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100
157endif 163endif
164endif
158ifeq ($(VERBOSE_AS_CMD),yes) 165ifeq ($(VERBOSE_AS_CMD),yes)
159 ASFLAGS += -v 166 ASFLAGS += -v
160endif 167endif