direct-io.hg

view tools/libxc/Makefile @ 2787:a5c335665fd6

bitkeeper revision 1.1159.142.2 (41849fadYlUYMwSy6tcq8Y-Yi8NMZA)

Clean up libxc by allowing direct use of Xen headers from userland:
#include <xen/...>
author kaf24@freefall.cl.cam.ac.uk
date Sun Oct 31 08:17:49 2004 +0000 (2004-10-31)
parents d7a5a934e8d6
children b9377db0fc3a
line source
2 MAJOR = 1.3
3 MINOR = 0
4 SONAME = libxc.so.$(MAJOR)
6 CC = gcc
8 XEN_ROOT = ../..
9 include $(XEN_ROOT)/tools/Make.defs
11 vpath %h $(XEN_LINUX_INCLUDE)
12 INCLUDES += -I $(XEN_LINUX_INCLUDE)
14 vpath %c $(XEN_LIBXUTIL)
15 INCLUDES += -I $(XEN_LIBXUTIL)
17 SRCS :=
18 SRCS += xc_atropos.c
19 SRCS += xc_bvtsched.c
20 SRCS += xc_domain.c
21 SRCS += xc_evtchn.c
22 SRCS += xc_io.c
23 SRCS += xc_linux_build.c
24 SRCS += xc_linux_restore.c
25 SRCS += xc_linux_save.c
26 SRCS += xc_misc.c
27 SRCS += xc_physdev.c
28 SRCS += xc_private.c
29 SRCS += xc_rrobin.c
31 CFLAGS += -Wall
32 CFLAGS += -Werror
33 CFLAGS += -O3
34 CFLAGS += -fno-strict-aliasing
35 CFLAGS += $(INCLUDES)
36 # Get gcc to generate the dependencies for us.
37 CFLAGS += -Wp,-MD,.$(@F).d
38 DEPS = .*.d
40 OBJS = $(patsubst %.c,%.o,$(SRCS))
42 LIB = libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
44 all: check-for-zlib mk-symlinks $(LIB)
46 check-for-zlib:
47 @if [ ! -e /usr/include/zlib.h ]; then \
48 echo "***********************************************************"; \
49 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
50 echo "***********************************************************"; \
51 false; \
52 fi
54 mk-symlinks:
55 ln -sf $(XEN_HYPERVISOR_IFS) xen
57 install: all
58 mkdir -p $(prefix)/usr/lib
59 mkdir -p $(prefix)/usr/include
60 install -m0755 $(LIB) $(prefix)/usr/lib
61 install -m0644 xc.h $(prefix)/usr/include
63 clean:
64 $(RM) *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen
66 rpm: all
67 rm -rf staging
68 mkdir staging
69 mkdir staging/i386
70 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
71 --define "_rpmdir$$PWD/staging" -bb rpm.spec
72 mv staging/i386/*.rpm .
73 rm -rf staging
75 libxc.so:
76 ln -sf libxc.so.$(MAJOR) $@
77 libxc.so.$(MAJOR):
78 ln -sf libxc.so.$(MAJOR).$(MINOR) $@
79 libxc.so.$(MAJOR).$(MINOR): $(OBJS)
80 $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil -lxutil -lz
82 -include $(DEPS)