Skip to content

Commit 0159f9c

Browse files
rename some makefile variables
Signed-off-by: mateoconlechuga <matthewwaltzis@gmail.com>
1 parent 6750ac6 commit 0159f9c

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

docs/static/makefile-options.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,37 +154,37 @@ If an optional library is not present on the device, the program will still exec
154154
Miscellaneous Configuration
155155
---------------------------
156156

157-
.. rubric:: EXTRA_CSOURCES
157+
.. rubric:: EXTRA_C_SOURCES
158158

159159
Extra C source files to be compiled in that are not located in the source directory.
160160

161161
.. code-block:: makefile
162162
163-
EXTRA_CSOURCES = <space separated list of sources>
163+
EXTRA_C_SOURCES = <space separated list of sources>
164164
165-
.. rubric:: EXTRA_CPPSOURCES
165+
.. rubric:: EXTRA_CXX_SOURCES
166166

167167
Extra C++ source files to be compiled in that are not located in the source directory.
168168

169169
.. code-block:: makefile
170170
171-
EXTRA_CPPSOURCES = <space separated list of sources>
171+
EXTRA_CXX_SOURCES = <space separated list of sources>
172172
173-
.. rubric:: EXTRA_ASMSOURCES
173+
.. rubric:: EXTRA_ASM_SOURCES
174174

175175
Extra assembly source files to be compiled in that are not located in the source directory.
176176

177177
.. code-block:: makefile
178178
179-
EXTRA_ASMSOURCES = <space separated list of sources>
179+
EXTRA_ASM_SOURCES = <space separated list of sources>
180180
181-
.. rubric:: EXTRA_USERHEADERS
181+
.. rubric:: EXTRA_HEADERS
182182

183183
Extra header files to be used in that are not located in the source directory.
184184

185185
.. code-block:: makefile
186186
187-
EXTRA_USERHEADERS = <space separated list of headers>
187+
EXTRA_HEADERS = <space separated list of headers>
188188
189189
.. rubric:: EXTRA_LIBLOAD_LIBS
190190

src/makefile.mk

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,16 @@ LDLTO = $(OBJDIR)/lto.src
133133
# source: http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
134134
rwildcard = $(strip $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2) $(filter $(subst %%,%,%$(subst *,%,$2)),$d)))
135135

136+
# compatibility with older makefiles
137+
EXTRA_HEADERS += $(EXTRA_USERHEADERS)
138+
EXTRA_C_SOURCES += $(EXTRA_CSOURCES)
139+
EXTRA_CXX_SOURCES += $(EXTRA_CPPSOURCES)
140+
EXTRA_ASM_SOURCES += $(EXTRA_ASMSOURCES)
141+
136142
# find source files
137-
CSOURCES = $(sort $(call rwildcard,$(SRCDIR),*.$(C_EXTENSION)) $(EXTRA_CSOURCES))
138-
CPPSOURCES = $(sort $(call rwildcard,$(SRCDIR),*.$(CPP_EXTENSION)) $(EXTRA_CPPSOURCES))
139-
ASMSOURCES = $(sort $(call rwildcard,$(SRCDIR),*.asm) $(EXTRA_ASMSOURCES))
143+
CSOURCES = $(sort $(call rwildcard,$(SRCDIR),*.$(C_EXTENSION)) $(EXTRA_C_SOURCES))
144+
CPPSOURCES = $(sort $(call rwildcard,$(SRCDIR),*.$(CPP_EXTENSION)) $(EXTRA_CXX_SOURCES))
145+
ASMSOURCES = $(sort $(call rwildcard,$(SRCDIR),*.asm) $(EXTRA_ASM_SOURCES))
140146

141147
ifneq ($(filter debug,$(MAKECMDGOALS)),)
142148
LTO := NO
@@ -300,12 +306,12 @@ version:
300306
.SECONDEXPANSION:
301307

302308
# no lto
303-
$(OBJDIR)/%.$(C_EXTENSION).src: $$(call UPDIR_RM,$$*).$(C_EXTENSION) $(EXTRA_USERHEADERS) $(MAKEFILE_LIST) $(DEPS)
309+
$(OBJDIR)/%.$(C_EXTENSION).src: $$(call UPDIR_RM,$$*).$(C_EXTENSION) $(EXTRA_HEADERS) $(MAKEFILE_LIST) $(DEPS)
304310
$(Q)$(call MKDIR,$(@D))
305311
$(Q)echo [compiling] $(call NATIVEPATH,$<)
306312
$(Q)$(CC) -S -MD $(EZCFLAGS) $(call QUOTE_ARG,$<) -o $(call QUOTE_ARG,$@)
307313

308-
$(OBJDIR)/%.$(CPP_EXTENSION).src: $$(call UPDIR_RM,$$*).$(CPP_EXTENSION) $(EXTRA_USERHEADERS) $(MAKEFILE_LIST) $(DEPS)
314+
$(OBJDIR)/%.$(CPP_EXTENSION).src: $$(call UPDIR_RM,$$*).$(CPP_EXTENSION) $(EXTRA_HEADERS) $(MAKEFILE_LIST) $(DEPS)
309315
$(Q)$(call MKDIR,$(@D))
310316
$(Q)echo [compiling] $(call NATIVEPATH,$<)
311317
$(Q)$(CC) -S -MD $(EZCXXFLAGS) $(call QUOTE_ARG,$<) -o $(call QUOTE_ARG,$@)
@@ -318,12 +324,12 @@ $(LDBCLTO): $(LTOFILES)
318324
$(Q)echo [lto opt] $(call NATIVEPATH,$@)
319325
$(Q)$(LINK) $(foreach d,$^,$(call QUOTE_ARG,$(addprefix $(CURDIR)/,$d))) -o $(call QUOTE_ARG,$(addprefix $(CURDIR)/,$@))
320326

321-
$(OBJDIR)/%.$(C_EXTENSION).bc: $$(call UPDIR_RM,$$*).$(C_EXTENSION) $(EXTRA_USERHEADERS) $(MAKEFILE_LIST) $(DEPS)
327+
$(OBJDIR)/%.$(C_EXTENSION).bc: $$(call UPDIR_RM,$$*).$(C_EXTENSION) $(EXTRA_HEADERS) $(MAKEFILE_LIST) $(DEPS)
322328
$(Q)$(call MKDIR,$(@D))
323329
$(Q)echo [compiling] $(call NATIVEPATH,$<)
324330
$(Q)$(CC) -MD -c -emit-llvm $(EZCFLAGS) $(call QUOTE_ARG,$<) -o $(call QUOTE_ARG,$@)
325331

326-
$(OBJDIR)/%.$(CPP_EXTENSION).bc: $$(call UPDIR_RM,$$*).$(CPP_EXTENSION) $(EXTRA_USERHEADERS) $(MAKEFILE_LIST) $(DEPS)
332+
$(OBJDIR)/%.$(CPP_EXTENSION).bc: $$(call UPDIR_RM,$$*).$(CPP_EXTENSION) $(EXTRA_HEADERS) $(MAKEFILE_LIST) $(DEPS)
327333
$(Q)$(call MKDIR,$(@D))
328334
$(Q)echo [compiling] $(call NATIVEPATH,$<)
329335
$(Q)$(CC) -MD -c -emit-llvm $(EZCXXFLAGS) $(call QUOTE_ARG,$<) -o $(call QUOTE_ARG,$@)

0 commit comments

Comments
 (0)