Clean up LDLIBS handling

We currently set LDLIBS to include libyaml globally if we're using it.
However only dtc itself actually needs to link with libyaml - the other
tool binaries don't.  Avoid that unnecessary inclusion by making LDLIBS
handling per-target.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
David Gibson 2019-03-29 16:15:08 +11:00
parent 6ef8fcd05b
commit c5d45188f9
1 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ NO_YAML := $(shell $(PKG_CONFIG) --exists yaml-0.1; echo $$?)
ifeq ($(NO_YAML),1) ifeq ($(NO_YAML),1)
CFLAGS += -DNO_YAML CFLAGS += -DNO_YAML
else else
LDLIBS += $(shell $(PKG_CONFIG) --libs yaml-0.1) LDLIBS_dtc += $(shell $(PKG_CONFIG) --libs yaml-0.1)
endif endif


ifeq ($(HOSTOS),darwin) ifeq ($(HOSTOS),darwin)
@ -330,7 +330,7 @@ clean: libfdt_clean pylibfdt_clean tests_clean
# #
%: %.o %: %.o
@$(VECHO) LD $@ @$(VECHO) LD $@
$(LINK.c) -o $@ $^ $(LDLIBS) $(LINK.c) -o $@ $^ $(LDLIBS_$*)


%.o: %.c %.o: %.c
@$(VECHO) CC $@ @$(VECHO) CC $@