1 | # $Id: GCC64.kmk 3566 2022-06-13 15:37:08Z bird $
|
---|
2 | ## @file
|
---|
3 | # kBuild Tool Config - Generic 64-bit GCC v3.2.x or later Using The System GCC.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
---|
8 | #
|
---|
9 | # This file is part of kBuild.
|
---|
10 | #
|
---|
11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
12 | # it under the terms of the GNU General Public License as published by
|
---|
13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
14 | # (at your option) any later version.
|
---|
15 | #
|
---|
16 | # kBuild is distributed in the hope that it will be useful,
|
---|
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | # GNU General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with kBuild; if not, write to the Free Software
|
---|
23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
24 | #
|
---|
25 | #
|
---|
26 | # As a special exception you are granted permission to include this file, via
|
---|
27 | # the kmk include directive, as you wish without this in itself causing the
|
---|
28 | # resulting makefile, program or whatever to be covered by the GPL license.
|
---|
29 | # This exception does not however invalidate any other reasons why the makefile,
|
---|
30 | # program, whatever should not be covered the GPL.
|
---|
31 | #
|
---|
32 | #
|
---|
33 |
|
---|
34 | TOOL_GCC64 := Generic 64-bit GCC v3.2.x or later Using The System GCC. \
|
---|
35 | More or less Linux/ELF specfic.
|
---|
36 |
|
---|
37 | # Tool Specific Properties
|
---|
38 | ifndef TOOL_GCC64_PREFIX
|
---|
39 | TOOL_GCC64_PREFIX :=
|
---|
40 | endif
|
---|
41 | ifndef TOOL_GCC64_SUFFIX
|
---|
42 | TOOL_GCC64_SUFFIX := $(HOSTSUFF_EXE)
|
---|
43 | endif
|
---|
44 | if1of ($(KBUILD_HOST), solaris)
|
---|
45 | TOOL_GCC64_PREFIX2 ?= g
|
---|
46 | else
|
---|
47 | TOOL_GCC64_PREFIX2 ?=
|
---|
48 | endif
|
---|
49 | TOOL_GCC64_SUFFIX2 ?= $(HOSTSUFF_EXE)
|
---|
50 | TOOL_GCC64_PREFIX3 ?=
|
---|
51 | TOOL_GCC64_SUFFIX3 ?= $(HOSTSUFF_EXE)
|
---|
52 | TOOL_GCC64_CC ?= $(TOOL_GCC64_PREFIX)gcc$(TOOL_GCC64_SUFFIX) -m64
|
---|
53 | TOOL_GCC64_CXX ?= $(TOOL_GCC64_PREFIX)g++$(TOOL_GCC64_SUFFIX) -m64
|
---|
54 | TOOL_GCC64_AS ?= $(TOOL_GCC64_PREFIX)gcc$(TOOL_GCC64_SUFFIX) -m64
|
---|
55 | TOOL_GCC64_AR ?= $(TOOL_GCC64_PREFIX2)ar$(TOOL_GCC64_SUFFIX2)
|
---|
56 | TOOL_GCC64_LD ?= $(TOOL_GCC64_PREFIX)gcc$(TOOL_GCC64_SUFFIX) -m64
|
---|
57 | if1of ($(KBUILD_HOST), solaris)
|
---|
58 | TOOL_GCC64_LD_SYSMOD ?= $(TOOL_GCC64_PREFIX3)ld$(TOOL_GCC64_SUFFIX3)
|
---|
59 | else
|
---|
60 | TOOL_GCC64_LD_SYSMOD ?= $(TOOL_GCC64_PREFIX2)ld$(TOOL_GCC64_SUFFIX2)
|
---|
61 | endif
|
---|
62 | ifndef TOOL_GCC64_LDFLAGS.$(KBUILD_TARGET)
|
---|
63 | TOOL_GCC64_LDFLAGS.dll ?= -shared
|
---|
64 | else
|
---|
65 | TOOL_GCC64_LDFLAGS.dll ?= $(TOOL_GCC64_LDFLAGS.$(KBUILD_TARGET))
|
---|
66 | endif
|
---|
67 | TOOL_GCC64_LDFLAGS.sysmod ?= -r -m elf_x86_64$(if-expr "$(KBUILD_TARGET)" == "freebsd" || "$(KBUILD_TARGET)" == "gnukfbsd",_fbsd,)
|
---|
68 | TOOL_GCC64_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
|
---|
69 | ifeq ($(KBUILD_TARGET),os2)
|
---|
70 | TOOL_GCC64_LD_MAP ?= -Zmap=$(1)
|
---|
71 | else
|
---|
72 | TOOL_GCC64_LD_MAP ?=
|
---|
73 | endif
|
---|
74 | ifeq ($(KBUILD_TARGET),os2)
|
---|
75 | TOOL_GCC64_LD_SYSMOD_MAP ?= -Zmap=$(1)
|
---|
76 | else
|
---|
77 | TOOL_GCC64_LD_SYSMOD_MAP ?=
|
---|
78 | endif
|
---|
79 | TOOL_GCC64_OBJCOPY ?= $(TOOL_GCC64_PREFIX2)gobjcopy$(TOOL_GCC64_SUFFIX2)
|
---|
80 |
|
---|
81 | ifdef SLKRUNS
|
---|
82 | TOOL_GCC64_CC += -fmessage-length=0
|
---|
83 | TOOL_GCC64_CXX += -fmessage-length=0
|
---|
84 | endif
|
---|
85 |
|
---|
86 | # General Properties used by kBuild
|
---|
87 | TOOL_GCC64_COBJSUFF ?= .o
|
---|
88 | TOOL_GCC64_CFLAGS ?=
|
---|
89 | TOOL_GCC64_CFLAGS.debug ?= -g
|
---|
90 | TOOL_GCC64_CFLAGS.profile ?= -O2 #-g -pg
|
---|
91 | TOOL_GCC64_CFLAGS.release ?= -O2
|
---|
92 | TOOL_GCC64_CINCS ?=
|
---|
93 | TOOL_GCC64_CDEFS ?=
|
---|
94 |
|
---|
95 | TOOL_GCC64_CXXOBJSUFF ?= .o
|
---|
96 | TOOL_GCC64_CXXOBJSUFF ?= .o
|
---|
97 | TOOL_GCC64_CXXFLAGS ?=
|
---|
98 | TOOL_GCC64_CXXFLAGS.debug ?= -g
|
---|
99 | TOOL_GCC64_CXXFLAGS.profile ?= -O2 #-g -pg
|
---|
100 | TOOL_GCC64_CXXFLAGS.release ?= -O2
|
---|
101 | TOOL_GCC64_CXXINCS ?=
|
---|
102 | TOOL_GCC64_CXXDEFS ?=
|
---|
103 |
|
---|
104 | TOOL_GCC64_ASFLAGS ?= -x assembler-with-cpp
|
---|
105 | TOOL_GCC64_ASFLAGS.debug ?= -g
|
---|
106 | TOOL_GCC64_ASFLAGS.profile ?= -g
|
---|
107 | TOOL_GCC64_ASOBJSUFF ?= .o
|
---|
108 |
|
---|
109 | TOOL_GCC64_ARFLAGS ?= cr
|
---|
110 | TOOL_GCC64_ARLIBSUFF ?= .a
|
---|
111 |
|
---|
112 | TOOL_GCC64_LDFLAGS ?=
|
---|
113 | TOOL_GCC64_LDFLAGS.debug ?= -g
|
---|
114 | TOOL_GCC64_LDFLAGS.profile ?= -g
|
---|
115 |
|
---|
116 |
|
---|
117 | ## Compile C source.
|
---|
118 | # @param $(target) Normalized main target name.
|
---|
119 | # @param $(source) Source filename (relative).
|
---|
120 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
121 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
122 | # @param $(flags) Flags.
|
---|
123 | # @param $(defs) Definitions. No -D or something.
|
---|
124 | # @param $(incs) Includes. No -I or something.
|
---|
125 | # @param $(dirdep) Directory creation dependency.
|
---|
126 | # @param $(deps) Other dependencies.
|
---|
127 | #
|
---|
128 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
129 | # @param $(objsuff) Object suffix.
|
---|
130 | TOOL_GCC64_COMPILE_C_DEPEND =
|
---|
131 | TOOL_GCC64_COMPILE_C_DEPORD =
|
---|
132 | ifdef KBUILD_USE_KOBJCACHE
|
---|
133 | TOOL_GCC64_COMPILE_C_USES_KOBJCACHE = 1
|
---|
134 | TOOL_GCC64_COMPILE_C_OUTPUT = $(outbase).i
|
---|
135 | define TOOL_GCC64_COMPILE_C_CMDS
|
---|
136 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
137 | --kObjCache-cpp $(outbase).i\
|
---|
138 | $(TOOL_GCC64_CC) -E -o -\
|
---|
139 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
140 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
141 | $(abspath $(source))\
|
---|
142 | --kObjCache-cc $(obj)\
|
---|
143 | $(TOOL_GCC64_CC) -c\
|
---|
144 | $(flags) -fpreprocessed -x c\
|
---|
145 | -o $(obj)\
|
---|
146 | -
|
---|
147 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
148 | endef
|
---|
149 | else # !KBUILD_USE_KOBJCACHE
|
---|
150 | TOOL_GCC64_COMPILE_C_OUTPUT =
|
---|
151 | define TOOL_GCC64_COMPILE_C_CMDS
|
---|
152 | $(QUIET)$(TOOL_GCC64_CC) -c\
|
---|
153 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
154 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
155 | -o $(obj)\
|
---|
156 | $(abspath $(source))
|
---|
157 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
158 | endef
|
---|
159 | endif # !KBUILD_USE_KOBJCACHE
|
---|
160 |
|
---|
161 |
|
---|
162 | ## Compile C++ source.
|
---|
163 | # @param $(target) Normalized main target name.
|
---|
164 | # @param $(source) Source filename (relative).
|
---|
165 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
166 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
167 | # @param $(flags) Flags.
|
---|
168 | # @param $(defs) Definitions. No -D or something.
|
---|
169 | # @param $(incs) Includes. No -I or something.
|
---|
170 | # @param $(dirdep) Directory creation dependency.
|
---|
171 | # @param $(deps) Other dependencies.
|
---|
172 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
173 | # @param $(objsuff) Object suffix.
|
---|
174 | TOOL_GCC64_COMPILE_CXX_DEPEND =
|
---|
175 | TOOL_GCC64_COMPILE_CXX_DEPORD =
|
---|
176 | ifdef KBUILD_USE_KOBJCACHE
|
---|
177 | TOOL_GCC64_COMPILE_CXX_USES_KOBJCACHE = 1
|
---|
178 | TOOL_GCC64_COMPILE_CXX_OUTPUT = $(outbase).ii
|
---|
179 | define TOOL_GCC64_COMPILE_CXX_CMDS
|
---|
180 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
|
---|
181 | --kObjCache-cpp $(outbase).ii\
|
---|
182 | $(TOOL_GCC64_CXX) -E -o -\
|
---|
183 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
184 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
185 | $(abspath $(source))\
|
---|
186 | --kObjCache-cc $(obj)\
|
---|
187 | $(TOOL_GCC64_CXX) -c\
|
---|
188 | $(flags) -fpreprocessed -x c++\
|
---|
189 | -o $(obj)\
|
---|
190 | -
|
---|
191 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
192 | endef
|
---|
193 | else # !KBUILD_USE_KOBJCACHE
|
---|
194 | TOOL_GCC64_COMPILE_CXX_OUTPUT =
|
---|
195 | define TOOL_GCC64_COMPILE_CXX_CMDS
|
---|
196 | $(QUIET)$(TOOL_GCC64_CXX) -c\
|
---|
197 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
198 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
199 | -o $(obj)\
|
---|
200 | $(abspath $(source))
|
---|
201 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
202 | endef
|
---|
203 | endif # !KBUILD_USE_KOBJCACHE
|
---|
204 |
|
---|
205 |
|
---|
206 | ## Compile Assembly source.
|
---|
207 | # @param $(target) Normalized main target name.
|
---|
208 | # @param $(source) Source filename (relative).
|
---|
209 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
210 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
211 | # @param $(flags) Flags.
|
---|
212 | # @param $(defs) Definitions. No -D or something.
|
---|
213 | # @param $(incs) Includes. No -I or something.
|
---|
214 | # @param $(dirdep) Directory creation dependency.
|
---|
215 | # @param $(deps) Other dependencies.
|
---|
216 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
217 | # @param $(objsuff) Object suffix.
|
---|
218 | #
|
---|
219 | TOOL_GCC64_COMPILE_AS_OUTPUT =
|
---|
220 | TOOL_GCC64_COMPILE_AS_DEPEND =
|
---|
221 | TOOL_GCC64_COMPILE_AS_DEPORD =
|
---|
222 | define TOOL_GCC64_COMPILE_AS_CMDS
|
---|
223 | $(QUIET)$(TOOL_GCC64_AS) -c\
|
---|
224 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
225 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
226 | -o $(obj)\
|
---|
227 | $(abspath $(source))
|
---|
228 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
229 | endef
|
---|
230 |
|
---|
231 |
|
---|
232 | ## Link library
|
---|
233 | # @param $(target) Normalized main target name.
|
---|
234 | # @param $(out) Library name.
|
---|
235 | # @param $(objs) Object files to put in the library.
|
---|
236 | # @param $(flags) Flags.
|
---|
237 | # @param $(dirdep) Directory creation dependency.
|
---|
238 | # @param $(deps) Other dependencies.
|
---|
239 | # @param $(othersrc) Unhandled sources.
|
---|
240 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
241 | TOOL_GCC64_LINK_LIBRARY_OUTPUT = $(out).ar-script
|
---|
242 | TOOL_GCC64_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
243 | TOOL_GCC64_LINK_LIBRARY_DEPORD =
|
---|
244 | define TOOL_GCC64_LINK_LIBRARY_CMDS
|
---|
245 | $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)'
|
---|
246 | $(QUIET)$(APPEND) -n $(out).ar-script \
|
---|
247 | $(foreach o,$(objs), 'ADDMOD $(o)') \
|
---|
248 | $(foreach o,$(othersrc), 'ADDLIB $(o)')
|
---|
249 | $(QUIET)$(APPEND) $(out).ar-script 'SAVE'
|
---|
250 | $(QUIET)$(APPEND) $(out).ar-script 'END'
|
---|
251 | $(QUIET)$(REDIRECT) -rti $(out).ar-script -- $(TOOL_GCC64_AR) -M
|
---|
252 | endef
|
---|
253 |
|
---|
254 |
|
---|
255 | ## Link program
|
---|
256 | # @param $(target) Normalized main target name.
|
---|
257 | # @param $(out) Program name.
|
---|
258 | # @param $(objs) Object files to link together.
|
---|
259 | # @param $(libs) Libraries to search.
|
---|
260 | # @param $(libpath) Library search paths.
|
---|
261 | # @param $(flags) Flags.
|
---|
262 | # @param $(dirdep) Directory creation dependency.
|
---|
263 | # @param $(deps) Other dependencies.
|
---|
264 | # @param $(othersrc) Unhandled sources.
|
---|
265 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
266 | # @param $(custom_post) Custom step invoked after linking.
|
---|
267 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
268 | TOOL_GCC64_LINK_PROGRAM_OUTPUT =
|
---|
269 | TOOL_GCC64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
|
---|
270 | TOOL_GCC64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
|
---|
271 | TOOL_GCC64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
|
---|
272 | TOOL_GCC64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
273 | TOOL_GCC64_LINK_PROGRAM_DEPORD =
|
---|
274 | define TOOL_GCC64_LINK_PROGRAM_CMDS
|
---|
275 | $(QUIET)$(TOOL_GCC64_LD) $(flags) -o $(out) $(objs)\
|
---|
276 | $(foreach p,$(libpath), -L$(p))\
|
---|
277 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
278 | $(call TOOL_GCC64_LD_MAP,$(outbase).map)
|
---|
279 | ifeq ($(ld_debug),split)
|
---|
280 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
|
---|
281 | $(QUIET)$(CHMOD) a-x $(outbase).debug
|
---|
282 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
|
---|
283 | endif
|
---|
284 | endef
|
---|
285 |
|
---|
286 |
|
---|
287 | ## Link DLL
|
---|
288 | # @param $(target) Normalized main target name.
|
---|
289 | # @param $(out) Program name.
|
---|
290 | # @param $(objs) Object files to link together.
|
---|
291 | # @param $(libs) Libraries to search.
|
---|
292 | # @param $(libpath) Library search paths.
|
---|
293 | # @param $(flags) Flags.
|
---|
294 | # @param $(dirdep) Directory creation dependency.
|
---|
295 | # @param $(deps) Other dependencies.
|
---|
296 | # @param $(othersrc) Unhandled sources.
|
---|
297 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
298 | # @param $(custom_post) Custom step invoked after linking.
|
---|
299 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
300 | TOOL_GCC64_LINK_DLL_OUTPUT =
|
---|
301 | TOOL_GCC64_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
|
---|
302 | TOOL_GCC64_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
|
---|
303 | TOOL_GCC64_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
|
---|
304 | TOOL_GCC64_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
305 | TOOL_GCC64_LINK_DLL_DEPORD =
|
---|
306 | define TOOL_GCC64_LINK_DLL_CMDS
|
---|
307 | $(QUIET)$(TOOL_GCC64_LD) $(TOOL_GCC64_LDFLAGS.dll) $(flags) -o $(out)\
|
---|
308 | $(if $(filter-out win os2, $(KBUILD_TARGET)),$(call TOOL_GCC64_LD_SONAME,$(target),$(out)))\
|
---|
309 | $(objs)\
|
---|
310 | $(foreach p,$(libpath), -L$(p))\
|
---|
311 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
312 | $(call TOOL_GCC64_LD_MAP,$(outbase).map)
|
---|
313 | ifeq ($(ld_debug),split)
|
---|
314 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
|
---|
315 | $(QUIET)$(CHMOD) a-x $(outbase).debug
|
---|
316 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
|
---|
317 | endif
|
---|
318 | endef
|
---|
319 |
|
---|
320 |
|
---|
321 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
322 | # @param $(target) Normalized main target name.
|
---|
323 | # @param $(out) System module name.
|
---|
324 | # @param $(objs) Object files to link together.
|
---|
325 | # @param $(libs) Libraries to search.
|
---|
326 | # @param $(libpath) Library search paths.
|
---|
327 | # @param $(flags) Flags.
|
---|
328 | # @param $(dirdep) Directory creation dependency.
|
---|
329 | # @param $(deps) Other dependencies.
|
---|
330 | # @param $(othersrc) Unhandled sources.
|
---|
331 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
332 | # @param $(custom_post) Custom step invoked after linking.
|
---|
333 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
334 | TOOL_GCC64_LINK_SYSMOD_OUTPUT =
|
---|
335 | TOOL_GCC64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
|
---|
336 | TOOL_GCC64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
|
---|
337 | TOOL_GCC64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
|
---|
338 | TOOL_GCC64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
339 | TOOL_GCC64_LINK_SYSMOD_DEPORD =
|
---|
340 | define TOOL_GCC64_LINK_SYSMOD_CMDS
|
---|
341 | $(QUIET)$(TOOL_GCC64_LD_SYSMOD) $(TOOL_GCC64_LDFLAGS.sysmod) $(flags) -o $(out) $(objs)\
|
---|
342 | $(foreach p,$(libpath), -L$(p))\
|
---|
343 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
|
---|
344 | $(call TOOL_GCC64_LD_SYSMOD_MAP,$(outbase).map)
|
---|
345 | ifeq ($(ld_debug),split)
|
---|
346 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
|
---|
347 | $(QUIET)$(CHMOD) a-x $(outbase).debug
|
---|
348 | $(QUIET)$(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
|
---|
349 | endif
|
---|
350 | endef
|
---|
351 |
|
---|