ia64/xen-unstable

view tools/libxc/Makefile @ 19714:76afaac7df86

libxc: fix link error on ia64

On ia64, xen-unstable 19698:f72d26c00002 cannot be built:
../../tools/libxc/libxenguest.so: undefined reference to
`xc_core_arch_map_p2m_writable'
../../tools/libxc/libxenguest.so: undefined reference to `xc_map_m2p'

Because xc_offline_page.c requires xc_map_m2p() in xc_domain_save.c,
xc_offline_page.c must be compiled only if CONFIG_MIGRATE=3Dy.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 04 10:36:36 2009 +0100 (2009-06-04)
parents 84c1f7c46444
children
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 MAJOR = 3.4
5 MINOR = 0
7 CTRL_SRCS-y :=
8 CTRL_SRCS-y += xc_core.c
9 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
10 CTRL_SRCS-$(CONFIG_IA64) += xc_core_ia64.c
11 CTRL_SRCS-y += xc_domain.c
12 CTRL_SRCS-y += xc_evtchn.c
13 CTRL_SRCS-y += xc_misc.c
14 CTRL_SRCS-y += xc_acm.c
15 CTRL_SRCS-y += xc_flask.c
16 CTRL_SRCS-y += xc_physdev.c
17 CTRL_SRCS-y += xc_private.c
18 CTRL_SRCS-y += xc_sedf.c
19 CTRL_SRCS-y += xc_csched.c
20 CTRL_SRCS-y += xc_tbuf.c
21 CTRL_SRCS-y += xc_pm.c
22 CTRL_SRCS-y += xc_cpu_hotplug.c
23 CTRL_SRCS-y += xc_resume.c
24 CTRL_SRCS-y += xc_tmem.c
25 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
26 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
27 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
28 CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
29 CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
30 CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
32 GUEST_SRCS-y :=
33 GUEST_SRCS-y += xg_private.c xc_suspend.c
34 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_domain_restore.c xc_domain_save.c
35 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_offline_page.c
36 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
38 vpath %.c ../../xen/common/libelf
39 CFLAGS += -I../../xen/common/libelf
41 GUEST_SRCS-y += libelf-tools.c libelf-loader.c
42 GUEST_SRCS-y += libelf-dominfo.c libelf-relocate.c
44 # new domain builder
45 GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
46 GUEST_SRCS-y += xc_dom_elfloader.c
47 GUEST_SRCS-$(CONFIG_X86) += xc_dom_bzimageloader.c
48 GUEST_SRCS-y += xc_dom_binloader.c
49 GUEST_SRCS-y += xc_dom_compat_linux.c
51 GUEST_SRCS-$(CONFIG_X86) += xc_dom_x86.c
52 GUEST_SRCS-$(CONFIG_X86) += xc_cpuid_x86.c
53 GUEST_SRCS-$(CONFIG_IA64) += xc_dom_ia64.c
55 -include $(XEN_TARGET_ARCH)/Makefile
57 CFLAGS += -Werror -Wmissing-prototypes
58 CFLAGS += $(INCLUDES) -I. -I../xenstore -I../include
60 # Needed for posix_fadvise64() in xc_linux.c
61 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
63 # Define this to make it possible to run valgrind on code linked with these
64 # libraries.
65 #CFLAGS += -DVALGRIND -O0 -ggdb3
67 LDFLAGS += -L.
69 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
70 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
72 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
73 GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
75 LIB := libxenctrl.a
76 ifneq ($(stubdom),y)
77 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
78 endif
80 LIB += libxenguest.a
81 ifneq ($(stubdom),y)
82 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
83 endif
85 .PHONY: all
86 all: build
88 .PHONY: build
89 build:
90 $(MAKE) libs
92 .PHONY: libs
93 libs: $(LIB)
95 .PHONY: install
96 install: build
97 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
98 $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
99 $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
100 $(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
101 ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
102 ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
103 $(INSTALL_DATA) xenctrl.h $(DESTDIR)$(INCLUDEDIR)
105 $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
106 $(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
107 ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
108 ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
109 $(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
111 .PHONY: TAGS
112 TAGS:
113 etags -t *.c *.h
115 .PHONY: clean
116 clean:
117 rm -rf *.rpm $(LIB) *~ $(DEPS) \
118 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
119 $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
121 .PHONY: rpm
122 rpm: build
123 rm -rf staging
124 mkdir staging
125 mkdir staging/i386
126 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
127 --define "_rpmdir$$PWD/staging" -bb rpm.spec
128 mv staging/i386/*.rpm .
129 rm -rf staging
131 # libxenctrl
133 libxenctrl.a: $(CTRL_LIB_OBJS)
134 $(AR) rc $@ $^
136 libxenctrl.so: libxenctrl.so.$(MAJOR)
137 ln -sf $< $@
138 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
139 ln -sf $< $@
141 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
142 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ $(PTHREAD_LIBS)
144 # libxenguest
146 libxenguest.a: $(GUEST_LIB_OBJS)
147 $(AR) rc $@ $^
149 libxenguest.so: libxenguest.so.$(MAJOR)
150 ln -sf $< $@
151 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
152 ln -sf $< $@
154 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
155 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl $(PTHREAD_LIBS)
157 -include $(DEPS)