aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-03-17 19:38:05 +0000
committerIan Campbell <ian.campbell@citrix.com>2011-03-17 19:38:05 +0000
commit494c9074b3dc32b7b3b7f84e6aca2781f9bdc096 (patch)
tree8000a58e21976f02b503a137c09a299ad375bf58 /tools/console
parent0394b57cda6f09f2d45feaf5a4f9dc62d6798c23 (diff)
downloadxen-494c9074b3dc32b7b3b7f84e6aca2781f9bdc096.tar.gz
xen-494c9074b3dc32b7b3b7f84e6aca2781f9bdc096.tar.bz2
xen-494c9074b3dc32b7b3b7f84e6aca2781f9bdc096.zip
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 <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/console')
-rw-r--r--tools/console/Makefile10
1 files changed, 5 insertions, 5 deletions
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)