93 |
KLIBCLD := $(LD) |
KLIBCLD := $(LD) |
94 |
KLIBCCC := $(CC) |
KLIBCCC := $(CC) |
95 |
KLIBCAR := $(AR) |
KLIBCAR := $(AR) |
96 |
KLIBCRANLIB := $(RANLIB) |
|
97 |
|
# klibc-ar is a macro that invokes KLIBCAR and takes 2 arguments of ar commands. |
98 |
|
# The second will be used for reproducible builds, the first otherwise. |
99 |
|
klibc-ar = $(KLIBCAR) $(if $(KBUILD_REPRODUCIBLE),$(2),$(1)) |
100 |
|
|
101 |
|
KLIBCRANLIB := $(call klibc-ar,s,Ds) |
102 |
KLIBCSTRIP := $(STRIP) |
KLIBCSTRIP := $(STRIP) |
103 |
KLIBCNM := $(NM) |
KLIBCNM := $(NM) |
104 |
KLIBCOBJCOPY := $(OBJCOPY) |
KLIBCOBJCOPY := $(OBJCOPY) |
105 |
KLIBCOBJDUMP := $(OBJDUMP) |
KLIBCOBJDUMP := $(OBJDUMP) |
106 |
|
|
107 |
# klibc include paths |
# klibc include paths |
108 |
KLIBCCPPFLAGS := -nostdinc -iwithprefix include \ |
KLIBCCPPFLAGS := -nostdinc -iwithprefix include \ |
270 |
quiet_cmd_link_o_target = LD $@ |
quiet_cmd_link_o_target = LD $@ |
271 |
# If the list of objects to link is empty, just create an empty lib.a |
# If the list of objects to link is empty, just create an empty lib.a |
272 |
cmd_link_o_target = $(if $(strip $(lib-y)),\ |
cmd_link_o_target = $(if $(strip $(lib-y)),\ |
273 |
rm -f $@; $(KLIBCAR) cru $@ $(filter $(lib-y), $^),\ |
rm -f $@; $(call klibc-ar,cru,Dcr) $@ $(filter $(lib-y), $^),\ |
274 |
rm -f $@; $(KLIBCAR) crs $@) |
rm -f $@; $(call klibc-ar,crs,Dcrs) $@) |
275 |
|
|
276 |
$(lib-target): $(lib-y) FORCE |
$(lib-target): $(lib-y) FORCE |
277 |
$(call if_changed,link_o_target) |
$(call if_changed,link_o_target) |