ia64/xen-unstable

view tools/libxc/Makefile @ 3562:308203ddc173

bitkeeper revision 1.1159.223.48 (41f9204fFDaBv7jCdF63bwx5zXNlNA)

Merge arcadians.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
into arcadians.cl.cam.ac.uk:/local/scratch-2/cl349/xen-2.0-testing.bk
author cl349@arcadians.cl.cam.ac.uk
date Thu Jan 27 17:09:35 2005 +0000 (2005-01-27)
parents dca8a77a487d 0a8bc30a7c4b
children 2e60786262c4 0c8d62df84ae
line source
1 INSTALL = install
2 INSTALL_PROG = $(INSTALL) -m0755
3 INSTALL_DATA = $(INSTALL) -m0644
4 INSTALL_DIR = $(INSTALL) -d -m0755
6 MAJOR = 2.0
7 MINOR = 0
8 SONAME = libxc.so.$(MAJOR)
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 OBJS = $(patsubst %.c,%.o,$(SRCS))
44 LIB = libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
46 all: check-for-zlib mk-symlinks
47 $(MAKE) $(LIB)
49 check-for-zlib:
50 @if [ ! -e /usr/include/zlib.h ]; then \
51 echo "***********************************************************"; \
52 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
53 echo "***********************************************************"; \
54 false; \
55 fi
57 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
58 mk-symlinks:
59 [ -e xen/linux ] || mkdir -p xen/linux
60 [ -e xen/io ] || mkdir -p xen/io
61 ( cd xen >/dev/null ; \
62 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
63 ( cd xen/io >/dev/null ; \
64 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
65 ( cd xen/linux >/dev/null ; \
66 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
68 install: all
69 [ -d $(DESTDIR)/usr/lib ] || $(INSTALL_DIR) $(DESTDIR)/usr/lib
70 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
71 $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/lib
72 ln -sf libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/libxc.so.$(MAJOR)
73 ln -sf libxc.so.$(MAJOR) $(DESTDIR)/usr/lib/libxc.so
74 $(INSTALL_DATA) xc.h $(DESTDIR)/usr/include
76 clean:
77 rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen
79 rpm: all
80 rm -rf staging
81 mkdir staging
82 mkdir staging/i386
83 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
84 --define "_rpmdir$$PWD/staging" -bb rpm.spec
85 mv staging/i386/*.rpm .
86 rm -rf staging
88 libxc.so:
89 ln -sf libxc.so.$(MAJOR) $@
90 libxc.so.$(MAJOR):
91 ln -sf libxc.so.$(MAJOR).$(MINOR) $@
92 libxc.so.$(MAJOR).$(MINOR): $(OBJS)
93 $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil -lxutil -lz
95 -include $(DEPS)