2 # Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
5 .SUFFIXES: .c .S .o .os .oS .so .a .s .i
9 .PHONY: dummy $(PHONY) subdirs \
10 all $(clean_targets) \
11 config dist menuconfig oldconfig release \
14 # order is important, the stripping uses STRIP_FLAGS for lib-so, but not for lib-a
15 ifeq ($(HAVE_SHARED),y)
16 .LIBPATTERNS: "lib%.so"
17 libs: $(lib-so-y) $(lib-a-y)
18 $(lib-so-y): | $(interp)
20 .LIBPATTERNS: "lib%.a"
21 ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
30 $(lib-so-y) $(lib-a-y): | $(top_builddir)lib
32 # apply unconditional per-directory flags
34 ifneq ($(strip $(2)),)
35 __add_IS_IN_lib := $(2)
36 __add_IS_IN_lib += $(2:.o=.i) $(2:.os=.i) $(2:.oS=.i)
37 __add_IS_IN_lib += $(2:.o=.s) $(2:.os=.s) $(2:.oS=.s)
38 $$(__add_IS_IN_lib): CFLAGS-for-library-members:=$(CFLAGS-$(1)) -DIN_LIB=$(word 1,$(subst /, ,$(1)))
41 $(eval $(call add_IS_IN_lib,rtld,$(ldso-y)))
42 $(eval $(call add_IS_IN_lib,libc,$(libc-y) $(libc-static-y) $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y)))
43 $(eval $(call add_IS_IN_lib,libcrypt,$(libcrypt-a-y) $(libcrypt-so-y)))
44 $(eval $(call add_IS_IN_lib,libdl,$(libdl-a-y) $(libdl-so-y)))
45 $(eval $(call add_IS_IN_lib,libm,$(libm-a-y) $(libm-so-y)))
46 $(eval $(call add_IS_IN_lib,libpthread/$(PTNAME),$(libpthread-a-y) $(libpthread-so-y) $(libpthread-nonshared-y)))
47 $(eval $(call add_IS_IN_lib,libpthread/$(PTNAME)_db,$(libthread_db-a-y) $(libthread_db-so-y)))
48 $(eval $(call add_IS_IN_lib,librt,$(librt-a-y) $(librt-so-y)))
49 $(eval $(call add_IS_IN_lib,libutil,$(libutil-a-y) $(libutil-so-y)))
50 $(eval $(call add_IS_IN_lib,libubacktrace,$(libubacktrace-a-y) $(libubacktrace-so-y)))
51 $(eval $(call add_IS_IN_lib,libuargp,$(libuargp-a-y) $(libuargp-so-y)))
52 $(eval $(call add_IS_IN_lib,libiconv,$(libiconv-a-y) $(libiconv-so-y)))
53 $(eval $(call add_IS_IN_lib,libintl,$(libintl-a-y) $(libintl-so-y)))
55 shared_objs = $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y) \
56 $(libcrypt-so-y) $(libdl-so-y) $(libm-so-y) \
57 $(libpthread-so-y) $(libpthread-nonshared-y) $(libthread_db-so-y) \
58 $(librt-so-y) $(ldso-y) $(libutil-so-y) $(libubacktrace-so-y) \
59 $(libuargp-so-y) $(libiconv-so-y) $(libintl-so-y)
61 ar_objs = $(libc-y) $(libc-static-y) $(libcrypt-a-y) \
62 $(libdl-a-y) $(libm-a-y) $(libpthread-a-y) $(libthread_db-a-y) \
63 $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y) $(libuargp-a-y) \
64 $(libiconv-a-y) $(libintl-a-y)
66 ar_objs := $(ar_objs:.o=.os)
68 flat_objs = $(lib-gdb-y)
70 ifeq ($(HAVE_SHARED),y)
71 all_objs: $(sort $(shared_objs) $(ar_objs))
75 $(shared_objs) $(ar_objs): | $(sub_headers)
77 define objects_with_syms
78 $(foreach o,$(2),$(if $(shell $(NM) $(1) $(o) | grep .),$(o)))
81 headers-y: $(headers-y)
84 MAKEFLAGS += --no-print-directory
87 $(shell $(CONFIG_SHELL) $(top_srcdir)/extra/scripts/relative_path.sh $(@D) .)
89 ifneq ($(findstring s,$(MAKEFLAGS)),)
90 export MAKE_IS_SILENT := y
95 export MAKE_IS_SILENT := n
97 ifneq ($(V)$(VERBOSE),)
99 DISP := bri# brief, like pur but with defines
102 SHELL_SET_X := set -x
112 show_objs = $(subst $(top_builddir),,$(subst ../,,$@))
117 $(subst $(comma), ,$(subst -Wl$(comma),,$(filter -Wl%,$(1))))
120 pur_disp_compile.c = echo " "CC $(show_objs)
121 pur_disp_compile.i = echo " "CPP $(show_objs)
122 pur_disp_compile.s = echo " "CC-S $(show_objs)
123 pur_disp_compile.u = echo " "CC $(show_objs)
124 pur_disp_compile.S = echo " "AS $(show_objs)
125 pur_disp_compile.m = $(pur_disp_compile.c)
126 pur_disp_compile.mi= echo " "CPP-m $(show_objs)
127 pur_disp_compile-m = echo " "CC-m $(show_objs)
128 pur_disp_hcompile.u= echo " "HOSTCC $(show_objs)
129 pur_disp_hcompile.o= echo " "HOSTCC-o $(show_objs)
130 pur_disp_strip = echo " "STRIP $(STRIP_FLAGS) $@
131 pur_disp_t_strip = echo " "STRIP $(STRIP_FLAGS) $@
132 pur_disp_ar = echo " "AR $(ARFLAGS) $@
133 pur_disp_ld = echo " "LD $(1)
134 pur_disp_ln = echo " "LN $(show_objs)
135 pur_disp_mkdir = echo " "MKDIR $(show_objs)
136 pur_disp_gen = echo " "GEN $(show_objs)
137 pur_disp_install = echo " "INSTALL $(1)
138 pur_disp_unifdef = echo " "UNIFDEF $(show_objs)
139 pur_disp_rm = echo " "CLEAN $(subst CLEAN_,,$(patsubst HEADERCLEAN_%,include \(%\),$@))
141 sil_disp_compile.c = true
142 sil_disp_compile.i = true
143 sil_disp_compile.s = true
144 sil_disp_compile.u = true
145 sil_disp_compile.S = true
146 sil_disp_compile.m = true
147 sil_disp_compile.mi= true
148 sil_disp_compile-m = true
149 sil_disp_hcompile.u= true
150 sil_disp_hcompile.o= true
151 sil_disp_strip = true
152 sil_disp_t_strip = true
156 sil_disp_mkdir = true
158 sil_disp_install = true
159 sil_disp_unifdef = true
162 bri_disp_compile.c = $(pur_disp_compile.c) $(call show_defs,$(cmd_compile.c))
163 bri_disp_compile.i = $(pur_disp_compile.i) $(call show_defs,$(cmd_compile.i))
164 bri_disp_compile.s = $(pur_disp_compile.s) $(call show_defs,$(cmd_compile.s))
165 bri_disp_compile.u = $(pur_disp_compile.u) $(call show_defs,$(cmd_compile.u))
166 bri_disp_compile.S = $(pur_disp_compile.S) $(call show_defs,$(cmd_compile.S))
167 bri_disp_compile.m = $(pur_disp_compile.m) $(call show_defs,$(cmd_compile.m))
168 bri_disp_compile.mi = $(pur_disp_compile.mi) $(call show_defs,$(cmd_compile.mi))
169 bri_disp_compile-m = $(pur_disp_compile-m) $(call show_defs,$(cmd_compile-m))
170 bri_disp_hcompile.u = $(pur_disp_hcompile.u) $(call show_defs,$(cmd_hcompile.u))
171 bri_disp_hcompile.o = $(pur_disp_hcompile.o) $(call show_defs,$(cmd_hcompile.o))
172 bri_disp_strip = $(pur_disp_strip)
173 bri_disp_t_strip = $(pur_disp_t_strip)
174 bri_disp_ar = $(pur_disp_ar)
175 bri_disp_ld = $(pur_disp_ld) $(call show_ldflags,$(cmd_ld))
176 bri_disp_ln = $(pur_disp_ln)
177 bri_disp_mkdir = $(pur_disp_mkdir)
178 bri_disp_gen = $(pur_disp_gen)
179 bri_disp_install = $(pur_disp_install)
180 bri_disp_unifdef = $(pur_disp_unifdef)
181 bri_disp_rm = $(pur_disp_rm)
183 esc=$(subst ','\'',$(1))
185 ver_disp_compile.c = echo '$(call esc,$(cmd_compile.c))'
186 ver_disp_compile.i = echo '$(call esc,$(cmd_compile.i))'
187 ver_disp_compile.s = echo '$(call esc,$(cmd_compile.s))'
188 ver_disp_compile.u = echo '$(call esc,$(cmd_compile.u))'
189 ver_disp_compile.S = echo '$(call esc,$(cmd_compile.S))'
190 ver_disp_compile.m = echo '$(call esc,$(cmd_compile.m))'
191 ver_disp_compile.mi= echo '$(call esc,$(cmd_compile.mi))'
192 ver_disp_compile-m = echo '$(call esc,$(cmd_compile-m))'
193 ver_disp_hcompile.u= echo '$(call esc,$(cmd_hcompile.u))'
194 ver_disp_hcompile.o= echo '$(call esc,$(cmd_hcompile.o))'
195 ver_disp_strip = echo '$(call esc,$(cmd_strip))'
196 ver_disp_t_strip = echo '$(call esc,$(cmd_t_strip))'
197 ver_disp_ar = echo '$(call esc,$(cmd_ar))'
203 ver_disp_unifdef = echo '$(call esc,$(cmd_unifdef))'
206 disp_compile.c = $($(DISP)_disp_compile.c)
207 disp_compile.i = $($(DISP)_disp_compile.i)
208 disp_compile.s = $($(DISP)_disp_compile.s)
209 disp_compile.u = $($(DISP)_disp_compile.u)
210 disp_compile.S = $($(DISP)_disp_compile.S)
211 disp_compile.m = $($(DISP)_disp_compile.m)
212 disp_compile.mi= $($(DISP)_disp_compile.mi)
213 disp_compile-m = $($(DISP)_disp_compile-m)
214 disp_hcompile.u= $($(DISP)_disp_hcompile.u)
215 disp_hcompile.o= $($(DISP)_disp_hcompile.o)
216 disp_strip = $($(DISP)_disp_strip)
217 disp_t_strip = $($(DISP)_disp_t_strip)
218 disp_ar = $($(DISP)_disp_ar)
219 disp_ld = $($(DISP)_disp_ld)
220 disp_ln = $($(DISP)_disp_ln)
221 disp_mkdir = $($(DISP)_disp_mkdir)
222 disp_gen = $($(DISP)_disp_gen)
223 disp_install = $($(DISP)_disp_install)
224 disp_unifdef = $($(DISP)_disp_unifdef)
225 disp_rm = $($(DISP)_disp_rm)
227 any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
229 # ../foo/bar/baz.ext -> foo_bar_baz.ext
230 variablify = $(subst /,_,$(subst $(top_builddir),,$(1)))
231 # strip the top_builddir off everything to make the *string* idempotent for -C
232 dirify = $(subst $(top_builddir),,$(patsubst -L$(top_builddir)%,-L%,$(patsubst -I$(top_builddir)%,-I%,$(1))))
234 # True if not identical. Neither order nor whitespace nor identical flags
237 $(strip $(filter-out $(call dirify,$(cmd_$(call variablify,$(1)))), \
238 $(call dirify,$(cmd_$(call variablify,$(@))))) \
239 $(filter-out $(call dirify,$(cmd_$(call variablify,$(@)))), \
240 $(call dirify,$(cmd_$(call variablify,$(1))))))
242 # Rebuild if any prerequisite, the used CC or flags changed.
243 # Previously used flags are stored in the corresponding .%.dep files
245 $(if $(strip $(compare_flags) $(any-prereq)), \
249 echo 'cmd_$(call variablify,$@) := $(call dirify,$(cmd_$(call variablify,$1)))' >> $(dir $@).$(notdir $@).dep)
251 # collect flags of domulti prereqs
252 #collect_multi_flags = $(CFLAGS-$(notdir $(d))) $(CFLAGS-$(notdir $(patsubst %/,%,$(dir $(d)))))
253 collect_multi_flags = $(CFLAGS-$(notdir $(patsubst %/,%,$(dir $(d)))))
255 #sub_srcdir = $(word 1,$(filter-out lib extra locale libpthread,$(wordlist 1,2,$(subst /, ,$(subst $(top_srcdir),,$(dir $<))))))
257 CFLAGS_gen.dep = -MT $@ -MD -MP -MF $(dir $@).$(notdir $@).dep
259 cmd_compile.c = $(CC) -c $< -o $@ \
260 $(filter-out $(CFLAGS-OMIT-$(notdir $<)), \
262 $(CFLAGS-for-library-members) \
263 $(CFLAGS-$(suffix $@)) \
264 $(CFLAGS-y-$(subst $(top_srcdir),,$(<D))) \
265 $(CFLAGS-$(notdir $<)) \
266 $(CFLAGS-$(notdir $@)) \
269 cmd_compile.i = $(cmd_compile.c:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS)
270 cmd_compile.s = $(cmd_compile.c:-c=-S)
271 cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep)
272 cmd_compile.S = $(filter-out -std=%, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
273 cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
274 cmd_compile.mi= $(cmd_compile.m:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS)
276 cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@)) $(sort $(foreach d,$(^:$(top_srcdir)=),$(collect_multi_flags)))
277 cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^
278 cmd_t_strip = $(STRIPTOOL) $(STRIP_FLAGS) $@
279 cmd_ar = $(AR) $(ARFLAGS) $@ @$@.list
306 compile.c = @$(call maybe_exec,compile.c)
307 compile.i = $(call maybe_exec,compile.i)
308 compile.s = $(call maybe_exec,compile.s)
309 compile.S = @$(call maybe_exec,compile.S)
310 compile.m = @$(call maybe_exec,compile.m)
311 compile.mi= $(call maybe_exec,compile.mi)
312 compile-m = @$(disp_compile-m) ; $(cmd_compile-m) && $(cmd_t_strip)
313 do_strip = @$(disp_strip) ; $(cmd_strip)
314 do_t_strip= @$(disp_t_strip) ; $(cmd_t_strip)
315 do_unifdef= @$(disp_unifdef) ; $(cmd_unifdef)
316 hcompile.u= @$(disp_hcompile.u); $(cmd_hcompile.u)
317 hcompile.o= @$(disp_hcompile.o); $(cmd_hcompile.o)
320 @$(file >$@.list,$(call objects_with_syms,,$^))
321 @$(disp_ar) ; $(cmd_ar)
325 @$(disp_compile.u) ; $(cmd_compile.u)
328 cmd_hcompile.u = $(HOSTCC) $(filter-out $(PHONY),$^) $(DEPS-$(notdir $@)) -o $@ $(BUILD_LDFLAGS) $(BUILD_LDFLAGS-$(notdir $(^D))) $(BUILD_LDFLAGS-$(notdir $@)) $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
329 cmd_hcompile.o = $(HOSTCC) $(filter-out $(PHONY),$<) $(DEPS-$(notdir $@)) -c -o $@ $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
332 $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
334 $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(LDFLAGS-y-$(@F)) \
335 -Wl,-soname=$(notdir $@).$(2) \
336 $(CFLAG_-nostdlib) $(CFLAG_-nostartfiles) \
337 -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
338 -Wl,--whole-archive $(firstword $^) -Wl,--no-whole-archive -shared \
339 $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
340 $(Q)$(LN) -sf $(1) $@.$(2)
341 $(Q)$(LN) -sf $(1) $@
344 # CRT files needed by link-flat.so
345 LINK_FLAT_CRTS := $(top_builddir)lib/Scrt1.o $(top_builddir)lib/crti.o \
346 $(top_builddir)lib/crtn.o
348 # Create a shared flat library from the archive named by the first dependency.
349 # $@ names the shared library's .gdb file, not the flat file itself.
350 # (This is because the .gdb suffix makes the ELF file more distinctive
351 # than the suffixless flat file.)
353 # Argument 1 is the shared library file -- i.e. $(@:.gdb=) -- and argument 2
354 # is the shared library identifier. If it wasn't for $(disp_ld), we could
355 # avoid passing $(@:.gdb=) as an argument and use $(@:.gdb=) instead of $(1).
357 # This is so far only used for libc, for which we want to link the entire
358 # libgcc into the shared object.
362 $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(CFLAG_-nostdlib) -o $(1) \
363 -Wl,-elf2flt -Wl,-shared-lib-id,$(2) $(top_builddir)lib/Scrt1.o \
364 $(top_builddir)/lib/crti.o -Wl,--whole-archive $(firstword $^) \
365 $(LIBGCC) -Wl,--no-whole-archive $(LIBS-$(notdir $@)) $(LIBGCC) \
366 $(top_builddir)/lib/crtn.o
369 CFLAGS-.os+=$(PICFLAG)
370 CFLAGS-.oS+=$(PICFLAG) -DSHARED
372 $(top_builddir)%.o: $(top_srcdir)%.c FORCE ; $(compile.c)
373 $(top_builddir)%.os: $(top_srcdir)%.c FORCE | pregen; $(compile.c)
374 $(top_builddir)%.oS: $(top_srcdir)%.c FORCE | pregen; $(compile.c)
375 $(top_builddir)%.o: $(top_srcdir)%.S FORCE ; $(compile.S)
376 $(top_builddir)%.os: $(top_srcdir)%.S FORCE | pregen; $(compile.S)
377 $(top_builddir)%.oS: $(top_srcdir)%.S FORCE | pregen; $(compile.S)
378 $(top_builddir)%.o: $(top_srcdir)%.s FORCE ; $(compile.S)
379 $(top_builddir)%.os: $(top_srcdir)%.s FORCE ; $(compile.S)
380 $(top_builddir)%.oS: $(top_srcdir)%.s FORCE | pregen; $(compile.S)
381 $(top_builddir)%.i: $(top_srcdir)%.c FORCE | pregen; $(compile.i)
382 $(top_builddir)%.i: $(top_srcdir)%.S FORCE | pregen; $(compile.i)
383 $(top_builddir)%.s: $(top_srcdir)%.c FORCE | pregen; $(compile.s)
384 $(top_builddir)%.s: $(top_srcdir)%.S FORCE | pregen; $(compile.s)
385 $(top_builddir)%.dep:
387 $(top_builddir)lib/interp.c: | $(top_builddir)lib
388 $(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@.tmp
389 $(Q)echo "#include <features.h>" >> $@.tmp
390 $(Q)echo "const char __dl_ldso__[] attribute_hidden __attribute__ ((weak)) __attribute__ ((section " \
391 "(\".interp\"))) =\""$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(UCLIBC_LDSO)"\";" >> $@.tmp
392 $(Q)$(SED) -i -e 's://:/:g' $@.tmp
395 $(interp): $(top_builddir)lib/interp.c | $(sub_headers)
397 $(Q)$(STRIPTOOL) -x -R .note -R .comment $@
400 $(Q)cd $(top_builddir); $(MAKE) lib/$(patsubst %.$(ABI_VERSION),%,$(notdir $@))
402 $(Q)cd $(top_builddir); $(MAKE) lib/$(patsubst %.$(ABI_VERSION),%,$(notdir $@))
406 ifeq ($(HAVE_SHARED)$(UCLIBC_FORMAT_SHARED_FLAT),y)
407 CRTS=$(top_builddir)lib/$(CRT).o $(top_builddir)lib/S$(CRT).o
409 CRTS=$(top_builddir)lib/$(CRT).o
412 ifeq ($(STATIC_PIE),y)
413 CRTS+=$(top_builddir)lib/r$(CRT).o
416 ASFLAGS-$(CRT).o := -DL_$(CRT)
417 ASFLAGS-S$(CRT).o := $(PIEFLAG) -DL_S$(CRT)
418 ASFLAGS-r$(CRT).o := $(PIEFLAG) -DL_r$(CRT)
419 $(CRTS): $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(CRT).S
421 $(Q)$(STRIPTOOL) -x -R .note -R .comment $@
423 ifeq ($(UCLIBC_CTOR_DTOR),y)
424 CTOR_TARGETS=$(top_builddir)lib/crti.o $(top_builddir)lib/crtn.o
428 ifeq ($(HAS_NO_THREADS)$(UCLIBC_HAS_THREADS_NATIVE),)
429 $(lib-so-y): $(CTOR_TARGETS)
432 ifeq ($(UCLIBC_FORMAT_FDPIC_ELF),y)
433 CRTRELOC=$(top_builddir)lib/crtreloc.o
434 $(CRTRELOC): $(top_builddir)lib/%.o : $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/%.c
438 ifneq ($(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c),)
439 CFLAGS-initfini.s := -S -g0 $(PICFLAG) -fno-inline-functions -finhibit-size-directive
440 $(top_builddir)lib/initfini.s: $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c | $(top_builddir)lib
443 $(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s
444 $(do_sed) -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
445 $(AWK) -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp
448 $(top_builddir)lib/crti.S: $(top_builddir)lib/initfini.s $(top_builddir)lib/defs.h
449 $(do_sed) -n -e '1,/@HEADER_ENDS/p' \
450 -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
451 -e '/@TRAILER_BEGINS/,$$p' $< > $@
453 $(top_builddir)lib/crtn.S: $(top_builddir)lib/initfini.s
454 $(do_sed) -n -e '1,/@HEADER_ENDS/p' \
455 -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
456 -e '/@TRAILER_BEGINS/,$$p' $< > $@
458 $(CTOR_TARGETS): $(top_builddir)lib/%.o : $(top_builddir)lib/%.S
459 $(compile.S) $(PICFLAG) $(SSP_DISABLE_FLAGS)
461 $(CTOR_TARGETS): $(top_builddir)lib/%.o : $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/%.S
462 $(compile.S) $(PICFLAG) $(SSP_DISABLE_FLAGS)
467 startfiles = $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC)
468 startfiles: $(startfiles)
469 $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC): | headers
470 $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC) \
471 $(LINK_FLAT_CRTS) $(SHARED_START_FILES) $(SHARED_END_FILES): | $(top_builddir)lib
473 $(top_builddir)lib/$(NONSHARED_LIBNAME): $(libc-nonshared-y)
477 $(top_builddir)lib/libpthread_nonshared.a: $(libpthread-nonshared-y)
481 files.dep := $(libc-a-y) $(libc-so-y) $(libc-nonshared-y) \
482 $(libm-a-y) $(libm-so-y) \
483 $(libpthread-a-y) $(libpthread-so-y) $(libpthread-nonshared-y) \
484 $(libthread_db-a-y) $(libthread_db-so-y) $(libpthread-generated-y) \
485 $(START_FILE-libpthread.so) $(END_FILE-libpthread.so) \
486 $(PTHREAD_INITFINI:.c=.s) \
487 $(librt-a-y) $(librt-so-y) \
488 $(libcrypt-a-y) $(libcrypt-so-y) \
489 $(libutil-a-y) $(libutil-so-y) \
490 $(ldso-y) $(libdl-a-y) $(libdl-so-y) \
491 $(libubacktrace-a-y) $(libubacktrace-so-y) \
492 $(libuargp-so-y) $(libuargp-a-y) \
493 $(libiconv-so-y) $(libiconv-a-y) \
494 $(libintl-so-y) $(libintl-a-y)
496 $(patsubst %.s,%.s.dep,$(filter %.s,$(files.dep))) \
497 $(patsubst %.o,%.o.dep,$(filter %.o,$(files.dep))) \
498 $(patsubst %.os,%.os.dep,$(filter %.os,$(files.dep))) \
499 $(patsubst %.oS,%.oS.dep,$(filter %.oS,$(files.dep)))
500 # Oh, and prepend a dot to the basename so i don't have to change my habit of
501 # calling 'size thefile.o*'
502 .depends.dep := $(foreach f,$(.depends.dep),$(dir $(f)).$(notdir $(f)))
503 .depends.dep := $(wildcard $(.depends.dep))
507 clean: objclean-y headers_clean-y
508 realclean: clean menuconfig-clean-y
509 $(Q)$(RM) $(.depends.dep)
511 objclean-y: $(objclean-y)
512 headers_clean-y: $(headers_clean-y)
514 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
515 ifneq ($(strip $(.depends.dep)),)
517 -include $(.depends.dep)