OSDN Git Service

support building out-of-tree
[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 $(@:_clean=)
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
185 CFLAGS_gen.dep = -MT $@ -MD -MP -MF $(dir $@).$(notdir $@).dep
186
187 cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) $(ARCH_CFLAGS) \
188         $(CFLAGS-$(suffix $@)) \
189         $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS-$(notdir $(<D)))) \
190         $(CFLAGS-$(subst $(top_srcdir),,$(dir $<))) \
191         $(CFLAGS-$(notdir $<)) \
192         $(CFLAGS-$(notdir $@)) \
193         $(CFLAGS_gen.dep)
194 cmd_compile.i = $(cmd_compile.c:-c=-E -dD $(EXTRA_CPPFLAGS))
195 cmd_compile.s = $(cmd_compile.c:-c=-S)
196 cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep)
197 cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
198 cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
199 cmd_compile.mi= $(cmd_compile.m:-c=-E -dD $(EXTRA_CPPFLAGS))
200
201 cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@))
202 cmd_strip     = $(STRIPTOOL) $(STRIP_FLAGS) $^
203 cmd_t_strip   = $(STRIPTOOL) $(STRIP_FLAGS) $@
204 cmd_ar        = $(AR) $(ARFLAGS) $@ $^
205
206 define do_ln
207         @$(disp_ln)
208         $(Q)$(LN) -fs
209 endef
210
211 define do_mkdir
212         @$(disp_mkdir)
213         $(Q)$(INSTALL) -d $@
214 endef
215
216 define do_rm
217         @$(disp_rm)
218         $(Q)$(RM)
219 endef
220
221 define do_awk
222         @$(disp_gen)
223         $(Q)$(AWK) -f
224 endef
225
226 compile.c = @$(call maybe_exec,compile.c)
227 compile.i =  $(call maybe_exec,compile.i)
228 compile.s =  $(call maybe_exec,compile.s)
229 compile.S = @$(call maybe_exec,compile.S)
230 compile.m = @$(call maybe_exec,compile.m)
231 compile.mi=  $(call maybe_exec,compile.mi)
232 compile-m = @$(disp_compile-m) ; $(cmd_compile-m) && $(cmd_t_strip)
233 do_strip  = @$(disp_strip)     ; $(cmd_strip)
234 do_t_strip= @$(disp_t_strip)   ; $(cmd_t_strip)
235 do_unifdef= @$(disp_unifdef)   ; $(cmd_unifdef)
236 hcompile.u= @$(disp_hcompile.u); $(cmd_hcompile.u)
237 hcompile.o= @$(disp_hcompile.o); $(cmd_hcompile.o)
238
239 define do_ar
240         @$(disp_ar) ; $(cmd_ar)
241         @$(do_t_strip)
242 endef
243 define compile.u
244         @$(disp_compile.u) ; $(cmd_compile.u)
245         @$(disp_t_strip)
246 endef
247 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 $@))
248 cmd_hcompile.o = $(HOSTCC) $(filter-out $(PHONY),$<) $(DEPS-$(notdir $@)) -c -o $@ $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
249
250 define link.so
251         $(Q)$(INSTALL) -d $(dir $@)
252         $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
253         @$(disp_ld)
254         $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \
255                 $(NOSTDLIB_CFLAGS) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
256                 -Wl,--whole-archive $(firstword $^) -Wl,--no-whole-archive \
257                 $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
258         $(Q)$(LN) -sf $(1) $@.$(2)
259         $(Q)$(LN) -sf $(1) $@
260 endef
261
262 # CRT files needed by link-flat.so
263 LINK_FLAT_CRTS := $(top_builddir)lib/Scrt1.o $(top_builddir)lib/crti.o \
264         $(top_builddir)lib/crtn.o
265
266 # Create a shared flat library from the archive named by the first dependency.
267 # $@ names the shared library's .gdb file, not the flat file itself.
268 # (This is because the .gdb suffix makes the ELF file more distinctive
269 # than the suffixless flat file.)
270 #
271 # Argument 1 is the shared library file -- i.e. $(@:.gdb=) -- and argument 2
272 # is the shared library identifier.  If it wasn't for $(disp_ld), we could
273 # avoid passing $(@:.gdb=) as an argument and use $(@:.gdb=) instead of $(1).
274 #
275 # This is so far only used for libc, for which we want to link the entire
276 # libgcc into the shared object.
277 define link-flat.so
278         $(Q)$(INSTALL) -d $(dir $@)
279         $(Q)$(RM) $(1) $@
280         @$(disp_ld)
281         $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(NOSTDLIB_CFLAGS) -o $(1) \
282                 -Wl,-elf2flt -Wl,-shared-lib-id,$(2) $(top_builddir)lib/Scrt1.o \
283                 $(top_builddir)/lib/crti.o -Wl,--whole-archive $(firstword $^) \
284                 $(LIBGCC) -Wl,--no-whole-archive $(LIBS-$(notdir $@)) $(LIBGCC) \
285                 $(top_builddir)/lib/crtn.o
286 endef
287
288 define linkm.so
289         $(Q)$(INSTALL) -d $(dir $@)
290         $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
291         $(do_strip)
292         @$(disp_ld)
293         $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \
294                 $(NOSTDLIB_CFLAGS) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
295                 $^ \
296                 $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
297         $(Q)$(LN) -sf $(1) $@.$(2)
298         $(Q)$(LN) -sf $(1) $@
299 endef
300
301 CFLAGS-.os+=$(PICFLAG)
302 CFLAGS-.oS+=$(PICFLAG) -DSHARED
303
304 $(top_builddir)%.o:  $(top_srcdir)%.c FORCE ; $(compile.c)
305 $(top_builddir)%.os: $(top_srcdir)%.c FORCE ; $(compile.c)
306 $(top_builddir)%.oS: $(top_srcdir)%.c FORCE ; $(compile.c)
307 $(top_builddir)%.o:  $(top_srcdir)%.S FORCE ; $(compile.S)
308 $(top_builddir)%.os: $(top_srcdir)%.S FORCE ; $(compile.S)
309 $(top_builddir)%.oS: $(top_srcdir)%.S FORCE ; $(compile.S)
310 $(top_builddir)%.o:  $(top_srcdir)%.s FORCE ; $(compile.S)
311 $(top_builddir)%.os: $(top_srcdir)%.s FORCE ; $(compile.S)
312 $(top_builddir)%.oS: $(top_srcdir)%.s FORCE ; $(compile.S)
313 $(top_builddir)%.i:  $(top_srcdir)%.c FORCE ; $(compile.i)
314 $(top_builddir)%.i:  $(top_srcdir)%.S FORCE ; $(compile.i)
315 $(top_builddir)%.s:  $(top_srcdir)%.c FORCE ; $(compile.s)
316 $(top_builddir)%.s:  $(top_srcdir)%.S FORCE ; $(compile.s)
317 $(top_builddir)%.dep:
318
319 $(top_builddir)lib/interp.c: | $(sub_headers)
320         $(Q)$(INSTALL) -d $(dir $@)
321         $(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@
322         $(Q)echo "#include <features.h>" >> $@
323         $(Q)echo "const char __dl_ldso__[] attribute_hidden __attribute__ ((weak)) __attribute__ ((section " \
324                 "(\".interp\"))) =\""$(SHARED_LIB_LOADER_PREFIX)/$(UCLIBC_LDSO)"\";" >> $@
325
326 $(interp): $(top_builddir)lib/interp.c
327         $(compile.c)
328         $(Q)$(STRIPTOOL) -x -R .note -R .comment $@
329
330 $(ldso):
331         @cd $(top_builddir); $(MAKE) lib/$(patsubst %.$(MAJOR_VERSION),%,$(notdir $@))
332
333 $(libc):
334         @cd $(top_builddir); $(MAKE) lib/$(patsubst %.$(MAJOR_VERSION),%,$(notdir $@))
335
336 CRT := crt1
337
338 ifeq ($(HAVE_SHARED)$(UCLIBC_FORMAT_SHARED_FLAT),y)
339 CRTS=$(top_builddir)lib/$(CRT).o $(top_builddir)lib/S$(CRT).o
340 else
341 CRTS=$(top_builddir)lib/$(CRT).o
342 endif
343
344 ASFLAGS-$(CRT).o := -DL_$(CRT)
345 ASFLAGS-S$(CRT).o := $(PIEFLAG) -DL_S$(CRT)
346 $(CRTS): $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(CRT).S
347         $(Q)$(INSTALL) -d $(dir $@)
348         $(compile.S)
349         $(Q)$(STRIPTOOL) -x -R .note -R .comment $@
350
351 ifeq ($(UCLIBC_CTOR_DTOR),y)
352 CTOR_TARGETS=$(top_builddir)lib/crti.o $(top_builddir)lib/crtn.o
353 else
354 CTOR_TARGETS:=
355 endif
356
357 ifeq ($(UCLIBC_FORMAT_FDPIC_ELF),y)
358 CRTRELOC=$(top_builddir)lib/crtreloc.o
359 $(CRTRELOC): $(top_builddir)lib/%.o : $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/%.c
360         $(Q)$(INSTALL) -d $(dir $@)
361         $(compile.c)
362 endif
363
364 ifneq ($(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c),)
365 CFLAGS-initfini.s := -S -g0 $(PICFLAG) -fno-inline-functions -finhibit-size-directive
366 $(top_builddir)lib/initfini.s: $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c
367         $(compile.c)
368
369 $(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s
370         $(Q)sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
371                 gawk -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp
372         $(Q)mv $@.tmp $@
373
374 $(top_builddir)lib/crti.S: $(top_builddir)lib/initfini.s $(top_builddir)lib/defs.h
375         $(Q)sed -n -e '1,/@HEADER_ENDS/p' \
376                 -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
377                 -e '/@TRAILER_BEGINS/,$$p' $< > $@
378
379 $(top_builddir)lib/crtn.S: $(top_builddir)lib/initfini.s
380         $(Q)sed -n -e '1,/@HEADER_ENDS/p' \
381                 -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
382                 -e '/@TRAILER_BEGINS/,$$p' $< > $@
383
384 $(CTOR_TARGETS): $(top_builddir)lib/%.o : $(top_builddir)lib/%.S
385         $(Q)$(INSTALL) -d $(dir $@)
386         $(compile.S) $(PICFLAG) $(SSP_DISABLE_FLAGS)
387 else
388 $(CTOR_TARGETS): $(top_builddir)lib/%.o : $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/%.S
389         $(Q)$(INSTALL) -d $(dir $@)
390         $(compile.S) $(PICFLAG) $(SSP_DISABLE_FLAGS)
391 endif
392
393 #ifeq ($(TARGET_ARCH),nios)
394 #CRTS_COMPAT := $(top_builddir)lib/crt0.o
395 #$(CRTS_COMPAT):
396 #       ln -fs crt1.o $(top_builddir)lib/crt0.o
397 #else
398 CRTS_COMPAT :=
399 #endif
400
401 $(crt-y): $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC)
402 $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC): | headers
403
404 $(top_builddir)lib/$(NONSHARED_LIBNAME): $(libc-nonshared-y)
405         $(Q)$(INSTALL) -d $(dir $@)
406         $(Q)$(RM) $@
407         $(do_ar)
408
409 $(top_builddir)lib/libpthread_nonshared.a: $(libpthread-nonshared-y)
410         $(Q)$(INSTALL) -d $(dir $@)
411         $(Q)$(RM) $@
412         $(do_ar)
413
414 files.dep := $(libc-a-y) $(libc-so-y) $(libc-nonshared-y) \
415         $(libm-a-y) $(libm-so-y) \
416         $(libpthread-a-y) $(libpthread-so-y) $(libpthread-nonshared-y) \
417         $(libthread_db-a-y) $(libthread_db-so-y) \
418         $(librt-a-y) $(librt-so-y)  $(libresolv-a-y) $(libresolv-so-y) \
419         $(libcrypt-a-y) $(libcrypt-so-y) $(libutil-a-y) $(libutil-so-y) \
420         $(libnsl-a-y) $(libnsl-so-y) $(ldso-y) $(libdl-a-y) $(libdl-so-y)
421 .depends.dep := \
422         $(patsubst %.o,%.o.dep,$(filter %.o,$(files.dep))) \
423         $(patsubst %.os,%.os.dep,$(filter %.os,$(files.dep))) \
424         $(patsubst %.oS,%.oS.dep,$(filter %.oS,$(files.dep)))
425 # Oh, and prepend a dot to the basename so i don't have to change my habit of
426 # calling 'size thefile.o*'
427 .depends.dep := $(foreach f,$(.depends.dep),$(dir $(f)).$(notdir $(f)))
428 .depends.dep := $(wildcard $(.depends.dep))
429
430 FORCE:
431
432 clean: objclean-y headers_clean-y
433 realclean: clean
434         $(Q)$(RM) $(.depends.dep)
435
436 objclean-y: $(objclean-y)
437 headers_clean-y: $(headers_clean-y)
438
439 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
440 ifneq ($(strip $(.depends.dep)),)
441 .NOEXPORT:
442 -include $(.depends.dep)
443 endif
444 endif
445
446 # vi: ft=make :