ia64/xen-unstable

view tools/libxc/Makefile @ 14114:59b8d5168cc1

Reduce impact of saving/restoring/dumping large domains on Dom0 memory
usage by means of fadvise64() to tell the OS to discard the cache
pages used for the save/dump file.

Signed-off-by: Simon Graham <Simon.Graham@stratus.com>
author Keir Fraser <keir@xensource.com>
date Sat Feb 24 14:48:17 2007 +0000 (2007-02-24)
parents 3dac99b6034e
children 8e76e1b95b12 58e796d053ca
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 MAJOR = 3.0
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_physdev.c
16 CTRL_SRCS-y += xc_private.c
17 CTRL_SRCS-y += xc_sedf.c
18 CTRL_SRCS-y += xc_csched.c
19 CTRL_SRCS-y += xc_tbuf.c
20 CTRL_SRCS-y += xc_resume.c
21 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
22 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
23 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
24 CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
26 GUEST_SRCS-y :=
27 GUEST_SRCS-y += xg_private.c
28 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_linux_restore.c xc_linux_save.c
29 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c xc_hvm_restore.c xc_hvm_save.c
31 # symlink libelf from xen/common/libelf/
32 LIBELF_SRCS := libelf-tools.c libelf-loader.c
33 LIBELF_SRCS += libelf-dominfo.c libelf-relocate.c
35 libelf-tools.o: libelf-tools.c libelf-private.h
36 libelf-loader.o: libelf-loader.c libelf-private.h
37 libelf-dominfo.o: libelf-dominfo.c libelf-private.h
38 libelf-relocate.o: libelf-relocate.c libelf-private.h
40 $(LIBELF_SRCS) libelf-private.h:
41 ln -s ../../xen/common/libelf/$@ $@
43 # add libelf bits to libxc
44 GUEST_SRCS-y += $(LIBELF_SRCS)
46 # new domain builder
47 GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
48 GUEST_SRCS-y += xc_dom_elfloader.c
49 GUEST_SRCS-y += xc_dom_binloader.c
50 GUEST_SRCS-y += xc_dom_x86.c
51 GUEST_SRCS-y += xc_dom_ia64.c
53 GUEST_SRCS-$(CONFIG_X86) += xc_dom_compat_linux.c
54 GUEST_SRCS-$(CONFIG_IA64) += xc_dom_compat_linux.c
56 -include $(XEN_TARGET_ARCH)/Makefile
58 CFLAGS += -Werror -Wmissing-prototypes
59 CFLAGS += -fno-strict-aliasing
60 CFLAGS += $(INCLUDES) -I.
62 # Needed for posix_fadvise64() in xc_linux.c
63 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
65 # Define this to make it possible to run valgrind on code linked with these
66 # libraries.
67 #CFLAGS += -DVALGRIND -O0 -ggdb3
69 # Get gcc to generate the dependencies for us.
70 CFLAGS += -Wp,-MD,.$(@F).d
71 LDFLAGS += -L.
72 DEPS = .*.d
74 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
75 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
77 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
78 GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
80 LIB := libxenctrl.a
81 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
83 LIB += libxenguest.a
84 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
86 .PHONY: all
87 all: build
89 .PHONY: build
90 build: check-for-zlib mk-symlinks
91 $(MAKE) $(LIB)
93 .PHONY: check-for-zlib
94 check-for-zlib:
95 @if [ ! -e /usr/include/zlib.h ]; then \
96 echo "***********************************************************"; \
97 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
98 echo "***********************************************************"; \
99 false; \
100 fi
102 .PHONY: install
103 install: build
104 [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
105 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
106 $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
107 $(INSTALL_DATA) libxenctrl.a $(DESTDIR)/usr/$(LIBDIR)
108 ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so.$(MAJOR)
109 ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so
110 $(INSTALL_DATA) xenctrl.h $(DESTDIR)/usr/include
112 $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
113 $(INSTALL_DATA) libxenguest.a $(DESTDIR)/usr/$(LIBDIR)
114 ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so.$(MAJOR)
115 ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so
116 $(INSTALL_DATA) xenguest.h $(DESTDIR)/usr/include
118 .PHONY: TAGS
119 TAGS:
120 etags -t *.c *.h
122 .PHONY: clean
123 clean:
124 rm -rf *.rpm $(LIB) *~ $(DEPS) xen \
125 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
126 $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
128 .PHONY: rpm
129 rpm: build
130 rm -rf staging
131 mkdir staging
132 mkdir staging/i386
133 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
134 --define "_rpmdir$$PWD/staging" -bb rpm.spec
135 mv staging/i386/*.rpm .
136 rm -rf staging
138 # libxenctrl
140 libxenctrl.a: $(CTRL_LIB_OBJS)
141 $(AR) rc $@ $^
143 libxenctrl.so: libxenctrl.so.$(MAJOR)
144 ln -sf $< $@
145 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
146 ln -sf $< $@
148 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
149 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ -lpthread
151 # libxenguest
153 libxenguest.a: $(GUEST_LIB_OBJS)
154 $(AR) rc $@ $^
156 libxenguest.so: libxenguest.so.$(MAJOR)
157 ln -sf $< $@
158 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
159 ln -sf $< $@
161 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
162 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl -lpthread
164 -include $(DEPS)