Lines Matching +full:multi +full:-
5 # SPDX-License-Identifier: GPL-2.0
8 # Modified for U-Boot
25 obj-y :=
26 obj-m :=
27 lib-y :=
28 lib-m :=
31 subdir-y :=
32 subdir-m :=
37 asflags-y :=
38 ccflags-y :=
39 cppflags-y :=
40 ldflags-y :=
42 subdir-asflags-y :=
43 subdir-ccflags-y :=
46 # Modified for U-Boot
47 -include include/config/auto.conf
48 -include $(prefix)/include/autoconf.mk
54 save-cflags := $(CFLAGS)
57 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
58 kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
59 include $(kbuild-file)
61 # Added for U-Boot
62 asflags-y += $(PLATFORM_CPPFLAGS)
63 ccflags-y += $(PLATFORM_CPPFLAGS)
64 cppflags-y += $(PLATFORM_CPPFLAGS)
66 # If the save-* variables changed error out
68 ifneq ("$(save-cflags)","$(CFLAGS)")
69 $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use ccflags-y)
75 ifdef host-progs
76 ifneq ($(hostprogs-y),$(host-progs))
77 $(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please replace with hostprog…
78 hostprogs-y += $(host-progs)
83 ifneq ($(hostprogs-y)$(hostprogs-m),)
87 # Uncommented for U-Boot
88 # We need to create output dicrectory for SPL and TPL even for in-tree build
91 _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
94 # Needed when obj-y := dir/file.o syntax is used
95 _dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
104 ifneq ($(strip $(lib-y) $(lib-m) $(lib-)),)
105 lib-target := $(obj)/lib.a
108 ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),)
109 builtin-target := $(obj)/built-in.o
112 modorder-target := $(obj)/modules.order
116 __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
117 $(if $(KBUILD_MODULES),$(obj-m) $(modorder-target)) \
118 $(subdir-ym) $(always)
132 # Do section mismatch analysis for each module/built-in.o
138 # ---------------------------------------------------------------------------
140 # Default is built-in, unless we know otherwise
142 $(if $(part-of-module), \
147 $(real-objs-m) : part-of-module := y
148 $(real-objs-m:.o=.i) : part-of-module := y
149 $(real-objs-m:.o=.s) : part-of-module := y
150 $(real-objs-m:.o=.lst): part-of-module := y
152 $(real-objs-m) : quiet_modtag := [M]
153 $(real-objs-m:.o=.i) : quiet_modtag := [M]
154 $(real-objs-m:.o=.s) : quiet_modtag := [M]
155 $(real-objs-m:.o=.lst): quiet_modtag := [M]
157 $(obj-m) : quiet_modtag := [M]
159 # Default for not multi-part modules
162 $(multi-objs-m) : modname = $(modname-multi)
163 $(multi-objs-m:.o=.i) : modname = $(modname-multi)
164 $(multi-objs-m:.o=.s) : modname = $(modname-multi)
165 $(multi-objs-m:.o=.lst) : modname = $(modname-multi)
166 $(multi-objs-y) : modname = $(modname-multi)
167 $(multi-objs-y:.o=.i) : modname = $(modname-multi)
168 $(multi-objs-y:.o=.s) : modname = $(modname-multi)
169 $(multi-objs-y:.o=.lst) : modname = $(modname-multi)
172 cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<
178 cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
184 $(CPP) -D__GENKSYMS__ $(c_flags) $< | \
185 $(GENKSYMS) $(if $(1), -T $(2)) \
186 $(patsubst y,-s _,$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX)) \
187 $(if $(KBUILD_PRESERVE),-p) \
188 -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null))
192 set -e; \
194 test -s $@ || rm -f $@
206 cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
221 cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
223 if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
227 $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
228 -T $(@D)/.tmp_$(@F:.o=.ver); \
229 rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
231 mv -f $(@D)/.tmp_$(@F) $@; \
238 RECORDMCOUNT_FLAGS = -w
251 sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
256 "$(if $(part-of-module),1,0)" "$(@)";
267 $(call echo-cmd,checksrc) $(cmd_checksrc) \
268 $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
270 $(call echo-cmd,record_mcount) \
272 scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
273 $(dot-target).tmp; \
274 rm -f $(depfile); \
275 mv -f $(dot-target).tmp $(dot-target).cmd
278 # Built-in and composite module parts
283 # Single-part modules are special since we need to mark them in $(MODVERDIR)
285 $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE
291 cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \
299 # ---------------------------------------------------------------------------
303 $(real-objs-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
304 $(real-objs-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
307 cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
313 cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
318 targets += $(real-objs-y) $(real-objs-m) $(lib-y)
319 targets += $(extra-y) $(MAKECMDGOALS) $(always)
321 # Linker scripts preprocessor (.lds.S -> .lds)
322 # ---------------------------------------------------------------------------
324 cmd_cpp_lds_S = $(CPP) $(cpp_flags) -P -C -U$(ARCH) \
325 -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $<
331 # ---------------------------------------------------------------------------
336 .PRECIOUS: $(objtree)/$(obj)/%-asn1.c $(objtree)/$(obj)/%-asn1.h
338 $(obj)/%-asn1.c $(obj)/%-asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler
341 # Build the compiled-in targets
342 # ---------------------------------------------------------------------------
345 $(sort $(subdir-obj-y)): $(subdir-ym) ;
350 ifdef builtin-target
352 # If the list of objects to link is empty, just create an empty built-in.o
353 cmd_link_o_target = $(if $(strip $(obj-y)),\
354 $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \
356 rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@)
358 $(builtin-target): $(obj-y) FORCE
361 targets += $(builtin-target)
362 endif # builtin-target
369 modorder-cmds = \
374 $(modorder-target): $(subdir-ym) FORCE
375 $(Q)(cat /dev/null; $(modorder-cmds)) > $@
380 ifdef lib-target
382 cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y)
384 $(lib-target): $(lib-y) FORCE
387 targets += $(lib-target)
394 # <composite-object>-objs := <list of .o files>
396 # <composite-object>-y := <list of .o files>
399 $($(subst $(obj)/,,$(@:.o=-objs))) \
400 $($(subst $(obj)/,,$(@:.o=-y)))), $^)
402 quiet_cmd_link_multi-y = LD $@
403 cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
405 quiet_cmd_link_multi-m = LD [M] $@
406 cmd_link_multi-m = $(cmd_link_multi-y)
408 $(multi-used-y): FORCE
409 $(call if_changed,link_multi-y)
410 $(call multi_depend, $(multi-used-y), .o, -objs -y)
412 $(multi-used-m): FORCE
413 $(call if_changed,link_multi-m)
415 $(call multi_depend, $(multi-used-m), .o, -objs -y)
417 targets += $(multi-used-y) $(multi-used-m)
421 # ---------------------------------------------------------------------------
423 PHONY += $(subdir-ym)
424 $(subdir-ym):
428 # ---------------------------------------------------------------------------