debuggers.hg

view tools/libxc/Makefile @ 21067:b4a1832a916f

Update Xen version to 4.0.0-rc6
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 09 18:18:05 2010 +0000 (2010-03-09)
parents 0b138a019292
children 3cdd4cf2c20e
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 MAJOR = 4.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_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-y += xc_mem_event.c
26 CTRL_SRCS-y += xc_mem_paging.c
27 CTRL_SRCS-y += xc_memshr.c
28 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
29 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
30 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
31 CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
32 CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
33 CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
35 GUEST_SRCS-y :=
36 GUEST_SRCS-y += xg_private.c xc_suspend.c
37 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_domain_restore.c xc_domain_save.c
38 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_offline_page.c
39 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
41 vpath %.c ../../xen/common/libelf
42 CFLAGS += -I../../xen/common/libelf
44 GUEST_SRCS-y += libelf-tools.c libelf-loader.c
45 GUEST_SRCS-y += libelf-dominfo.c libelf-relocate.c
47 # new domain builder
48 GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
49 GUEST_SRCS-y += xc_dom_elfloader.c
50 GUEST_SRCS-$(CONFIG_X86) += xc_dom_bzimageloader.c
51 GUEST_SRCS-y += xc_dom_binloader.c
52 GUEST_SRCS-y += xc_dom_compat_linux.c
54 GUEST_SRCS-$(CONFIG_X86) += xc_dom_x86.c
55 GUEST_SRCS-$(CONFIG_X86) += xc_cpuid_x86.c
56 GUEST_SRCS-$(CONFIG_IA64) += xc_dom_ia64.c
58 -include $(XEN_TARGET_ARCH)/Makefile
60 CFLAGS += -Werror -Wmissing-prototypes
61 CFLAGS += $(INCLUDES) -I. -I../xenstore -I../include
63 # Needed for posix_fadvise64() in xc_linux.c
64 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
66 # Define this to make it possible to run valgrind on code linked with these
67 # libraries.
68 #CFLAGS += -DVALGRIND -O0 -ggdb3
70 LDFLAGS += -L.
72 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
73 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
75 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
76 GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
78 LIB := libxenctrl.a
79 ifneq ($(stubdom),y)
80 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
81 endif
83 LIB += libxenguest.a
84 ifneq ($(stubdom),y)
85 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
86 endif
88 .PHONY: all
89 all: build
91 .PHONY: build
92 build:
93 $(MAKE) libs
95 .PHONY: libs
96 libs: $(LIB)
98 .PHONY: install
99 install: build
100 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
101 $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
102 $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
103 $(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
104 ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
105 ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
106 $(INSTALL_DATA) xenctrl.h $(DESTDIR)$(INCLUDEDIR)
108 $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
109 $(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
110 ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
111 ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
112 $(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
114 .PHONY: TAGS
115 TAGS:
116 etags -t *.c *.h
118 .PHONY: clean
119 clean:
120 rm -rf *.rpm $(LIB) *~ $(DEPS) \
121 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
122 $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
124 .PHONY: rpm
125 rpm: build
126 rm -rf staging
127 mkdir staging
128 mkdir staging/i386
129 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
130 --define "_rpmdir$$PWD/staging" -bb rpm.spec
131 mv staging/i386/*.rpm .
132 rm -rf staging
134 # libxenctrl
136 libxenctrl.a: $(CTRL_LIB_OBJS)
137 $(AR) rc $@ $^
139 libxenctrl.so: libxenctrl.so.$(MAJOR)
140 ln -sf $< $@
141 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
142 ln -sf $< $@
144 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
145 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ $(PTHREAD_LIBS)
147 # libxenguest
149 libxenguest.a: $(GUEST_LIB_OBJS)
150 $(AR) rc $@ $^
152 libxenguest.so: libxenguest.so.$(MAJOR)
153 ln -sf $< $@
154 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
155 ln -sf $< $@
157 ifeq ($(CONFIG_MiniOS),y)
158 zlib-options =
159 else
160 zlib-options = $(shell \
161 (. ../check/funcs.sh; \
162 if has_header bzlib.h; then \
163 echo "-DHAVE_BZLIB"; \
164 echo "-lbz2"; \
165 fi; \
166 if has_header lzma.h; then \
167 echo "-DHAVE_LZMA"; \
168 echo "-llzma"; \
169 fi) | grep $(1))
170 endif
172 xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)
173 xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D)
175 libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(call zlib-options,l)
176 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
177 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl $(PTHREAD_LIBS)
179 -include $(DEPS)