debuggers.hg

view tools/libxc/Makefile @ 16715:c5deb251b9dc

Update version to 3.2.0-rc4
author Keir Fraser <keir.fraser@citrix.com>
date Sat Dec 29 17:57:37 2007 +0000 (2007-12-29)
parents 1f8797a74743
children 6ed9b42d1ec4
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 MAJOR = 3.2
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-$(CONFIG_POWERPC) += xc_core_powerpc.c
12 CTRL_SRCS-y += xc_domain.c
13 CTRL_SRCS-y += xc_evtchn.c
14 CTRL_SRCS-y += xc_misc.c
15 CTRL_SRCS-y += xc_acm.c
16 CTRL_SRCS-y += xc_flask.c
17 CTRL_SRCS-y += xc_physdev.c
18 CTRL_SRCS-y += xc_private.c
19 CTRL_SRCS-y += xc_sedf.c
20 CTRL_SRCS-y += xc_csched.c
21 CTRL_SRCS-y += xc_tbuf.c
22 CTRL_SRCS-y += xc_resume.c
23 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
24 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
25 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
26 CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
27 CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
29 GUEST_SRCS-y :=
30 GUEST_SRCS-y += xg_private.c
31 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_domain_restore.c xc_domain_save.c
32 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
34 # symlink libelf from xen/common/libelf/
35 LIBELF_SRCS := libelf-tools.c libelf-loader.c
36 LIBELF_SRCS += libelf-dominfo.c libelf-relocate.c
38 libelf-tools.o: libelf-tools.c libelf-private.h
39 libelf-loader.o: libelf-loader.c libelf-private.h
40 libelf-dominfo.o: libelf-dominfo.c libelf-private.h
41 libelf-relocate.o: libelf-relocate.c libelf-private.h
43 $(LIBELF_SRCS) libelf-private.h:
44 ln -s ../../xen/common/libelf/$@ $@
46 # add libelf bits to libxc
47 GUEST_SRCS-y += $(LIBELF_SRCS)
49 # new domain builder
50 GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
51 GUEST_SRCS-y += xc_dom_elfloader.c
52 GUEST_SRCS-y += xc_dom_binloader.c
53 GUEST_SRCS-y += xc_dom_compat_linux.c
55 GUEST_SRCS-$(CONFIG_X86) += xc_dom_x86.c
56 GUEST_SRCS-$(CONFIG_IA64) += xc_dom_ia64.c
57 GUEST_SRCS-$(CONFIG_POWERPC) += xc_dom_powerpc.c
59 -include $(XEN_TARGET_ARCH)/Makefile
61 CFLAGS += -Werror -Wmissing-prototypes
62 CFLAGS += $(INCLUDES) -I. -I../xenstore
64 # Needed for posix_fadvise64() in xc_linux.c
65 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
67 # Define this to make it possible to run valgrind on code linked with these
68 # libraries.
69 #CFLAGS += -DVALGRIND -O0 -ggdb3
71 # Get gcc to generate the dependencies for us.
72 CFLAGS += -Wp,-MD,.$(@F).d
73 LDFLAGS += -L.
74 DEPS = .*.d
76 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
77 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
79 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
80 GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
82 LIB := libxenctrl.a
83 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
85 LIB += libxenguest.a
86 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
88 .PHONY: all
89 all: build
91 .PHONY: build
92 build: check-for-zlib mk-symlinks
93 $(MAKE) $(LIB)
95 .PHONY: check-for-zlib
96 check-for-zlib:
97 @if [ ! -e /usr/include/zlib.h ]; then \
98 echo "***********************************************************"; \
99 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
100 echo "***********************************************************"; \
101 false; \
102 fi
104 .PHONY: install
105 install: build
106 [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
107 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
108 $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
109 $(INSTALL_DATA) libxenctrl.a $(DESTDIR)/usr/$(LIBDIR)
110 ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so.$(MAJOR)
111 ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so
112 $(INSTALL_DATA) xenctrl.h $(DESTDIR)/usr/include
114 $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
115 $(INSTALL_DATA) libxenguest.a $(DESTDIR)/usr/$(LIBDIR)
116 ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so.$(MAJOR)
117 ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so
118 $(INSTALL_DATA) xenguest.h $(DESTDIR)/usr/include
120 .PHONY: TAGS
121 TAGS:
122 etags -t *.c *.h
124 .PHONY: clean
125 clean:
126 rm -rf *.rpm $(LIB) *~ $(DEPS) xen \
127 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
128 $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) \
129 $(LIBELF_SRCS) libelf-private.h
131 .PHONY: rpm
132 rpm: build
133 rm -rf staging
134 mkdir staging
135 mkdir staging/i386
136 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
137 --define "_rpmdir$$PWD/staging" -bb rpm.spec
138 mv staging/i386/*.rpm .
139 rm -rf staging
141 # libxenctrl
143 libxenctrl.a: $(CTRL_LIB_OBJS)
144 $(AR) rc $@ $^
146 libxenctrl.so: libxenctrl.so.$(MAJOR)
147 ln -sf $< $@
148 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
149 ln -sf $< $@
151 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
152 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ -lpthread
154 # libxenguest
156 libxenguest.a: $(GUEST_LIB_OBJS)
157 $(AR) rc $@ $^
159 libxenguest.so: libxenguest.so.$(MAJOR)
160 ln -sf $< $@
161 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
162 ln -sf $< $@
164 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
165 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl -lpthread
167 -include $(DEPS)