debuggers.hg

view tools/libxc/Makefile @ 22906:700ac6445812

Now add KDB to the non-kdb tree
author Mukesh Rathor
date Thu Feb 03 15:42:41 2011 -0800 (2011-02-03)
parents 76e07538870e
children
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_cpupool.c
12 CTRL_SRCS-y += xc_domain.c
13 CTRL_SRCS-y += xc_evtchn.c
14 CTRL_SRCS-y += xc_gnttab.c
15 CTRL_SRCS-y += xc_misc.c
16 CTRL_SRCS-y += xc_acm.c
17 CTRL_SRCS-y += xc_flask.c
18 CTRL_SRCS-y += xc_physdev.c
19 CTRL_SRCS-y += xc_private.c
20 CTRL_SRCS-y += xc_sedf.c
21 CTRL_SRCS-y += xc_csched.c
22 CTRL_SRCS-y += xc_csched2.c
23 CTRL_SRCS-y += xc_arinc653.c
24 CTRL_SRCS-y += xc_tbuf.c
25 CTRL_SRCS-y += xc_pm.c
26 CTRL_SRCS-y += xc_cpu_hotplug.c
27 CTRL_SRCS-y += xc_resume.c
28 CTRL_SRCS-y += xc_tmem.c
29 CTRL_SRCS-y += xc_mem_event.c
30 CTRL_SRCS-y += xc_mem_paging.c
31 CTRL_SRCS-y += xc_mem_access.c
32 CTRL_SRCS-y += xc_memshr.c
33 CTRL_SRCS-y += xc_hcall_buf.c
34 CTRL_SRCS-y += xc_foreign_memory.c
35 CTRL_SRCS-y += xtl_core.c
36 CTRL_SRCS-y += xtl_logger_stdio.c
37 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
38 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_linux_osdep.c
39 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
40 CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
41 CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
43 GUEST_SRCS-y :=
44 GUEST_SRCS-y += xg_private.c xc_suspend.c
45 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_domain_restore.c xc_domain_save.c
46 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_offline_page.c
47 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
49 vpath %.c ../../xen/common/libelf
50 CFLAGS += -I../../xen/common/libelf
52 GUEST_SRCS-y += libelf-tools.c libelf-loader.c
53 GUEST_SRCS-y += libelf-dominfo.c libelf-relocate.c
55 # new domain builder
56 GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
57 GUEST_SRCS-y += xc_dom_elfloader.c
58 GUEST_SRCS-$(CONFIG_X86) += xc_dom_bzimageloader.c
59 GUEST_SRCS-y += xc_dom_binloader.c
60 GUEST_SRCS-y += xc_dom_compat_linux.c
62 GUEST_SRCS-$(CONFIG_X86) += xc_dom_x86.c
63 GUEST_SRCS-$(CONFIG_X86) += xc_cpuid_x86.c
64 GUEST_SRCS-$(CONFIG_IA64) += xc_dom_ia64.c
66 OSDEP_SRCS-y += xenctrl_osdep_ENOSYS.c
68 -include $(XEN_TARGET_ARCH)/Makefile
70 CFLAGS += -Werror -Wmissing-prototypes
71 CFLAGS += $(INCLUDES) -I. -I../xenstore -I../include
73 # Needed for posix_fadvise64() in xc_linux.c
74 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
76 # Define this to make it possible to run valgrind on code linked with these
77 # libraries.
78 #CFLAGS += -DVALGRIND -O0 -ggdb3
80 LDFLAGS += -L.
82 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
83 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
85 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
86 GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
88 OSDEP_LIB_OBJS := $(patsubst %.c,%.o,$(OSDEP_SRCS-y))
89 OSDEP_PIC_OBJS := $(patsubst %.c,%.opic,$(OSDEP_SRCS-y))
91 LIB := libxenctrl.a
92 ifneq ($(stubdom),y)
93 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
94 endif
96 LIB += libxenguest.a
97 ifneq ($(stubdom),y)
98 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
99 endif
101 ifneq ($(stubdom),y)
102 LIB += xenctrl_osdep_ENOSYS.so
103 endif
105 .PHONY: all
106 all: build
108 .PHONY: build
109 build:
110 $(MAKE) libs
112 .PHONY: libs
113 libs: $(LIB)
115 .PHONY: install
116 install: build
117 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
118 $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
119 $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
120 $(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
121 ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
122 ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
123 $(INSTALL_DATA) xenctrl.h xenctrlosdep.h xentoollog.h $(DESTDIR)$(INCLUDEDIR)
124 $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
125 $(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
126 ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
127 ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
128 $(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
130 .PHONY: TAGS
131 TAGS:
132 etags -t *.c *.h
134 .PHONY: clean
135 clean:
136 rm -rf *.rpm $(LIB) *~ $(DEPS) \
137 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
138 $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) \
139 $(OSDEP_LIB_OBJS) $(OSDEP_PIC_OBJS)
141 .PHONY: rpm
142 rpm: build
143 rm -rf staging
144 mkdir staging
145 mkdir staging/i386
146 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
147 --define "_rpmdir$$PWD/staging" -bb rpm.spec
148 mv staging/i386/*.rpm .
149 rm -rf staging
151 # libxenctrl
153 libxenctrl.a: $(CTRL_LIB_OBJS)
154 $(AR) rc $@ $^
156 libxenctrl.so: libxenctrl.so.$(MAJOR)
157 ln -sf $< $@
158 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
159 ln -sf $< $@
161 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
162 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(DLOPEN_LIBS) $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS)
164 # libxenguest
166 libxenguest.a: $(GUEST_LIB_OBJS)
167 $(AR) rc $@ $^
169 libxenguest.so: libxenguest.so.$(MAJOR)
170 ln -sf $< $@
171 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
172 ln -sf $< $@
174 ifeq ($(CONFIG_MiniOS),y)
175 zlib-options =
176 else
177 zlib-options = $(shell \
178 (. ../check/funcs.sh; \
179 if has_header bzlib.h; then \
180 echo "-DHAVE_BZLIB"; \
181 echo "-lbz2"; \
182 fi; \
183 if has_header lzma.h; then \
184 echo "-DHAVE_LZMA"; \
185 echo "-llzma"; \
186 fi; \
187 if has_header lzo/lzo1x.h; then \
188 echo "-DHAVE_LZO1X"; \
189 echo "-llzo2"; \
190 fi) | grep $(1))
191 endif
193 xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)
194 xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D)
196 libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l)
197 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
198 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz -lxenctrl $(PTHREAD_LIBS)
200 xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so
201 $(CC) -g $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) -lxenctrl
203 -include $(DEPS)