debuggers.hg

view tools/libxc/Makefile @ 3699:09723a1de726

bitkeeper revision 1.1159.212.92 (4204921aEJqAV7p8MQEa98S3OLscXg)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
into freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
author iap10@freefall.cl.cam.ac.uk
date Sat Feb 05 09:30:02 2005 +0000 (2005-02-05)
parents c3c66a2762cb f9b3b23cf5ff
children 5039176029e8
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 LIB_NAME = libxc
9 SONAME = $(LIB_NAME).so.$(MAJOR)
11 CC = gcc
13 XEN_ROOT = ../..
14 include $(XEN_ROOT)/tools/Rules.mk
16 vpath %c $(XEN_LIBXUTIL)
17 INCLUDES += -I $(XEN_LIBXUTIL)
19 SRCS :=
20 SRCS += xc_atropos.c
21 SRCS += xc_bvtsched.c
22 SRCS += xc_domain.c
23 SRCS += xc_evtchn.c
24 SRCS += xc_io.c
25 SRCS += xc_linux_build.c
26 SRCS += xc_plan9_build.c
27 SRCS += xc_linux_restore.c
28 SRCS += xc_linux_save.c
29 SRCS += xc_misc.c
30 SRCS += xc_physdev.c
31 SRCS += xc_private.c
32 SRCS += xc_rrobin.c
33 SRCS += xc_vmx_build.c
35 CFLAGS += -Wall
36 CFLAGS += -Werror
37 CFLAGS += -O3
38 CFLAGS += -fno-strict-aliasing
39 CFLAGS += $(INCLUDES) -I.
40 # Get gcc to generate the dependencies for us.
41 CFLAGS += -Wp,-MD,.$(@F).d
42 DEPS = .*.d
44 OBJS := $(patsubst %.c,%.o,$(SRCS))
45 PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
47 LIB := $(LIB_NAME).a $(LIB_NAME).so $(LIB_NAME).so.$(MAJOR) $(LIB_NAME).so.$(MAJOR).$(MINOR)
49 all: check-for-zlib mk-symlinks
50 $(MAKE) $(LIB)
52 check-for-zlib:
53 @if [ ! -e /usr/include/zlib.h ]; then \
54 echo "***********************************************************"; \
55 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
56 echo "***********************************************************"; \
57 false; \
58 fi
60 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
61 mk-symlinks:
62 [ -e xen/linux ] || mkdir -p xen/linux
63 [ -e xen/io ] || mkdir -p xen/io
64 ( cd xen >/dev/null ; \
65 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
66 ( cd xen/io >/dev/null ; \
67 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
68 ( cd xen/linux >/dev/null ; \
69 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
71 install: all
72 [ -d $(DESTDIR)/usr/lib ] || $(INSTALL_DIR) $(DESTDIR)/usr/lib
73 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
74 $(INSTALL_PROG) $(LIB_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib
75 $(INSTALL_DATA) $(LIB_NAME).a $(DESTDIR)/usr/lib
76 ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so.$(MAJOR)
77 ln -sf $(LIB_NAME).so.$(MAJOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so
78 $(INSTALL_DATA) xc.h $(DESTDIR)/usr/include
80 clean:
81 rm -rf *.a *.so *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
83 rpm: all
84 rm -rf staging
85 mkdir staging
86 mkdir staging/i386
87 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
88 --define "_rpmdir$$PWD/staging" -bb rpm.spec
89 mv staging/i386/*.rpm .
90 rm -rf staging
92 $(PIC_OBJS): %.opic: %.c
93 $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
95 $(LIB_NAME).a: $(OBJS)
96 $(AR) rc $@ $^
98 $(LIB_NAME).so: $(LIB_NAME).so.$(MAJOR)
99 ln -sf $< $@
100 $(LIB_NAME).so.$(MAJOR): $(LIB_NAME).so.$(MAJOR).$(MINOR)
101 ln -sf $< $@
102 $(LIB_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS)
103 $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil -lxutil -lz
105 -include $(DEPS)