From 494c9074b3dc32b7b3b7f84e6aca2781f9bdc096 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 17 Mar 2011 19:38:05 +0000 Subject: tools: do not link against unused libraries. A fair few things under tools link against libraries which they don't even use. Most of this appears to come from copy-and-pasting previous Makefile snippets and cargo-culting plus the tendency to define global $(LIBS) even for Makefiles which build multiple separate utilities or libraries. Identified by comparing a build with --as-needed to one without by looking at the NEEDED header of all ELF objects. Signed-off-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Jackson --- tools/console/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/console') diff --git a/tools/console/Makefile b/tools/console/Makefile index 5a119b44cd..0203c4a417 100644 --- a/tools/console/Makefile +++ b/tools/console/Makefile @@ -1,4 +1,3 @@ - XEN_ROOT=$(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk @@ -8,9 +7,10 @@ CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_libxenstore) LDLIBS += $(LDLIBS_libxenctrl) LDLIBS += $(LDLIBS_libxenstore) -LDLIBS += $(UTIL_LIBS) LDLIBS += $(SOCKET_LIBS) -LDLIBS += -lrt + +LDLIBS_xenconsoled += $(UTIL_LIBS) +LDLIBS_xenconsoled += -lrt BIN = xenconsoled xenconsole @@ -23,10 +23,10 @@ clean: $(RM) client/*.o daemon/*.o xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c)) - $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) + $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) $(LDLIBS_xenconsoled) xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c)) - $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) + $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) $(LDLIBS_xenconsole) .PHONY: install install: $(BIN) -- cgit v1.2.3