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