source: trunk/kBuild/footer-pass2-compiling-targets.kmk@ 2522

Last change on this file since 2522 was 2521, checked in by bird, 14 years ago

footer.kmk: Split it up into several files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 32.1 KB
Line 
1# $Id: footer-pass2-compiling-targets.kmk 2521 2011-07-26 18:18:19Z bird $
2## @file
3# kBuild - Footer - Target lists - Pass 2 - Compiling Targets.
4#
5
6#
7# Copyright (c) 2004-2011 knut st. osmundsen <bird-kBuild-spamx@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 source 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
35#
36# Object processing.
37#
38
39## wrapper the compile command dependency check.
40ifndef NO_COMPILE_CMDS_DEPS
41 if1of ($(KMK_FEATURES),dot-must-make)
42 _DEP_COMPILE_CMDS =
43 # for debugging: $$(warning MUST_MAKE=$$$$(comp-cmds-ex $$$$($(target)_$(subst :,_,$(source))_CMDS_PREV_), $$$$(commands $$@)) -> $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_CMDS_PREV_),$$(commands $$@),FORCE))
44 else
45 _DEP_COMPILE_CMDS = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_CMDS_PREV_),$$(commands $(obj)),FORCE)
46 endif
47else
48 _DEP_COMPILE_CMDS =
49endif
50
51
52## Generates the rules for building a specific object, and the aliases
53# for building a source file.
54# @param $(obj) The object file.
55define def_target_source_rule
56ifndef NO_COMPILE_CMDS_DEPS
57$(obj): .MUST_MAKE = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_CMDS_PREV_),$$(commands $$@),FORCE)
58endif
59ifdef TOOL_$(tool)_COMPILE_$(type)_USES_KOBJCACHE
60_OUT_FILES += $(outbase).koc
61$(outbase).koc +| $(obj) $($(target)_$(source)_OUTPUT_) $($(target)_$(source)_OUTPUT_MAYBE_) : \
62 $($(target)_$(source)_DEPEND_) \
63 $(value _DEP_COMPILE_CMDS) \
64 | \
65 $($(target)_$(source)_DEPORD_) \
66 $$$$($(target)_INTERMEDIATES) \
67 $$$$($(target)_INTERMEDIATES.$(bld_trg)) \
68 $$$$($(target)_INTERMEDIATES.$(bld_trg).$(bld_trg_arch)) \
69 $$$$($(target)_INTERMEDIATES.$(bld_trg_arch)) \
70 $$$$($(target)_INTERMEDIATES.$(bld_trg_cpu)) \
71 $$$$($(target)_INTERMEDIATES.$(bld_type))
72 %$$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
73else
74$(obj) + $($(target)_$(source)_OUTPUT_) +| $($(target)_$(source)_OUTPUT_MAYBE_) : \
75 $($(target)_$(source)_DEPEND_) \
76 $(value _DEP_COMPILE_CMDS) \
77 | \
78 $($(target)_$(source)_DEPORD_) \
79 $$$$($(target)_INTERMEDIATES) \
80 $$$$($(target)_INTERMEDIATES.$(bld_trg)) \
81 $$$$($(target)_INTERMEDIATES.$(bld_trg).$(bld_trg_arch)) \
82 $$$$($(target)_INTERMEDIATES.$(bld_trg_arch)) \
83 $$$$($(target)_INTERMEDIATES.$(bld_trg_cpu)) \
84 $$$$($(target)_INTERMEDIATES.$(bld_type))
85 %$$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
86ifdef TOOL_$(tool)_COMPILE_$(type)_DONT_PURGE_OUTPUT
87 $$(QUIET)$$(RM) -f -- $(dep) $(obj) $($(target)_$(source)_OUTPUT_) $($(target)_OUTPUT_MAYBE_)
88endif
89endif
90
91$($(target)_$(source)_CMDS_)
92
93ifndef NO_COMPILE_CMDS_DEPS
94 %$$(QUIET2)$$(APPEND) '$(dep)'
95 %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_CMDS_PREV_'
96 %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(obj)'
97 %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
98endif
99
100$(basename $(notdir $(obj))).o: $(obj)
101$(basename $(notdir $(obj))).obj: $(obj)
102
103## @todo make this 'local cmds,output,output_maybe,depend and depord' in 0.2.x or when a new kb-src-one is added.
104$(target)_$(source)_CMDS_ :=
105$(target)_$(source)_OUTPUT_ :=
106$(target)_$(source)_OUTPUT_MAYBE_ :=
107$(target)_$(source)_DEPEND_ :=
108$(target)_$(source)_DEPORD_ :=
109endef # def_target_source_rule
110$(eval-opt-var def_target_source_rule)
111
112
113## wrapper the link command dependency check.
114ifndef NO_LINK_CMDS_DEPS
115 if1of ($(KMK_FEATURES),dot-must-make)
116 _DEP_LINK_CMDS =
117 else
118 _DEP_LINK_CMDS = $$(comp-cmds-ex $$($(target)_CMDS_PREV_),$$(commands $(out)),FORCE)
119 endif
120else
121 _DEP_LINK_CMDS =
122endif
123
124## Generate the link rule for a target.
125# @param $(target) The normalized target name.
126# @param $(dirdep) Directories we depend upon begin created before linking.
127# @param $(dep) The name of the dependency file.
128# @param $(out)
129# @param $($(target)_2_OUTPUT) Output files from the link.
130# @param $($(target)_2_OUTPUT_MAYBE) Output files that the link may perhaps create.
131# @param $($(target)_2_DEPEND) Dependencies.
132# @param $($(target)_2_DEPORD) Dependencies which should only affect build order.
133# @param $(cmds) The link commands.
134# @param $($(target)_CMDS_PREV_) The link commands from the previous run.
135define def_link_rule
136ifndef NO_LINK_CMDS_DEPS
137$(out): .MUST_MAKE = $$(comp-cmds-ex $$($(target)_CMDS_PREV_),$$(commands $$@),FORCE)
138endif
139$(out) + $($(target)_2_OUTPUT) +| $($(target)_2_OUTPUT_MAYBE) : \
140 $$$$($(target)_2_DEPEND) \
141 $(value _DEP_LINK_CMDS) \
142 | \
143 $$$$($(target)_2_DEPORD)
144 %$$(call MSG_LINK,$(target),$$@,$(tool_do))
145 $$(QUIET)$$(RM) -f -- $(dep) $(out) $($(target)_2_OUTPUT) $($(target)_2_OUTPUT_MAYBE)
146
147$(cmds)
148
149ifndef NO_LINK_CMDS_DEPS
150 %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_CMDS_PREV_'
151 %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
152 %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
153endif
154
155$(basename $(notdir $(out))):: $(out)
156
157endef # def_link_rule
158$(eval-opt-var def_link_rule)
159
160
161## Generate the link & lib install rule
162# Implicit parameters: target, out, $(target)_1_STAGE_TARGET, mode,
163# pre_install_cmds, post_install_cmds
164define def_link_install_rule
165$($(target)_1_INST_TARGET): $(out) | $$$$(dir $$$$@)
166 %$$(call MSG_INST_TRG,$(target),$(out),$$@)
167 $(pre_install_cmds)
168
169 $$(QUIET)$$(INSTALL) $(if $(mode),-m $(mode)) $(if $(uid),-o $(uid)) $(if $(gid),-g $(gid)) -- $(out) $$@
170 $(post_install_cmds)
171
172endef
173
174
175## Generate the link & lib stage installation rule
176# Implicit parameters: target, out, $(target)_1_STAGE_TARGET, mode,
177# pre_install_cmds, post_install_cmds
178define def_link_stage_rule
179$($(target)_1_STAGE_TARGET): $(out) | $$$$(dir $$$$@)
180 %$$(call MSG_INST_TRG,$(target),$(out),$$@)
181 $(pre_install_cmds)
182
183 $$(QUIET)$$(INSTALL_STAGING) $(if $(mode),-m $(mode)) $(if $(uid),-o $(uid)) $(if $(gid),-g $(gid)) -- $(out) $$@
184 $(post_install_cmds)
185
186
187$(basename $(notdir $(out))):: $($(target)_1_STAGE_TARGET)
188
189endef
190
191
192## def_src_handler_*
193#
194# @{
195define def_src_handler_c
196local type := C
197 $(kb-src-one 2)
198endef
199
200define def_src_handler_cxx
201local type := CXX
202 $(kb-src-one 2)
203endef
204
205define def_src_handler_objc
206local type := OBJC
207 $(kb-src-one 2)
208endef
209
210define def_src_handler_objcxx
211local type := OBJCXX
212 $(kb-src-one 2)
213endef
214
215define def_src_handler_asm
216local type := AS
217 $(kb-src-one 2)
218endef
219
220define def_src_handler_rc
221local type := RC
222 $(kb-src-one 2)
223endef
224
225define def_src_handler_obj
226ifeq ($(defpath),)
227 $(target)_2_OBJS += $(source)
228else
229 $(target)_2_OBJS += $(abspathex $(source), $(defpath))
230endif
231endef
232## @}
233
234## Handle one source.
235# .
236define def_src_handler_one
237local suff := $(suffix $(source))
238local src_handler := $(firstword $(filter $(suff):%, $($(target)_$(source)_SRC_HANDLERS) $($(source)_SRC_HANDLERS) $(target_src_handlers) ))
239local handler := $(patsubst $(suff):%,%,$(src_handler))
240ifneq ($(handler),)
241 $(evalvalctx $(handler))
242else
243 othersrc += $(source)
244endif
245endef # def_src_handler_one
246
247## Generic macro for processing all target sources.
248# @param $(target) Normalized target name.
249# @param $(defpath)
250# @param much-more...
251# @returns othersrc, $(target)_2_OBJS, ++
252define def_target_sources
253local target_src_handlers := $($(target)_SRC_HANDLERS) $(KBUILD_SRC_HANDLERS)
254$(foreach source,\
255 $($(target)_SOURCES)\
256 $($(target)_SOURCES.$(bld_trg))\
257 $($(target)_SOURCES.$(bld_trg).$(bld_type))\
258 $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch))\
259 $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch).$(bld_type))\
260 $($(target)_SOURCES.$(bld_trg_arch))\
261 $($(target)_SOURCES.$(bld_trg_cpu))\
262 $($(target)_SOURCES.$(bld_type))\
263 ,$(evalval def_src_handler_one) )
264
265$(foreach source,\
266 $($(target)_GEN_SOURCES_)\
267 $($(target)_GEN_SOURCES_.$(bld_trg))\
268 $($(target)_GEN_SOURCES_.$(bld_trg).$(bld_type))\
269 $($(target)_GEN_SOURCES_.$(bld_trg).$(bld_trg_arch))\
270 $($(target)_GEN_SOURCES_.$(bld_trg).$(bld_trg_arch).$(bld_type))\
271 $($(target)_GEN_SOURCES_.$(bld_trg_arch))\
272 $($(target)_GEN_SOURCES_.$(bld_trg_cpu))\
273 $($(target)_GEN_SOURCES_.$(bld_type))\
274 ,$(evalval def_src_handler_one) )
275endef # def_target_sources
276$(eval-opt-var def_target_sources)
277
278
279##
280# Function for getting the first defined propert value.
281#
282# @param 1 The property name.
283# @note Implicit parameters: target, bld_trg, bld_trg_arch, bld_trg_cpu, bld_type.
284# @returns Expanded property value.
285#
286## @todo bld_trg_cpu is missing here.
287define def_fn_prop_get_first_defined
288ifdef $(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type)
289 local .RETURN := $($(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type))
290else ifdef $(target)_$(1).$(bld_trg).$(bld_trg_arch)
291 local .RETURN := $($(target)_$(1).$(bld_trg).$(bld_trg_arch))
292else ifdef $(target)_$(1).$(bld_trg).$(bld_type)
293 local .RETURN := $($(target)_$(1).$(bld_trg).$(bld_type))
294else ifdef $(target)_$(1).$(bld_trg_arch)
295 local .RETURN := $($(target)_$(1).$(bld_trg_arch))
296else ifdef $(target)_$(1).$(bld_trg)
297 local .RETURN := $($(target)_$(1).$(bld_trg))
298else ifdef $(target)_$(1).$(bld_type)
299 local .RETURN := $($(target)_$(1).$(bld_type))
300else ifdef $(target)_$(1)
301 local .RETURN := $($(target)_$(1))
302else ifdef $(1).$(bld_trg).$(bld_trg_arch).$(bld_type)
303 local .RETURN := $($(1).$(bld_trg).$(bld_trg_arch).$(bld_type))
304else ifdef $(1).$(bld_trg).$(bld_trg_arch)
305 local .RETURN := $($(1).$(bld_trg).$(bld_trg_arch))
306else ifdef $(1).$(bld_trg).$(bld_type)
307 local .RETURN := $($(1).$(bld_trg).$(bld_type))
308else ifdef $(1).$(bld_trg_arch)
309 local .RETURN := $($(1).$(bld_trg_arch))
310else ifdef $(1).$(bld_trg)
311 local .RETURN := $($(1).$(bld_trg))
312else ifdef $(1).$(bld_type)
313 local .RETURN := $($(1).$(bld_type))
314else
315 local .RETURN := $($(1))
316endif
317endef # def_fn_prop_get_first_defined
318
319
320## Generic macro for generating the install rule(s) for a target.
321#
322# @param $(target) Normalized target name.
323# @param $(out) The output file.
324# @param $(typevar) The name of the variable with all the root targets of its type.
325# @param $(target_type_mode) The default file mode implied by the target type.
326define def_target_install_only
327ifneq ($($(target)_1_INSTTYPE),none)
328 local mode := $(firstword \
329 $($(target)_MODE.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
330 $($(target)_MODE.$(bld_trg).$(bld_trg_arch)) \
331 $($(target)_MODE.$(bld_trg).$(bld_type)) \
332 $($(target)_MODE.$(bld_trg_arch)) \
333 $($(target)_MODE.$(bld_trg)) \
334 $($(target)_MODE.$(bld_type)) \
335 $($(target)_MODE) \
336 $(target_type_mode) )
337 local uid := $(firstword \
338 $($(target)_UID.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
339 $($(target)_UID.$(bld_trg).$(bld_trg_arch)) \
340 $($(target)_UID.$(bld_trg).$(bld_type)) \
341 $($(target)_UID.$(bld_trg_arch)) \
342 $($(target)_UID.$(bld_trg)) \
343 $($(target)_UID.$(bld_type)) \
344 $($(target)_UID) )
345 local gid := $(firstword \
346 $($(target)_GID.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
347 $($(target)_GID.$(bld_trg).$(bld_trg_arch)) \
348 $($(target)_GID.$(bld_trg).$(bld_type)) \
349 $($(target)_GID.$(bld_trg_arch)) \
350 $($(target)_GID.$(bld_trg)) \
351 $($(target)_GID.$(bld_type)) \
352 $($(target)_GID) )
353 local pre_install_cmds := $(evalcall def_fn_prop_get_first_defined,PRE_INST_CMDS)
354 local post_install_cmds := $(evalcall def_fn_prop_get_first_defined,POST_INST_CMDS)
355
356 # Generate the rules
357 ifeq ($($(target)_1_INSTTYPE),both)
358$(eval $(def_link_install_rule))
359 _INSTALLS_FILES += $($(target)_1_INST_TARGET)
360 endif
361$(eval $(def_link_stage_rule))
362 _STAGE_FILES += $($(target)_1_STAGE_TARGET)
363 $(typevar) += $($(target)_1_STAGE_TARGET)
364else # INSTTYPE == none
365 $(typevar) += $(out)
366endif # INSTTYPE == none
367
368endef # def_target_install_only
369
370
371
372#
373# LIBRARIES
374#
375
376## Library (one).
377# @param $(target) Normalized library (target) name.
378define def_lib
379# library basics
380## @todo prefix
381local bld_type := $(firstword $($(target)_BLD_TYPE) $(KBUILD_TYPE))
382local bld_trg := $(firstword $($(target)_BLD_TRG) $(KBUILD_TARGET))
383local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(KBUILD_TARGET_ARCH))
384local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(KBUILD_TARGET_CPU))
385local tool := $(call _TARGET_TOOL,$(target),AR)
386ifeq ($(tool),)
387$(error kBuild: Library target $(target) does not have a tool defined!)
388endif
389local name := $(firstword\
390 $($(target)_NAME.$(bld_trg).$(bld_trg_arch).$(bld_type))\
391 $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
392 $($(target)_NAME.$(bld_trg).$(bld_type))\
393 $($(target)_NAME.$(bld_trg_arch))\
394 $($(target)_NAME.$(bld_trg))\
395 $($(target)_NAME.$(bld_type))\
396 $($(target)_NAME)\
397 $(target))
398local outbase := $(call TARGET_BASE,$(name),$(target))
399$(target)_0_OUTDIR:= $(patsubst %/,%,$(dir $(outbase)))
400$(call KB_FN_ASSIGN_DEPRECATED,PATH_$(target),$($(target)_0_OUTDIR), $(target)_0_OUTDIR)
401local suff := $(firstword\
402 $($(target)_LIBSUFF.$(bld_trg).$(bld_trg_arch))\
403 $($(target)_LIBSUFF.$(bld_trg))\
404 $($(target)_LIBSUFF)\
405 $(TOOL_$(tool)_ARLIBSUFF.$(bld_trg).$(bld_trg_arch))\
406 $(TOOL_$(tool)_ARLIBSUFF.$(bld_trg))\
407 $(TOOL_$(tool)_ARLIBSUFF)\
408 $(SUFF_LIB))
409local out := $(outbase)$(suff)
410local defpath := $($(target)_DEFPATH)
411ifeq ($(defpath),)
412 local defpath := $($(target)_PATH)
413endif
414$(target)_1_TARGET:= $(out)
415$(call KB_FN_ASSIGN_DEPRECATED,TARGET_$(target),$($(target)_1_TARGET), $(target)_1_TARGET)
416# no local here - must be writable across some foreachs.
417othersrc :=
418$(target)_2_OBJS :=
419
420# Do units pre source callouts.
421local units := \
422 $($(target)_USES.$(bld_trg).$(bld_trg_arch))\
423 $($(target)_USES.$(bld_trg_arch))\
424 $($(target)_USES.$(bld_trg))\
425 $($(target)_USES.$(bld_type))\
426 $($(target)_USES)
427$(foreach unit,$(units),$(evalval def_unit_$(unit)_target_pre))
428
429# source -> object
430$(evalval def_target_sources)
431
432# library linking
433local tool := $(call _TARGET_TOOL,$(target),AR)
434local name := $(firstword\
435 $($(target)_NAME.$(bld_trg).$(bld_trg_arch).$(bld_type))\
436 $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
437 $($(target)_NAME.$(bld_trg).$(bld_type))\
438 $($(target)_NAME.$(bld_trg_arch))\
439 $($(target)_NAME.$(bld_trg))\
440 $($(target)_NAME.$(bld_type))\
441 $($(target)_NAME)\
442 $(target))
443local outbase := $(call TARGET_BASE,$(name),$(target))
444local flags :=\
445 $(TOOL_$(tool)_ARFLAGS)\
446 $(TOOL_$(tool)_ARFLAGS.$(bld_type))\
447 $(ARFLAGS)\
448 $(ARFLAGS.$(bld_type))\
449 $($(target)_ARFLAGS)\
450 $($(target)_ARFLAGS.$(bld_type)) \
451 $($(target)_ARFLAGS.$(bld_trg)) \
452 $($(target)_ARFLAGS.$(bld_trg_arch)) \
453 $($(target)_ARFLAGS.$(bld_trg).$(bld_trg_arch)) \
454 $($(target)_ARFLAGS.$(bld_trg_cpu))
455local dirdep := $(call DIRDEP,$(dir $(out)))
456local deps := \
457 $($(target)_DEPS.$(bld_trg_cpu)) \
458 $($(target)_DEPS.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
459 $($(target)_DEPS.$(bld_trg).$(bld_trg_arch)) \
460 $($(target)_DEPS.$(bld_trg).$(bld_type)) \
461 $($(target)_DEPS.$(bld_trg_arch)) \
462 $($(target)_DEPS.$(bld_trg)) \
463 $($(target)_DEPS.$(bld_type)) \
464 $($(target)_DEPS) \
465 $($(target)_LNK_DEPS.$(bld_trg_cpu)) \
466 $($(target)_LNK_DEPS.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
467 $($(target)_LNK_DEPS.$(bld_trg).$(bld_trg_arch)) \
468 $($(target)_LNK_DEPS.$(bld_trg).$(bld_type)) \
469 $($(target)_LNK_DEPS.$(bld_trg_arch)) \
470 $($(target)_LNK_DEPS.$(bld_trg)) \
471 $($(target)_LNK_DEPS.$(bld_type)) \
472 $($(target)_LNK_DEPS)
473local orderdeps := \
474 $($(target)_ORDERDEPS.$(bld_trg_cpu)) \
475 $($(target)_ORDERDEPS.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
476 $($(target)_ORDERDEPS.$(bld_trg).$(bld_trg_arch)) \
477 $($(target)_ORDERDEPS.$(bld_trg).$(bld_type)) \
478 $($(target)_ORDERDEPS.$(bld_trg_arch)) \
479 $($(target)_ORDERDEPS.$(bld_trg)) \
480 $($(target)_ORDERDEPS.$(bld_type)) \
481 $($(target)_ORDERDEPS) \
482 $($(target)_LNK_ORDERDEPS.$(bld_trg_cpu)) \
483 $($(target)_LNK_ORDERDEPS.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
484 $($(target)_LNK_ORDERDEPS.$(bld_trg).$(bld_trg_arch)) \
485 $($(target)_LNK_ORDERDEPS.$(bld_trg).$(bld_type)) \
486 $($(target)_LNK_ORDERDEPS.$(bld_trg_arch)) \
487 $($(target)_LNK_ORDERDEPS.$(bld_trg)) \
488 $($(target)_LNK_ORDERDEPS.$(bld_type)) \
489 $($(target)_LNK_ORDERDEPS)
490
491# Adjust paths if we got a default path.
492ifneq ($(defpath),)
493 local deps := $(abspathex $(deps),$(defpath))
494 local orderdeps := $(abspathex $(orderdeps),$(defpath))
495 othersrc := $(abspathex $(othersrc),$(defpath))
496endif
497
498
499# Custom pre-link actions.
500local pre_cmds := $(evalcall def_fn_prop_get_first_defined,PRE_CMDS)
501local post_cmds := $(evalcall def_fn_prop_get_first_defined,POST_CMDS)
502
503# eliminate this guy?
504local objs = $($(target)_2_OBJS)
505
506# dependency file
507local dep := $(out)$(SUFF_DEP)
508ifndef NO_LINK_CMDS_DEPS
509 _DEPFILES_INCLUDED += $(dep)
510 ifdef KB_HAVE_INCLUDEDEP_QUEUE
511 includedep-queue $(dep)
512 else
513 includedep $(dep)
514 endif
515endif
516
517# check that the tool is defined.
518ifndef TOOL_$(tool)_LINK_LIBRARY_CMDS
519$(warning kBuild: tools: \
520 1 $($(target)_$(source)TOOL.$(bld_trg).$(bld_trg_arch)) \
521 2 $($(target)_$(source)TOOL.$(bld_trg)) \
522 3 $($(target)_$(source)TOOL) \
523 4 $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \
524 5 $($(target)_TOOL.$(bld_trg)) \
525 6 $($(target)_TOOL) \
526 7 $($(source)TOOL) \
527 8 $($(source)TOOL.$(bld_trg).$(bld_trg_arch)) \
528 9 $($(source)TOOL.$(bld_trg)) \
529 10 $(TOOL.$(bld_trg).$(bld_trg_arch)) \
530 11 $(TOOL.$(bld_trg)) \
531 12 $(TOOL) )
532$(error kBuild: TOOL_$(tool)_LINK_LIBRARY_CMDS isn't defined! target=$(target) )
533endif
534
535# call the tool
536local cmds := $(TOOL_$(tool)_LINK_LIBRARY_CMDS)
537ifneq ($(pre_cmds),)
538 local cmds := $(TAB)$(pre_cmds)$(NL)$(TAB)$(cmds)
539endif
540ifneq ($(post_cmds),)
541 local cmds := $(cmds)$(NL)$(TAB)$(post_cmds)
542endif
543$(target)_2_OUTPUT := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT)
544$(target)_2_OUTPUT_MAYBE := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT_MAYBE)
545$(target)_2_DEPEND := $(TOOL_$(tool)_LINK_LIBRARY_DEPEND) $(deps) $($(target)_2_OBJS)
546$(target)_2_DEPORD := $(TOOL_$(tool)_LINK_LIBRARY_DEPORD) $(dirdep) $(orderdeps)
547
548# generate the link rule.
549$(eval $(def_link_rule))
550
551# installing and globals.
552local target_type_mode := a+r,u+w
553$(evalval def_target_install_only)
554
555_OUT_FILES += $($(target)_2_OUTPUT) $($(target)_2_OUTPUT_MAYBE) $(out)
556_CLEAN_FILES += $($(target)_CLEAN) $($(target)_CLEAN.$(bld_trg)) $($(target)_CLEAN.$(bld_trg).$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_cpu)) $($(target)_CLEAN.$(bld_type))
557_DIRS += $($(target)_BLDDIRS) $($(target)_BLDDIRS.$(bld_trg)) $($(target)_BLDDIRS.$(bld_trg).$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_cpu)) $($(target)_BLDDIRS.$(bld_type))
558_OBJS += $($(target)_2_OBJS)
559
560endef # def_lib
561$(eval-opt-var def_lib)
562
563# Process libraries
564typevar := _LIBS
565tool_do := LINK_LIBRARY
566mode := 0644
567$(foreach target, $(_ALL_LIBRARIES), $(evalval def_lib))
568
569ifdef KBUILD_PROFILE_SELF
570 $(evalcall def_profile_self, done library targets)
571endif
572
573
574#
575# Link operations.
576#
577
578##
579# Link prolog
580#
581# @param $(target) Normalized target name.
582# @param $(EXT) EXE,DLL,SYS.
583# @param $(typevar) The name of the variable with all the root targets of its type.
584define def_link_common
585# basics
586local bld_type := $(firstword $($(target)_BLD_TYPE) $(KBUILD_TYPE))
587local bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_$(bld_trg_base_var)))
588local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH))
589local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_$(bld_trg_base_var)_CPU))
590
591local tool := $(call _TARGET_TOOL,$(target),LD)
592local name := $(firstword\
593 $($(target)_NAME.$(bld_trg).$(bld_trg_arch).$(bld_type))\
594 $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
595 $($(target)_NAME.$(bld_trg).$(bld_type))\
596 $($(target)_NAME.$(bld_trg_arch))\
597 $($(target)_NAME.$(bld_trg))\
598 $($(target)_NAME.$(bld_type))\
599 $($(target)_NAME)\
600 $(target))
601local outbase := $(call TARGET_BASE,$(name),$(target))
602$(target)_0_OUTDIR:= $(patsubst %/,%,$(dir $(outbase)))
603$(call KB_FN_ASSIGN_DEPRECATED,PATH_$(target),$($(target)_0_OUTDIR), $(target)_0_OUTDIR)
604local suff := $(firstword \
605 $($(target)_$(EXT)SUFF.$(bld_trg).$(bld_trg_arch))\
606 $($(target)_$(EXT)SUFF.$(bld_trg))\
607 $($(target)_$(EXT)SUFF)\
608 $(TOOL_$(tool)_LD$(EXT)SUFF.$(bld_trg).$(bld_trg_arch))\
609 $(TOOL_$(tool)_LD$(EXT)SUFF.$(bld_trg))\
610 $(TOOL_$(tool)_LD$(EXT)SUFF)\
611 $($(EXTPRE)SUFF_$(EXT)) )
612local out := $(outbase)$(suff)
613$(target)_1_TARGET:= $(out)
614$(call KB_FN_ASSIGN_DEPRECATED,TARGET_$(target),$($(target)_1_TARGET), $(target)_1_TARGET)
615local defpath := $($(target)_DEFPATH)
616ifeq ($(defpath),)
617 local defpath := $($(target)_PATH)
618endif
619# no local here - must be writable across some foreachs.
620othersrc :=
621$(target)_2_OBJS :=
622
623# Do units pre source callouts.
624local units := \
625 $($(target)_USES.$(bld_trg).$(bld_trg_arch))\
626 $($(target)_USES.$(bld_trg_arch))\
627 $($(target)_USES.$(bld_trg))\
628 $($(target)_USES.$(bld_type))\
629 $($(target)_USES)
630$(foreach unit,$(units),$(evalval def_unit_$(unit)_target_pre))
631
632# source -> object
633$(evalval def_target_sources)
634
635# more link stuff.
636local tool := $(call _TARGET_TOOL,$(target),LD)
637local name := $(firstword\
638 $($(target)_NAME.$(bld_trg).$(bld_trg_arch).$(bld_type))\
639 $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
640 $($(target)_NAME.$(bld_trg).$(bld_type))\
641 $($(target)_NAME.$(bld_trg_arch))\
642 $($(target)_NAME.$(bld_trg))\
643 $($(target)_NAME.$(bld_type))\
644 $($(target)_NAME)\
645 $(target))
646local outbase := $(call TARGET_BASE,$(name),$(target))
647local flags :=\
648 $(TOOL_$(tool)_LDFLAGS)\
649 $(TOOL_$(tool)_LDFLAGS.$(bld_type))\
650 $(TOOL_$(tool)_LDFLAGS.$(bld_trg))\
651 $(TOOL_$(tool)_LDFLAGS.$(bld_trg_arch))\
652 $(TOOL_$(tool)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\
653 $(TOOL_$(tool)_LDFLAGS.$(bld_trg_cpu))\
654 $(foreach sdk, $(SDKS) \
655 $(SDKS.$(bld_type)) \
656 $(SDKS.$(bld_trg)) \
657 $(SDKS.$(bld_trg_arch)) \
658 $(SDKS.$(bld_trg).$(bld_trg_arch)),\
659 $(SDK_$(sdk)_LDFLAGS)\
660 $(SDK_$(sdk)_LDFLAGS.$(bld_type))\
661 $(SDK_$(sdk)_LDFLAGS.$(bld_trg))\
662 $(SDK_$(sdk)_LDFLAGS.$(bld_trg_arch))\
663 $(SDK_$(sdk)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\
664 $(SDK_$(sdk)_LDFLAGS.$(bld_trg_cpu)))\
665 $(LDFLAGS)\
666 $(LDFLAGS.$(bld_type))\
667 $(LDFLAGS.$(bld_trg))\
668 $(LDFLAGS.$(bld_trg_arch))\
669 $(LDFLAGS.$(bld_trg).$(bld_trg_arch))\
670 $(LDFLAGS.$(bld_trg_cpu))\
671 $(foreach sdk, $($(target)_SDKS) \
672 $($(target)_SDKS.$(bld_type)) \
673 $($(target)_SDKS.$(bld_trg)) \
674 $($(target)_SDKS.$(bld_trg_arch)) \
675 $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)),\
676 $(SDK_$(sdk)_LDFLAGS)\
677 $(SDK_$(sdk)_LDFLAGS.$(bld_type))\
678 $(SDK_$(sdk)_LDFLAGS.$(bld_trg))\
679 $(SDK_$(sdk)_LDFLAGS.$(bld_trg_arch))\
680 $(SDK_$(sdk)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\
681 $(SDK_$(sdk)_LDFLAGS.$(bld_trg_cpu)))\
682 $($(target)_LDFLAGS)\
683 $($(target)_LDFLAGS.$(bld_type))\
684 $($(target)_LDFLAGS.$(bld_trg))\
685 $($(target)_LDFLAGS.$(bld_trg_arch))\
686 $($(target)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\
687 $($(target)_LDFLAGS.$(bld_trg_cpu))
688local libs :=\
689 $($(target)_LIBS.$(bld_trg_cpu))\
690 $($(target)_LIBS.$(bld_trg).$(bld_trg_arch))\
691 $($(target)_LIBS.$(bld_trg_arch))\
692 $($(target)_LIBS.$(bld_trg))\
693 $($(target)_LIBS.$(bld_type))\
694 $($(target)_LIBS)\
695 $(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \
696 $($(target)_SDKS.$(bld_trg_arch)) \
697 $($(target)_SDKS.$(bld_trg)) \
698 $($(target)_SDKS.$(bld_type)) \
699 $($(target)_SDKS),\
700 $(SDK_$(sdk)_LIBS.$(bld_trg_cpu))\
701 $(SDK_$(sdk)_LIBS.$(bld_trg).$(bld_trg_arch))\
702 $(SDK_$(sdk)_LIBS.$(bld_trg_arch))\
703 $(SDK_$(sdk)_LIBS.$(bld_trg))\
704 $(SDK_$(sdk)_LIBS.$(bld_type))\
705 $(SDK_$(sdk)_LIBS))\
706 $(LIBS.$(bld_trg_cpu))\
707 $(LIBS.$(bld_trg).$(bld_trg_arch))\
708 $(LIBS.$(bld_trg_arch))\
709 $(LIBS.$(bld_trg))\
710 $(LIBS.$(bld_type))\
711 $(LIBS)\
712 $(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \
713 $(SDKS.$(bld_trg_arch)) \
714 $(SDKS.$(bld_trg)) \
715 $(SDKS.$(bld_type)) \
716 $(SDKS),\
717 $(SDK_$(sdk)_LIBS.$(bld_trg_cpu))\
718 $(SDK_$(sdk)_LIBS.$(bld_trg).$(bld_trg_arch))\
719 $(SDK_$(sdk)_LIBS.$(bld_trg_arch))\
720 $(SDK_$(sdk)_LIBS.$(bld_trg))\
721 $(SDK_$(sdk)_LIBS.$(bld_type))\
722 $(SDK_$(sdk)_LIBS))\
723 $(TOOL_$(tool)_LIBS.$(bld_trg_cpu))\
724 $(TOOL_$(tool)_LIBS.$(bld_trg).$(bld_trg_arch))\
725 $(TOOL_$(tool)_LIBS.$(bld_trg_arch))\
726 $(TOOL_$(tool)_LIBS.$(bld_trg))\
727 $(TOOL_$(tool)_LIBS.$(bld_type))\
728 $(TOOL_$(tool)_LIBS)
729local libpath :=\
730 $($(target)_LIBPATH.$(bld_trg_cpu))\
731 $($(target)_LIBPATH.$(bld_trg).$(bld_trg_arch))\
732 $($(target)_LIBPATH.$(bld_trg_arch))\
733 $($(target)_LIBPATH.$(bld_trg))\
734 $($(target)_LIBPATH.$(bld_type))\
735 $($(target)_LIBPATH)\
736 $(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \
737 $($(target)_SDKS.$(bld_trg_arch)) \
738 $($(target)_SDKS.$(bld_trg)) \
739 $($(target)_SDKS.$(bld_type)) \
740 $($(target)_SDKS),\
741 $(SDK_$(sdk)_LIBPATH.$(bld_trg_cpu))\
742 $(SDK_$(sdk)_LIBPATH.$(bld_trg).$(bld_trg_arch))\
743 $(SDK_$(sdk)_LIBPATH.$(bld_trg_arch))\
744 $(SDK_$(sdk)_LIBPATH.$(bld_trg))\
745 $(SDK_$(sdk)_LIBPATH.$(bld_type))\
746 $(SDK_$(sdk)_LIBPATH))\
747 $(LIBPATH.$(bld_trg_cpu))\
748 $(LIBPATH.$(bld_trg).$(bld_trg_arch))\
749 $(LIBPATH.$(bld_trg_arch))\
750 $(LIBPATH.$(bld_trg))\
751 $(LIBPATH.$(bld_type))\
752 $(LIBPATH)\
753 $(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \
754 $(SDKS.$(bld_trg_arch)) \
755 $(SDKS.$(bld_trg)) \
756 $(SDKS.$(bld_type)) \
757 $(SDKS),\
758 $(SDK_$(sdk)_LIBPATH.$(bld_trg_cpu))\
759 $(SDK_$(sdk)_LIBPATH.$(bld_trg).$(bld_trg_arch))\
760 $(SDK_$(sdk)_LIBPATH.$(bld_trg_arch))\
761 $(SDK_$(sdk)_LIBPATH.$(bld_trg))\
762 $(SDK_$(sdk)_LIBPATH.$(bld_type))\
763 $(SDK_$(sdk)_LIBPATH))\
764 $(TOOL_$(tool)_LIBPATH.$(bld_trg_cpu))\
765 $(TOOL_$(tool)_LIBPATH.$(bld_trg).$(bld_trg_arch))\
766 $(TOOL_$(tool)_LIBPATH.$(bld_trg_arch))\
767 $(TOOL_$(tool)_LIBPATH.$(bld_trg))\
768 $(TOOL_$(tool)_LIBPATH.$(bld_type))\
769 $(TOOL_$(tool)_LIBPATH)
770local dirdep := $(call DIRDEP,$(dir $(out)))
771local deps := \
772 $($(target)_DEPS.$(bld_trg_cpu)) \
773 $($(target)_DEPS.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
774 $($(target)_DEPS.$(bld_trg).$(bld_trg_arch)) \
775 $($(target)_DEPS.$(bld_trg).$(bld_type)) \
776 $($(target)_DEPS.$(bld_trg_arch)) \
777 $($(target)_DEPS.$(bld_trg)) \
778 $($(target)_DEPS.$(bld_type)) \
779 $($(target)_DEPS) \
780 $($(target)_LNK_DEPS.$(bld_trg_cpu)) \
781 $($(target)_LNK_DEPS.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
782 $($(target)_LNK_DEPS.$(bld_trg).$(bld_trg_arch)) \
783 $($(target)_LNK_DEPS.$(bld_trg).$(bld_type)) \
784 $($(target)_LNK_DEPS.$(bld_trg_arch)) \
785 $($(target)_LNK_DEPS.$(bld_trg)) \
786 $($(target)_LNK_DEPS.$(bld_type)) \
787 $($(target)_LNK_DEPS)
788local orderdeps := \
789 $($(target)_ORDERDEPS.$(bld_trg_cpu)) \
790 $($(target)_ORDERDEPS.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
791 $($(target)_ORDERDEPS.$(bld_trg).$(bld_trg_arch)) \
792 $($(target)_ORDERDEPS.$(bld_trg).$(bld_type)) \
793 $($(target)_ORDERDEPS.$(bld_trg_arch)) \
794 $($(target)_ORDERDEPS.$(bld_trg)) \
795 $($(target)_ORDERDEPS.$(bld_type)) \
796 $($(target)_ORDERDEPS) \
797 $($(target)_LNK_ORDERDEPS.$(bld_trg_cpu)) \
798 $($(target)_LNK_ORDERDEPS.$(bld_trg).$(bld_trg_arch).$(bld_type)) \
799 $($(target)_LNK_ORDERDEPS.$(bld_trg).$(bld_trg_arch)) \
800 $($(target)_LNK_ORDERDEPS.$(bld_trg).$(bld_type)) \
801 $($(target)_LNK_ORDERDEPS.$(bld_trg_arch)) \
802 $($(target)_LNK_ORDERDEPS.$(bld_trg)) \
803 $($(target)_LNK_ORDERDEPS.$(bld_type)) \
804 $($(target)_LNK_ORDERDEPS)
805
806# Adjust paths if we got a default path.
807ifneq ($(defpath),)
808 local libpath := $(abspathex $(libpath),$(defpath))
809 local deps := $(abspathex $(deps),$(defpath))
810 local orderdeps := $(abspathex $(orderdeps),$(defpath))
811 othersrc := $(abspathex $(othersrc),$(defpath))
812 # libs are not subject to this because of the the -l<lib> stuff. Use $(<target>_DEFPATH)/lib if relative to current dir!
813endif
814
815# Custom pre/post-link actions.
816local pre_cmds := $(evalcall def_fn_prop_get_first_defined,PRE_CMDS)
817local post_cmds := $(evalcall def_fn_prop_get_first_defined,POST_CMDS)
818
819# eliminate this guy?
820local objs = $($(target)_2_OBJS)
821
822# installation targets
823local target_type_mode :=
824$(evalval def_target_install_only)
825
826# dependency file
827local dep := $(outbase)$(SUFF_DEP)
828ifndef NO_LINK_CMDS_DEPS
829 _DEPFILES_INCLUDED += $(dep)
830 ifdef KB_HAVE_INCLUDEDEP_QUEUE
831 includedep-queue $(dep)
832 else
833 includedep $(dep)
834 endif
835endif
836
837# check that the tool is defined.
838ifndef TOOL_$(tool)_$(tool_do)_CMDS
839$(warning kBuild: tools: \
840 1 $($(target)_$(source)TOOL.$(bld_trg).$(bld_trg_arch)) \
841 2 $($(target)_$(source)TOOL.$(bld_trg)) \
842 3 $($(target)_$(source)TOOL) \
843 4 $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \
844 5 $($(target)_TOOL.$(bld_trg)) \
845 6 $($(target)_TOOL) \
846 7 $($(source)TOOL.$(bld_trg).$(bld_trg_arch)) \
847 8 $($(source)TOOL.$(bld_trg)) \
848 9 $($(source)TOOL) \
849 10 $(TOOL.$(bld_trg).$(bld_trg_arch)) \
850 11 $(TOOL.$(bld_trg)) \
851 12 $(TOOL) )
852$(error kBuild: TOOL_$(tool)_$(tool_do)_CMDS isn't defined! target=$(target) )
853endif
854
855# call the tool
856local cmds := $(TOOL_$(tool)_$(tool_do)_CMDS)
857ifneq ($(pre_cmds),)
858 local cmds := $(TAB)$(pre_cmds)$(NL)$(TAB)$(cmds)
859endif
860ifneq ($(post_cmds),)
861 local cmds := $(cmds)$(NL)$(TAB)$(post_cmds)
862endif
863$(target)_2_OUTPUT := $(TOOL_$(tool)_$(tool_do)_OUTPUT)
864$(target)_2_OUTPUT_MAYBE := $(TOOL_$(tool)_$(tool_do)_OUTPUT_MAYBE)
865$(target)_2_DEPEND := $(TOOL_$(tool)_$(tool_do)_DEPEND) $(deps) $($(target)_2_OBJS)
866$(target)_2_DEPORD := $(TOOL_$(tool)_$(tool_do)_DEPORD) $(dirdep) $(orderdeps)
867
868# generate the link rule.
869$(eval $(def_link_rule))
870
871
872# Update globals.
873_OBJS += $($(target)_2_OBJS)
874_OUT_FILES += $($(target)_2_OUTPUT) $($(target)_2_OUTPUT_MAYBE) $(out)
875_CLEAN_FILES += $($(target)_CLEAN) $($(target)_CLEAN.$(bld_trg)) $($(target)_CLEAN.$(bld_trg).$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_cpu)) $($(target)_CLEAN.$(bld_type))
876_DIRS += $($(target)_BLDDIRS) $($(target)_BLDDIRS.$(bld_trg)) $($(target)_BLDDIRS.$(bld_trg).$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_cpu)) $($(target)_BLDDIRS.$(bld_type))
877_INSTALLS_FILES += $(INSTARGET_$(target))
878
879endef # def_link_common
880$(eval-opt-var def_link_common)
881
882
883#
884# BLDPROGS
885#
886
887# Process build programs.
888EXT := EXE
889EXTPRE := HOST
890tool_do := LINK_PROGRAM
891typevar := _BLDPROGS
892mode := 0755
893bld_trg_base_var := PLATFORM
894$(foreach target, $(_ALL_BLDPROGS), $(evalval def_link_common))
895
896ifdef KBUILD_PROFILE_SELF
897 $(evalcall def_profile_self, done build program targets)
898endif
899
900
901#
902# DLLS
903#
904
905# Process dlls
906EXT := DLL
907EXTPRE :=
908tool_do := LINK_DLL
909typevar := _DLLS
910mode := 0644
911bld_trg_base_var := TARGET
912$(foreach target, $(_ALL_DLLS), $(evalval def_link_common))
913
914ifdef KBUILD_PROFILE_SELF
915 $(evalcall def_profile_self, done dll targets)
916endif
917
918
919#
920# IMPORT LIBRARIES
921#
922# - On OS/2 and windows these are libraries.
923# - On other platforms they are fake DLLs.
924#
925EXTPRE :=
926typevar := _IMPORT_LIBS
927mode := 0644
928bld_trg_base_var := TARGET
929ifeq ($(filter-out nt os2 win win64 win32,$(KBUILD_TARGET)),)
930 EXT := LIB
931 tool_do := LINK_LIBRARY
932 $(foreach target, $(_ALL_IMPORT_LIBS), $(evalval def_lib))
933else
934 EXT := DLL
935 tool_do := LINK_DLL
936 $(foreach target, $(_ALL_IMPORT_LIBS), $(evalval def_link_common))
937endif
938
939ifdef KBUILD_PROFILE_SELF
940 $(evalcall def_profile_self, done import library targets)
941endif
942
943
944#
945# PROGRAMS
946#
947
948# Process programs
949EXT := EXE
950EXTPRE :=
951tool_do := LINK_PROGRAM
952typevar := _PROGRAMS
953mode := 0755
954bld_trg_base_var := TARGET
955$(foreach target, $(_ALL_PROGRAMS), $(evalval def_link_common))
956
957ifdef KBUILD_PROFILE_SELF
958 $(evalcall def_profile_self, done program targets)
959endif
960
961
962#
963# SYSMODS
964#
965
966# Process sysmods
967EXT := SYS
968EXTPRE :=
969tool_do := LINK_SYSMOD
970typevar := _SYSMODS
971mode := 0644
972bld_trg_base_var := TARGET
973$(foreach target, $(_ALL_SYSMODS), $(evalval def_link_common))
974
975ifdef KBUILD_PROFILE_SELF
976 $(evalcall def_profile_self, done sysmod targets)
977endif
978
979
980#
981# MISCBINS
982#
983
984# Process MISCBINS
985EXT := BIN
986EXTPRE :=
987tool_do := LINK_MISCBIN
988typevar := _MISCBINS
989mode := 0644
990bld_trg_base_var := TARGET
991$(foreach target, $(_ALL_MISCBINS), $(evalval def_link_common))
992
993ifdef KBUILD_PROFILE_SELF
994 $(evalcall def_profile_self, done misc binary targets)
995endif
996
Note: See TracBrowser for help on using the repository browser.