ia64/xen-unstable

view tools/libxc/Makefile @ 3539:93b8d938e316

bitkeeper revision 1.1159.212.42 (41f6790d_JgecZcMdZzpMtjaR5vjUg)

Upgrade library version numbers.
author kaf24@scramble.cl.cam.ac.uk
date Tue Jan 25 16:51:25 2005 +0000 (2005-01-25)
parents f7ab8a19799b
children d8ba911dce48 1b6a9577c36d
line source
1 INSTALL = install
2 INSTALL_PROG = $(INSTALL) -m0755
3 INSTALL_DATA = $(INSTALL) -m0644
4 INSTALL_DIR = $(INSTALL) -d -m0755
6 MAJOR = 3.0
7 MINOR = 0
8 SONAME = libxc.so.$(MAJOR)
10 CC = gcc
12 XEN_ROOT = ../..
13 include $(XEN_ROOT)/tools/Make.defs
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
32 SRCS += xc_vmx_build.c
34 CFLAGS += -Wall
35 CFLAGS += -Werror
36 CFLAGS += -O3
37 CFLAGS += -fno-strict-aliasing
38 CFLAGS += $(INCLUDES) -I.
39 # Get gcc to generate the dependencies for us.
40 CFLAGS += -Wp,-MD,.$(@F).d
41 DEPS = .*.d
43 OBJS = $(patsubst %.c,%.o,$(SRCS))
45 LIB = libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
47 all: check-for-zlib mk-symlinks
48 $(MAKE) $(LIB)
50 check-for-zlib:
51 @if [ ! -e /usr/include/zlib.h ]; then \
52 echo "***********************************************************"; \
53 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
54 echo "***********************************************************"; \
55 false; \
56 fi
58 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
59 mk-symlinks:
60 [ -e xen/linux ] || mkdir -p xen/linux
61 [ -e xen/io ] || mkdir -p xen/io
62 ( cd xen >/dev/null ; \
63 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
64 ( cd xen/io >/dev/null ; \
65 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
66 ( cd xen/linux >/dev/null ; \
67 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
69 install: all
70 $(INSTALL_DIR) $(DESTDIR)/usr/lib
71 $(INSTALL_DIR) $(DESTDIR)/usr/include
72 $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/lib
73 ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so.$(MAJOR)
74 ln -sf $(LIB_NAME).so.$(MAJOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so
75 $(INSTALL_DATA) xc.h $(DESTDIR)/usr/include
77 clean:
78 rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen
80 rpm: all
81 rm -rf staging
82 mkdir staging
83 mkdir staging/i386
84 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
85 --define "_rpmdir$$PWD/staging" -bb rpm.spec
86 mv staging/i386/*.rpm .
87 rm -rf staging
89 libxc.so:
90 ln -sf libxc.so.$(MAJOR) $@
91 libxc.so.$(MAJOR):
92 ln -sf libxc.so.$(MAJOR).$(MINOR) $@
93 libxc.so.$(MAJOR).$(MINOR): $(OBJS)
94 $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil -lxutil -lz
96 -include $(DEPS)