aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/rules.mk50
1 files changed, 26 insertions, 24 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 70ab0eb16..e657af3f4 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -81,7 +81,6 @@ endif
81# -f...: tuning, see GCC manual and avr-libc documentation 81# -f...: tuning, see GCC manual and avr-libc documentation
82# -Wall...: warning level 82# -Wall...: warning level
83# -Wa,...: tell GCC to pass this to the assembler. 83# -Wa,...: tell GCC to pass this to the assembler.
84# -adhlns...: create assembler listing
85ifeq ($(strip $(LTO_ENABLE)), yes) 84ifeq ($(strip $(LTO_ENABLE)), yes)
86 ifeq ($(PLATFORM),CHIBIOS) 85 ifeq ($(PLATFORM),CHIBIOS)
87 $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.) 86 $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.)
@@ -117,10 +116,6 @@ endif
117#CFLAGS += -Wundef 116#CFLAGS += -Wundef
118#CFLAGS += -Wunreachable-code 117#CFLAGS += -Wunreachable-code
119#CFLAGS += -Wsign-compare 118#CFLAGS += -Wsign-compare
120GCC_VERSION := $(shell gcc --version 2>/dev/null)
121ifeq ($(findstring clang, ${GCC_VERSION}),)
122CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
123endif
124CFLAGS += $(CSTANDARD) 119CFLAGS += $(CSTANDARD)
125 120
126# This fixes lots of keyboards linking errors but SHOULDN'T BE A FINAL SOLUTION 121# This fixes lots of keyboards linking errors but SHOULDN'T BE A FINAL SOLUTION
@@ -133,7 +128,6 @@ CFLAGS += -fcommon
133# -f...: tuning, see GCC manual and avr-libc documentation 128# -f...: tuning, see GCC manual and avr-libc documentation
134# -Wall...: warning level 129# -Wall...: warning level
135# -Wa,...: tell GCC to pass this to the assembler. 130# -Wa,...: tell GCC to pass this to the assembler.
136# -adhlns...: create assembler listing
137ifeq ($(strip $(DEBUG_ENABLE)),yes) 131ifeq ($(strip $(DEBUG_ENABLE)),yes)
138 CXXFLAGS += -g$(DEBUG) 132 CXXFLAGS += -g$(DEBUG)
139endif 133endif
@@ -152,28 +146,10 @@ endif
152#CXXFLAGS += -Wstrict-prototypes 146#CXXFLAGS += -Wstrict-prototypes
153#CXXFLAGS += -Wunreachable-code 147#CXXFLAGS += -Wunreachable-code
154#CXXFLAGS += -Wsign-compare 148#CXXFLAGS += -Wsign-compare
155ifeq ($(findstring clang, ${GCC_VERSION}),)
156CXXFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
157endif
158#CXXFLAGS += $(CSTANDARD) 149#CXXFLAGS += $(CSTANDARD)
159 150
160#---------------- Assembler Options ---------------- 151#---------------- Assembler Options ----------------
161# -Wa,...: tell GCC to pass this to the assembler.
162# -adhlns: create listing
163# -gstabs: have the assembler create line number information; note that
164# for use in COFF files, additional information about filenames
165# and function names needs to be present in the assembler source
166# files -- see avr-libc docs [FIXME: not yet described there]
167# -listing-cont-lines: Sets the maximum number of continuation lines of hex
168# dump that will be displayed for a given single line of source input.
169ASFLAGS += $(ADEFS) 152ASFLAGS += $(ADEFS)
170ifeq ($(findstring clang, ${GCC_VERSION}),)
171ifeq ($(strip $(DEBUG_ENABLE)),yes)
172 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
173else
174 ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100
175endif
176endif
177ifeq ($(VERBOSE_AS_CMD),yes) 153ifeq ($(VERBOSE_AS_CMD),yes)
178 ASFLAGS += -v 154 ASFLAGS += -v
179endif 155endif
@@ -230,6 +206,32 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
230# You can give EXTRALDFLAGS at 'make' command line. 206# You can give EXTRALDFLAGS at 'make' command line.
231LDFLAGS += $(EXTRALDFLAGS) 207LDFLAGS += $(EXTRALDFLAGS)
232 208
209#---------------- Assembler Listings ----------------
210# -Wa,...: tell GCC to pass this to the assembler.
211# -adhlns: create listing
212# -gstabs: have the assembler create line number information; note that
213# for use in COFF files, additional information about filenames
214# and function names needs to be present in the assembler source
215# files -- see avr-libc docs [FIXME: not yet described there]
216# -listing-cont-lines: Sets the maximum number of continuation lines of hex
217# dump that will be displayed for a given single line of source input.
218
219ADHLNS_ENABLE ?= no
220ifeq ($(ADHLNS_ENABLE),yes)
221 # Avoid "Options to '-Xassembler' do not match" - only specify assembler options at LTO link time
222 ifeq ($(strip $(LTO_ENABLE)), yes)
223 LDFLAGS += -Wa,-adhlns=$(BUILD_DIR)/$(TARGET).lst
224 else
225 CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
226 CXXFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
227 ifeq ($(strip $(DEBUG_ENABLE)),yes)
228 ASFLAGS = -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
229 else
230 ASFLAGS = -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100
231 endif
232 endif
233endif
234
233# Define programs and commands. 235# Define programs and commands.
234SHELL = sh 236SHELL = sh
235REMOVE = rm -f 237REMOVE = rm -f