ia64/xen-unstable

view tools/libxc/Makefile @ 4895:24dfd18ea63e

bitkeeper revision 1.1159.258.120 (42848bfe8kMyWWcBA64rq7h7l7AyoA)

Shadow code bug fix (found by Ian) that was breaking refcounts, and subsequently
causing migration problems.
author mafetter@fleming.research
date Fri May 13 11:14:06 2005 +0000 (2005-05-13)
parents a0be5e5a1f37
children 0dc3b8b8c298
line source
2 INSTALL = install
3 INSTALL_PROG = $(INSTALL) -m0755
4 INSTALL_DATA = $(INSTALL) -m0644
5 INSTALL_DIR = $(INSTALL) -d -m0755
7 MAJOR = 2.0
8 MINOR = 0
10 CC = gcc
12 XEN_ROOT = ../..
13 include $(XEN_ROOT)/tools/Rules.mk
15 vpath %c $(XEN_LIBXUTIL)
16 INCLUDES += -I $(XEN_LIBXUTIL)
18 SRCS :=
19 SRCS += xc_atropos.c
20 SRCS += xc_bvtsched.c
21 SRCS += xc_domain.c
22 SRCS += xc_evtchn.c
23 SRCS += xc_io.c
24 SRCS += xc_linux_build.c
25 SRCS += xc_plan9_build.c
26 SRCS += xc_linux_restore.c
27 SRCS += xc_linux_save.c
28 SRCS += xc_misc.c
29 SRCS += xc_physdev.c
30 SRCS += xc_private.c
31 SRCS += xc_rrobin.c
33 CFLAGS += -Wall
34 CFLAGS += -Werror
35 CFLAGS += -O3
36 CFLAGS += -fno-strict-aliasing
37 CFLAGS += $(INCLUDES) -I.
38 # Get gcc to generate the dependencies for us.
39 CFLAGS += -Wp,-MD,.$(@F).d
40 DEPS = .*.d
42 LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
43 PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
45 LIB := libxc.a libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
47 all: build
48 build: check-for-zlib mk-symlinks
49 $(MAKE) $(LIB)
51 check-for-zlib:
52 @if [ ! -e /usr/include/zlib.h ]; then \
53 echo "***********************************************************"; \
54 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
55 echo "***********************************************************"; \
56 false; \
57 fi
59 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
60 mk-symlinks:
61 [ -e xen/linux ] || mkdir -p xen/linux
62 [ -e xen/io ] || mkdir -p xen/io
63 ( cd xen >/dev/null ; \
64 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
65 ( cd xen/io >/dev/null ; \
66 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
67 ( cd xen/linux >/dev/null ; \
68 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
70 install: build
71 [ -d $(DESTDIR)/usr/lib ] || $(INSTALL_DIR) $(DESTDIR)/usr/lib
72 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
73 $(INSTALL_PROG) libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib
74 $(INSTALL_DATA) libxc.a $(DESTDIR)/usr/lib
75 ln -sf libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/libxc.so.$(MAJOR)
76 ln -sf libxc.so.$(MAJOR) $(DESTDIR)/usr/lib/libxc.so
77 $(INSTALL_DATA) xc.h $(DESTDIR)/usr/include
79 clean:
80 rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
82 rpm: build
83 rm -rf staging
84 mkdir staging
85 mkdir staging/i386
86 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
87 --define "_rpmdir$$PWD/staging" -bb rpm.spec
88 mv staging/i386/*.rpm .
89 rm -rf staging
91 libxc.a: $(OBJS)
92 $(AR) rc $@ $^
94 libxc.so: libxc.so.$(MAJOR)
95 ln -sf $< $@
96 libxc.so.$(MAJOR): libxc.so.$(MAJOR).$(MINOR)
97 ln -sf $< $@
99 libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
100 $(CC) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
102 -include $(DEPS)