debuggers.hg

view tools/libxc/Makefile @ 3289:a169836882cb

bitkeeper revision 1.1159.170.59 (41b4c2fdJ2gj_BWy27Vj3ptayZp_yg)

sync w/ head.
author cl349@arcadians.cl.cam.ac.uk
date Mon Dec 06 20:37:17 2004 +0000 (2004-12-06)
parents 3500fed096b1 42bdcec01bc7
children fd0d4d8e6193 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_linux_restore.c
22 SRCS += xc_linux_save.c
23 SRCS += xc_misc.c
24 SRCS += xc_physdev.c
25 SRCS += xc_private.c
26 SRCS += xc_rrobin.c
28 CFLAGS += -Wall
29 CFLAGS += -Werror
30 CFLAGS += -O3
31 CFLAGS += -fno-strict-aliasing
32 CFLAGS += $(INCLUDES) -I.
33 # Get gcc to generate the dependencies for us.
34 CFLAGS += -Wp,-MD,.$(@F).d
35 DEPS = .*.d
37 OBJS = $(patsubst %.c,%.o,$(SRCS))
39 LIB = libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
41 all: check-for-zlib mk-symlinks
42 $(MAKE) $(LIB)
44 check-for-zlib:
45 @if [ ! -e /usr/include/zlib.h ]; then \
46 echo "***********************************************************"; \
47 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
48 echo "***********************************************************"; \
49 false; \
50 fi
52 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
53 mk-symlinks:
54 [ -e xen/linux ] || mkdir -p xen/linux
55 [ -e xen/io ] || mkdir -p xen/io
56 ( cd xen >/dev/null ; \
57 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
58 ( cd xen/io >/dev/null ; \
59 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
60 ( cd xen/linux >/dev/null ; \
61 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
63 install: all
64 mkdir -p $(prefix)/usr/lib
65 mkdir -p $(prefix)/usr/include
66 install -m0755 $(LIB) $(prefix)/usr/lib
67 ln -sf libxc.so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/libxc.so.$(MAJOR)
68 ln -sf libxc.so.$(MAJOR) $(prefix)/usr/lib/libxc.so
69 install -m0644 xc.h $(prefix)/usr/include
71 clean:
72 rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen
74 rpm: all
75 rm -rf staging
76 mkdir staging
77 mkdir staging/i386
78 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
79 --define "_rpmdir$$PWD/staging" -bb rpm.spec
80 mv staging/i386/*.rpm .
81 rm -rf staging
83 libxc.so:
84 ln -sf libxc.so.$(MAJOR) $@
85 libxc.so.$(MAJOR):
86 ln -sf libxc.so.$(MAJOR).$(MINOR) $@
87 libxc.so.$(MAJOR).$(MINOR): $(OBJS)
88 $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil -lxutil -lz
90 -include $(DEPS)