OSDN Git Service

*.i depend on generated headers
[uclinux-h8/uClibc.git] / Makerules
1 #
2 # Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
3 #
4
5 .SUFFIXES: .c .S .o .os .oS .so .a .s .i
6
7 PHONY := FORCE
8
9 .PHONY: dummy $(PHONY) subdirs \
10         all check test $(clean_targets) \
11         config dist menuconfig oldconfig release \
12         utils help
13
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)
19 else
20 .LIBPATTERNS: "lib%.a"
21 ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
22 libs: $(lib-gdb-y)
23 endif
24 libs: $(lib-a-y)
25 endif
26 objs: all_objs
27
28 shared_objs = $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y) \
29         $(libcrypt-so-y) $(libdl-so-y) \
30         $(libintl-so-y) $(libm-so-y) $(libnsl-so-y) \
31         $(libpthread-so-y) $(libpthread-nonshared-y) $(libthread_db-so-y) \
32         $(libresolv-so-y) $(librt-so-y) \
33         $(ldso-y) \
34         $(libutil-so-y)
35
36 ar_objs =  $(libc-y) $(libc-static-y) $(libcrypt-a-y) \
37         $(libdl-a-y) $(libintl-a-y) $(libm-a-y) $(libnsl-a-y) \
38         $(libpthread-a-y) $(libthread_db-a-y) \
39         $(libresolv-a-y) $(librt-a-y) $(libutil-a-y)
40 ifeq ($(DOPIC),y)
41 ar_objs := $(ar_objs:.o=.os)
42 endif
43 flat_objs = $(lib-gdb-y)
44
45 ifeq ($(HAVE_SHARED),y)
46 all_objs: $(sort $(shared_objs) $(ar_objs))
47 else
48 all_objs: $(ar_objs)
49 endif
50 $(shared_objs) $(ar_objs): | $(sub_headers)
51
52 headers-y: $(headers-y)
53         @true
54
55 MAKEFLAGS += --no-print-directory
56 SHELL_SET_X := set +x
57 define rel_srcdir
58         $(shell $(CONFIG_SHELL) $(top_srcdir)/extra/scripts/relative_path.sh $(@D) .)
59 endef
60 ifneq ($(findstring -s,$(MAKEFLAGS)),)
61 export MAKE_IS_SILENT := y
62 SECHO := -@false
63 DISP := sil
64 Q := @
65 else
66 export MAKE_IS_SILENT := n
67 SECHO := @echo
68 ifneq ($(V)$(VERBOSE),)
69 SHELL_SET_X := set -x
70 DISP := ver
71 Q :=
72 else
73 DISP := pur
74 Q := @
75 endif
76 endif
77
78 show_objs = $(subst $(top_builddir),,$(subst ../,,$@))
79
80 pur_disp_compile.c = echo "  "CC $(show_objs)
81 pur_disp_compile.i = echo "  "CPP $(show_objs)
82 pur_disp_compile.s = echo "  "CC-S $(show_objs)
83 pur_disp_compile.u = echo "  "CC $(show_objs)
84 pur_disp_compile.S = echo "  "AS $(show_objs)
85 pur_disp_compile.m = $(pur_disp_compile.c)
86 pur_disp_compile.mi= echo "  "CPP-m $(show_objs)
87 pur_disp_compile-m = echo "  "CC-m $(show_objs)
88 pur_disp_hcompile.u= echo "  "HOSTCC $(show_objs)
89 pur_disp_hcompile.o= echo "  "HOSTCC-o $(show_objs)
90 pur_disp_strip     = echo "  "STRIP $(STRIP_FLAGS) $@
91 pur_disp_t_strip   = echo "  "STRIP $(STRIP_FLAGS) $@
92 pur_disp_ar        = echo "  "AR $(ARFLAGS) $@
93 pur_disp_ld        = echo "  "LD $(1)
94 pur_disp_ln        = echo "  "LN $(show_objs)
95 pur_disp_mkdir     = echo "  "MKDIR $(show_objs)
96 pur_disp_gen       = echo "  "GEN $(show_objs)
97 pur_disp_unifdef   = echo "  "UNIFDEF $(show_objs)
98 pur_disp_rm        = echo "  "CLEAN $(subst CLEAN_,,$(patsubst HEADERCLEAN_%,include \(%\),$@))
99
100 sil_disp_compile.c = true
101 sil_disp_compile.i = true
102 sil_disp_compile.s = true
103 sil_disp_compile.u = true
104 sil_disp_compile.S = true
105 sil_disp_compile.m = true
106 sil_disp_compile.mi= true
107 sil_disp_compile-m = true
108 sil_disp_hcompile.u= true
109 sil_disp_hcompile.o= true
110 sil_disp_strip     = true
111 sil_disp_t_strip   = true
112 sil_disp_ar        = true
113 sil_disp_ld        = true
114 sil_disp_ln        = true
115 sil_disp_mkdir     = true
116 sil_disp_gen       = true
117 sil_disp_unifdef   = true
118 sil_disp_rm        = true
119
120 ver_disp_compile.c = echo $(cmd_compile.c)
121 ver_disp_compile.i = echo $(cmd_compile.i)
122 ver_disp_compile.s = echo $(cmd_compile.s)
123 ver_disp_compile.u = echo $(cmd_compile.u)
124 ver_disp_compile.S = echo $(cmd_compile.S)
125 ver_disp_compile.m = echo $(cmd_compile.m)
126 ver_disp_compile.mi= echo $(cmd_compile.mi)
127 ver_disp_compile-m = echo $(cmd_compile-m)
128 ver_disp_hcompile.u= echo $(cmd_hcompile.u)
129 ver_disp_hcompile.o= echo $(cmd_hcompile.o)
130 ver_disp_strip     = echo $(cmd_strip)
131 ver_disp_t_strip   = echo $(cmd_t_strip)
132 ver_disp_ar        = echo $(cmd_ar)
133 ver_disp_ld        =
134 ver_disp_ln        =
135 ver_disp_mkdir     =
136 ver_disp_gen       =
137 ver_disp_unifdef   = echo $(cmd_unifdef)
138 ver_disp_rm        =
139
140 disp_compile.c = $($(DISP)_disp_compile.c)
141 disp_compile.i = $($(DISP)_disp_compile.i)
142 disp_compile.s = $($(DISP)_disp_compile.s)
143 disp_compile.u = $($(DISP)_disp_compile.u)
144 disp_compile.S = $($(DISP)_disp_compile.S)
145 disp_compile.m = $($(DISP)_disp_compile.m)
146 disp_compile.mi= $($(DISP)_disp_compile.mi)
147 disp_compile-m = $($(DISP)_disp_compile-m)
148 disp_hcompile.u= $($(DISP)_disp_hcompile.u)
149 disp_hcompile.o= $($(DISP)_disp_hcompile.o)
150 disp_strip     = $($(DISP)_disp_strip)
151 disp_t_strip   = $($(DISP)_disp_t_strip)
152 disp_ar        = $($(DISP)_disp_ar)
153 disp_ld        = $($(DISP)_disp_ld)
154 disp_ln        = $($(DISP)_disp_ln)
155 disp_mkdir     = $($(DISP)_disp_mkdir)
156 disp_gen       = $($(DISP)_disp_gen)
157 disp_unifdef   = $($(DISP)_disp_unifdef)
158 disp_rm        = $($(DISP)_disp_rm)
159
160 any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
161
162 # ../foo/bar/baz.ext -> foo_bar_baz.ext
163 variablify = $(subst /,_,$(subst $(top_builddir),,$(1)))
164 # strip the top_builddir off everything to make the *string* idempotent for -C
165 dirify = $(subst $(top_builddir),,$(patsubst -L$(top_builddir)%,-L%,$(patsubst -I$(top_builddir)%,-I%,$(1))))
166
167 # True if not identical. Neither order nor whitespace nor identical flags
168 # matter.
169 compare_flags = \
170         $(strip $(filter-out $(call dirify,$(cmd_$(call variablify,$(1)))), \
171                                 $(call dirify,$(cmd_$(call variablify,$(@))))) \
172                 $(filter-out $(call dirify,$(cmd_$(call variablify,$(@)))), \
173                                 $(call dirify,$(cmd_$(call variablify,$(1))))))
174
175 # Rebuild if any prerequisite, the used CC or flags changed.
176 # Previously used flags are stored in the corresponding .%.dep files
177 maybe_exec = \
178                 $(if $(strip $(compare_flags) $(any-prereq)), \
179                 @set -e; \
180                 $(disp_$(1)); \
181                 $(cmd_$(1)); \
182                 echo 'cmd_$(call variablify,$@) := $(call dirify,$(cmd_$(call variablify,$1)))' >> $(dir $@).$(notdir $@).dep)
183
184 # collect flags of domulti prereqs
185 #collect_multi_flags = $(CFLAGS-$(notdir $(d))) $(CFLAGS-$(notdir $(patsubst %/,%,$(dir $(d)))))
186 collect_multi_flags = $(CFLAGS-$(notdir $(patsubst %/,%,$(dir $(d)))))
187
188 CFLAGS_gen.dep = -MT $@ -MD -MP -MF $(dir $@).$(notdir $@).dep
189
190 cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) \
191         $(CFLAGS-$(suffix $@)) \
192         $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS-$(notdir $(<D)))) \
193         $(CFLAGS-$(subst $(top_srcdir),,$(dir $<))) \
194         $(CFLAGS-$(notdir $<)) \
195         $(CFLAGS-$(notdir $@)) \
196         $(CFLAGS_gen.dep)
197 cmd_compile.i = $(cmd_compile.c:-c=-E -dD $(EXTRA_CPPFLAGS))
198 cmd_compile.s = $(cmd_compile.c:-c=-S)
199 cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep)
200 cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
201 cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
202 cmd_compile.mi= $(cmd_compile.m:-c=-E -dD $(EXTRA_CPPFLAGS))
203
204 cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@)) $(sort $(foreach d,$(^:$(top_srcdir)=),$(collect_multi_flags)))
205 cmd_strip     = $(STRIPTOOL) $(STRIP_FLAGS) $^
206 cmd_t_strip   = $(STRIPTOOL) $(STRIP_FLAGS) $@
207 cmd_ar        = $(AR) $(ARFLAGS) $@ $^
208
209 define do_ln
210         @$(disp_ln)
211         $(Q)$(LN) -fs
212 endef
213
214 define do_mkdir
215         @$(disp_mkdir)
216         $(Q)$(INSTALL) -d $@
217 endef
218
219 define do_rm
220         @$(disp_rm)
221         $(Q)$(RM)
222 endef
223
224 define do_awk
225         @$(disp_gen)
226         $(Q)$(AWK) -f
227 endef
228
229 define do_sed
230         @$(disp_gen)
231         $(Q)$(SED)
232 endef
233
234 compile.c = @$(call maybe_exec,compile.c)
235 compile.i =  $(call maybe_exec,compile.i)
236 compile.s =  $(call maybe_exec,compile.s)
237 compile.S = @$(call maybe_exec,compile.S)
238 compile.m = @$(call maybe_exec,compile.m)
239 compile.mi=  $(call maybe_exec,compile.mi)
240 compile-m = @$(disp_compile-m) ; $(cmd_compile-m) && $(cmd_t_strip)
241 do_strip  = @$(disp_strip)     ; $(cmd_strip)
242 do_t_strip= @$(disp_t_strip)   ; $(cmd_t_strip)
243 do_unifdef= @$(disp_unifdef)   ; $(cmd_unifdef)
244 hcompile.u= @$(disp_hcompile.u); $(cmd_hcompile.u)
245 hcompile.o= @$(disp_hcompile.o); $(cmd_hcompile.o)
246
247 define do_ar
248         @$(disp_ar) ; $(cmd_ar)
249         @$(do_t_strip)
250 endef
251 define compile.u
252         @$(disp_compile.u) ; $(cmd_compile.u)
253         @$(disp_t_strip)
254 endef
255 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 $@))
256 cmd_hcompile.o = $(HOSTCC) $(filter-out $(PHONY),$<) $(DEPS-$(notdir $@)) -c -o $@ $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
257
258 define link.so
259         $(Q)$(INSTALL) -d $(dir $@)
260         $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
261         @$(disp_ld)
262         $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \
263                 $(NOSTDLIB_CFLAGS) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
264                 -Wl,--whole-archive $(firstword $^) -Wl,--no-whole-archive \
265                 $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
266         $(Q)$(LN) -sf $(1) $@.$(2)
267         $(Q)$(LN) -sf $(1) $@
268 endef
269
270 # CRT files needed by link-flat.so
271 LINK_FLAT_CRTS := $(top_builddir)lib/Scrt1.o $(top_builddir)lib/crti.o \
272         $(top_builddir)lib/crtn.o
273
274 # Create a shared flat library from the archive named by the first dependency.
275 # $@ names the shared library's .gdb file, not the flat file itself.
276 # (This is because the .gdb suffix makes the ELF file more distinctive
277 # than the suffixless flat file.)
278 #
279 # Argument 1 is the shared library file -- i.e. $(@:.gdb=) -- and argument 2
280 # is the shared library identifier.  If it wasn't for $(disp_ld), we could
281 # avoid passing $(@:.gdb=) as an argument and use $(@:.gdb=) instead of $(1).
282 #
283 # This is so far only used for libc, for which we want to link the entire
284 # libgcc into the shared object.
285 define link-flat.so
286         $(Q)$(INSTALL) -d $(dir $@)
287         $(Q)$(RM) $(1) $@
288         @$(disp_ld)
289         $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(NOSTDLIB_CFLAGS) -o $(1) \
290                 -Wl,-elf2flt -Wl,-shared-lib-id,$(2) $(top_builddir)lib/Scrt1.o \
291                 $(top_builddir)/lib/crti.o -Wl,--whole-archive $(firstword $^) \
292                 $(LIBGCC) -Wl,--no-whole-archive $(LIBS-$(notdir $@)) $(LIBGCC) \
293                 $(top_builddir)/lib/crtn.o
294 endef
295
296 define linkm.so
297         $(Q)$(INSTALL) -d $(dir $@)
298         $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
299         $(do_strip)
300         @$(disp_ld)
301         $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \
302                 $(NOSTDLIB_CFLAGS) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
303                 $^ \
304                 $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
305         $(Q)$(LN) -sf $(1) $@.$(2)
306         $(Q)$(LN) -sf $(1) $@
307 endef
308
309 CFLAGS-.os+=$(PICFLAG)
310 CFLAGS-.oS+=$(PICFLAG) -DSHARED
311
312 $(top_srcdir)%.i: | pregen
313 $(top_builddir)%.o:  $(top_srcdir)%.c FORCE ; $(compile.c)
314 $(top_builddir)%.os: $(top_srcdir)%.c FORCE ; $(compile.c)
315 $(top_builddir)%.oS: $(top_srcdir)%.c FORCE ; $(compile.c)
316 $(top_builddir)%.o:  $(top_srcdir)%.S FORCE ; $(compile.S)
317 $(top_builddir)%.os: $(top_srcdir)%.S FORCE ; $(compile.S)
318 $(top_builddir)%.oS: $(top_srcdir)%.S FORCE ; $(compile.S)
319 $(top_builddir)%.o:  $(top_srcdir)%.s FORCE ; $(compile.S)
320 $(top_builddir)%.os: $(top_srcdir)%.s FORCE ; $(compile.S)
321 $(top_builddir)%.oS: $(top_srcdir)%.s FORCE ; $(compile.S)
322 $(top_builddir)%.i:  $(top_srcdir)%.c FORCE ; $(compile.i)
323 $(top_builddir)%.i:  $(top_srcdir)%.S FORCE ; $(compile.i)
324 $(top_builddir)%.s:  $(top_srcdir)%.c FORCE ; $(compile.s)
325 $(top_builddir)%.s:  $(top_srcdir)%.S FORCE ; $(compile.s)
326 $(top_builddir)%.dep:
327
328 $(top_builddir)lib/interp.c: | $(sub_headers)
329         $(Q)$(INSTALL) -d $(dir $@)
330         $(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@
331         $(Q)echo "#include <features.h>" >> $@
332         $(Q)echo "const char __dl_ldso__[] attribute_hidden __attribute__ ((weak)) __attribute__ ((section " \
333                 "(\".interp\"))) =\""$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(UCLIBC_LDSO)"\";" >> $@
334
335 $(interp): $(top_builddir)lib/interp.c
336         $(compile.c)
337         $(Q)$(STRIPTOOL) -x -R .note -R .comment $@
338
339 $(ldso):
340         @cd $(top_builddir); $(MAKE) lib/$(patsubst %.$(MAJOR_VERSION),%,$(notdir $@))
341
342 $(libc):
343         @cd $(top_builddir); $(MAKE) lib/$(patsubst %.$(MAJOR_VERSION),%,$(notdir $@))
344
345 CRT := crt1
346
347 ifeq ($(HAVE_SHARED)$(UCLIBC_FORMAT_SHARED_FLAT),y)
348 CRTS=$(top_builddir)lib/$(CRT).o $(top_builddir)lib/S$(CRT).o
349 else
350 CRTS=$(top_builddir)lib/$(CRT).o
351 endif
352
353 ASFLAGS-$(CRT).o := -DL_$(CRT)
354 ASFLAGS-S$(CRT).o := $(PIEFLAG) -DL_S$(CRT)
355 $(CRTS): $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(CRT).S
356         $(Q)$(INSTALL) -d $(dir $@)
357         $(compile.S)
358         $(Q)$(STRIPTOOL) -x -R .note -R .comment $@
359
360 ifeq ($(UCLIBC_CTOR_DTOR),y)
361 CTOR_TARGETS=$(top_builddir)lib/crti.o $(top_builddir)lib/crtn.o
362 else
363 CTOR_TARGETS:=
364 endif
365
366 ifeq ($(UCLIBC_FORMAT_FDPIC_ELF),y)
367 CRTRELOC=$(top_builddir)lib/crtreloc.o
368 $(CRTRELOC): $(top_builddir)lib/%.o : $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/%.c
369         $(Q)$(INSTALL) -d $(dir $@)
370         $(compile.c)
371 endif
372
373 ifneq ($(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c),)
374 CFLAGS-initfini.s := -S -g0 $(PICFLAG) -fno-inline-functions -finhibit-size-directive
375 $(top_builddir)lib/initfini.s: $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c
376         $(compile.c)
377
378 $(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s
379         $(Q)sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
380                 gawk -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp
381         $(Q)mv $@.tmp $@
382
383 $(top_builddir)lib/crti.S: $(top_builddir)lib/initfini.s $(top_builddir)lib/defs.h
384         $(Q)sed -n -e '1,/@HEADER_ENDS/p' \
385                 -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
386                 -e '/@TRAILER_BEGINS/,$$p' $< > $@
387
388 $(top_builddir)lib/crtn.S: $(top_builddir)lib/initfini.s
389         $(Q)sed -n -e '1,/@HEADER_ENDS/p' \
390                 -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
391                 -e '/@TRAILER_BEGINS/,$$p' $< > $@
392
393 $(CTOR_TARGETS): $(top_builddir)lib/%.o : $(top_builddir)lib/%.S
394         $(Q)$(INSTALL) -d $(dir $@)
395         $(compile.S) $(PICFLAG) $(SSP_DISABLE_FLAGS)
396 else
397 $(CTOR_TARGETS): $(top_builddir)lib/%.o : $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/%.S
398         $(Q)$(INSTALL) -d $(dir $@)
399         $(compile.S) $(PICFLAG) $(SSP_DISABLE_FLAGS)
400 endif
401
402 #ifeq ($(TARGET_ARCH),nios)
403 #CRTS_COMPAT := $(top_builddir)lib/crt0.o
404 #$(CRTS_COMPAT):
405 #       ln -fs crt1.o $(top_builddir)lib/crt0.o
406 #else
407 CRTS_COMPAT :=
408 #endif
409
410 $(crt-y): $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC)
411 $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC): | headers
412
413 $(top_builddir)lib/$(NONSHARED_LIBNAME): $(libc-nonshared-y)
414         $(Q)$(INSTALL) -d $(dir $@)
415         $(Q)$(RM) $@
416         $(do_ar)
417
418 $(top_builddir)lib/libpthread_nonshared.a: $(libpthread-nonshared-y)
419         $(Q)$(INSTALL) -d $(dir $@)
420         $(Q)$(RM) $@
421         $(do_ar)
422
423 files.dep := $(libc-a-y) $(libc-so-y) $(libc-nonshared-y) \
424         $(libm-a-y) $(libm-so-y) \
425         $(libpthread-a-y) $(libpthread-so-y) $(libpthread-nonshared-y) \
426         $(libthread_db-a-y) $(libthread_db-so-y) \
427         $(librt-a-y) $(librt-so-y)  $(libresolv-a-y) $(libresolv-so-y) \
428         $(libcrypt-a-y) $(libcrypt-so-y) $(libutil-a-y) $(libutil-so-y) \
429         $(libnsl-a-y) $(libnsl-so-y) $(ldso-y) $(libdl-a-y) $(libdl-so-y)
430 .depends.dep := \
431         $(patsubst %.o,%.o.dep,$(filter %.o,$(files.dep))) \
432         $(patsubst %.os,%.os.dep,$(filter %.os,$(files.dep))) \
433         $(patsubst %.oS,%.oS.dep,$(filter %.oS,$(files.dep)))
434 # Oh, and prepend a dot to the basename so i don't have to change my habit of
435 # calling 'size thefile.o*'
436 .depends.dep := $(foreach f,$(.depends.dep),$(dir $(f)).$(notdir $(f)))
437 .depends.dep := $(wildcard $(.depends.dep))
438
439 FORCE:
440
441 clean: objclean-y headers_clean-y
442 realclean: clean menuconfig-clean-y
443         $(Q)$(RM) $(.depends.dep)
444
445 objclean-y: $(objclean-y)
446 headers_clean-y: $(headers_clean-y)
447
448 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
449 ifneq ($(strip $(.depends.dep)),)
450 .NOEXPORT:
451 -include $(.depends.dep)
452 endif
453 endif
454
455 # vi: ft=make :