direct-io.hg

view tools/libxc/Makefile @ 3326:f36de623daa0

bitkeeper revision 1.1159.187.81 (41cc934bUot13IO0-1LsmhYl0sW9Zw)

Add plan9 builder support.
author iap10@labyrinth.cl.cam.ac.uk
date Fri Dec 24 22:08:11 2004 +0000 (2004-12-24)
parents 42bdcec01bc7
children 6b1aa25ff284 708bd9c8362b
line source
2 MAJOR = 2.0
3 MINOR = 0
4 SONAME = libxc.so.$(MAJOR)
6 CC = gcc
8 XEN_ROOT = ../..
9 include $(XEN_ROOT)/tools/Make.defs
11 vpath %c $(XEN_LIBXUTIL)
12 INCLUDES += -I $(XEN_LIBXUTIL)
14 SRCS :=
15 SRCS += xc_atropos.c
16 SRCS += xc_bvtsched.c
17 SRCS += xc_domain.c
18 SRCS += xc_evtchn.c
19 SRCS += xc_io.c
20 SRCS += xc_linux_build.c
21 SRCS += xc_plan9_build.c
22 SRCS += xc_linux_restore.c
23 SRCS += xc_linux_save.c
24 SRCS += xc_misc.c
25 SRCS += xc_physdev.c
26 SRCS += xc_private.c
27 SRCS += xc_rrobin.c
29 CFLAGS += -Wall
30 CFLAGS += -Werror
31 CFLAGS += -O3
32 CFLAGS += -fno-strict-aliasing
33 CFLAGS += $(INCLUDES) -I.
34 # Get gcc to generate the dependencies for us.
35 CFLAGS += -Wp,-MD,.$(@F).d
36 DEPS = .*.d
38 OBJS = $(patsubst %.c,%.o,$(SRCS))
40 LIB = libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
42 all: check-for-zlib mk-symlinks
43 $(MAKE) $(LIB)
45 check-for-zlib:
46 @if [ ! -e /usr/include/zlib.h ]; then \
47 echo "***********************************************************"; \
48 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
49 echo "***********************************************************"; \
50 false; \
51 fi
53 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
54 mk-symlinks:
55 [ -e xen/linux ] || mkdir -p xen/linux
56 [ -e xen/io ] || mkdir -p xen/io
57 ( cd xen >/dev/null ; \
58 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
59 ( cd xen/io >/dev/null ; \
60 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
61 ( cd xen/linux >/dev/null ; \
62 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
64 install: all
65 mkdir -p $(prefix)/usr/lib
66 mkdir -p $(prefix)/usr/include
67 install -m0755 $(LIB) $(prefix)/usr/lib
68 ln -sf libxc.so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/libxc.so.$(MAJOR)
69 ln -sf libxc.so.$(MAJOR) $(prefix)/usr/lib/libxc.so
70 install -m0644 xc.h $(prefix)/usr/include
72 clean:
73 rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen
75 rpm: all
76 rm -rf staging
77 mkdir staging
78 mkdir staging/i386
79 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
80 --define "_rpmdir$$PWD/staging" -bb rpm.spec
81 mv staging/i386/*.rpm .
82 rm -rf staging
84 libxc.so:
85 ln -sf libxc.so.$(MAJOR) $@
86 libxc.so.$(MAJOR):
87 ln -sf libxc.so.$(MAJOR).$(MINOR) $@
88 libxc.so.$(MAJOR).$(MINOR): $(OBJS)
89 $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil -lxutil -lz
91 -include $(DEPS)