debuggers.hg

view tools/misc/Makefile @ 22018:d3de6f484610

split LDLIBS from LDFLAGS to fix link errors in recent toolchains

Linker command lines are order-sensitive.
Move linker options -Lfoo -lfoo from LDFLAGS to LDLIBS and place this new
variable after the objects to link. This resolves build errors in xenpagin
and blktap with recent toolchains.

rename SHLIB_CFLAGS to SHLIB_LDFLAGS
rename LDFLAGS_* to LDLIBS_*
move LDFLAGS usage after CFLAGS in CC calls
remove stale comments in xenpaging Makefile

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Stefano Stabellini <sstabellini@xensource.com>
date Wed Aug 11 18:02:32 2010 +0100 (2010-08-11)
parents 754877be695b
children
line source
1 XEN_ROOT=../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 CFLAGS += -Werror
6 INCLUDES += -I $(XEN_XC)
7 INCLUDES += -I $(XEN_LIBXC)
8 INCLUDES += -I $(XEN_INCLUDE)
9 CFLAGS += $(INCLUDES)
11 HDRS = $(wildcard *.h)
13 TARGETS-y := xenperf xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd
14 TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash
15 TARGETS-$(CONFIG_MIGRATE) += xen-hptool
16 TARGETS := $(TARGETS-y)
18 SUBDIRS-$(CONFIG_LOMOUNT) += lomount
19 SUBDIRS-$(CONFIG_MINITERM) += miniterm
20 SUBDIRS := $(SUBDIRS-y)
22 INSTALL_BIN-y := xencons
23 INSTALL_BIN-$(CONFIG_X86) += xen-detect
24 INSTALL_BIN := $(INSTALL_BIN-y)
26 INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd
27 INSTALL_SBIN-$(CONFIG_X86) += xen-hvmctx xen-hvmcrash
28 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
29 INSTALL_SBIN := $(INSTALL_SBIN-y)
31 .PHONY: all
32 all: build
34 .PHONY: build
35 build: $(TARGETS)
36 set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d; done
38 .PHONY: install
39 install: build
40 $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
41 $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
42 $(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(BINDIR)
43 $(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(SBINDIR)
44 set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
46 .PHONY: clean
47 clean:
48 $(RM) *.o $(TARGETS) *~ $(DEPS)
49 set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
51 %.o: %.c $(HDRS) Makefile
52 $(CC) -c $(CFLAGS) -o $@ $<
54 xen-hvmctx xen-hvmcrash xenperf xenpm gtracestat xenlockprof xen-hptool xenwatchdogd: %: %.o Makefile
55 $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore)
57 gtraceview: %: %.o Makefile
58 $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CURSES_LIBS)
60 -include $(DEPS)