OSDN Git Service

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