debuggers.hg

annotate tools/libxc/Makefile @ 3623:0c8d62df84ae

bitkeeper revision 1.1159.223.51 (41fac87bR5uD5TAFu58tuaTMLSmbrw)

Fix makefiles creating copies instead of symlinks of shared libs.
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@intel.com>
author kaf24@scramble.cl.cam.ac.uk
date Fri Jan 28 23:19:23 2005 +0000 (2005-01-28)
parents 308203ddc173
children c3c66a2762cb f9b3b23cf5ff
rev   line source
iap10@3529 1 INSTALL = install
iap10@3529 2 INSTALL_PROG = $(INSTALL) -m0755
iap10@3529 3 INSTALL_DATA = $(INSTALL) -m0644
iap10@3529 4 INSTALL_DIR = $(INSTALL) -d -m0755
mjw@1661 5
kaf24@3574 6 MAJOR = 2.0
kaf24@3574 7 MINOR = 0
kaf24@3574 8 SONAME = libxc.so.$(MAJOR)
mjw@1661 9
mjw@1661 10 CC = gcc
mjw@1661 11
mjw@1661 12 XEN_ROOT = ../..
kaf24@3587 13 include $(XEN_ROOT)/tools/Rules.mk
mjw@1661 14
mjw@1661 15 vpath %c $(XEN_LIBXUTIL)
mjw@1661 16 INCLUDES += -I $(XEN_LIBXUTIL)
mjw@1661 17
mjw@1661 18 SRCS :=
mjw@1661 19 SRCS += xc_atropos.c
mjw@1661 20 SRCS += xc_bvtsched.c
mjw@1661 21 SRCS += xc_domain.c
mjw@1661 22 SRCS += xc_evtchn.c
mjw@1661 23 SRCS += xc_io.c
mjw@1661 24 SRCS += xc_linux_build.c
iap10@3364 25 SRCS += xc_plan9_build.c
mjw@1661 26 SRCS += xc_linux_restore.c
mjw@1661 27 SRCS += xc_linux_save.c
mjw@1661 28 SRCS += xc_misc.c
mjw@1661 29 SRCS += xc_physdev.c
mjw@1661 30 SRCS += xc_private.c
mjw@1661 31 SRCS += xc_rrobin.c
mjw@1661 32
mjw@1661 33 CFLAGS += -Wall
mjw@1661 34 CFLAGS += -Werror
mjw@1661 35 CFLAGS += -O3
mjw@1661 36 CFLAGS += -fno-strict-aliasing
kaf24@2859 37 CFLAGS += $(INCLUDES) -I.
mjw@1661 38 # Get gcc to generate the dependencies for us.
mjw@1661 39 CFLAGS += -Wp,-MD,.$(@F).d
mjw@1661 40 DEPS = .*.d
mjw@1661 41
kaf24@3574 42 OBJS = $(patsubst %.c,%.o,$(SRCS))
mjw@1661 43
kaf24@3574 44 LIB = libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
mjw@1661 45
kaf24@2878 46 all: check-for-zlib mk-symlinks
kaf24@2878 47 $(MAKE) $(LIB)
mjw@1661 48
mjw@1661 49 check-for-zlib:
mjw@1661 50 @if [ ! -e /usr/include/zlib.h ]; then \
mjw@1661 51 echo "***********************************************************"; \
mjw@1661 52 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
mjw@1661 53 echo "***********************************************************"; \
mjw@1661 54 false; \
mjw@1661 55 fi
mjw@1661 56
kaf24@2859 57 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
kaf24@2825 58 mk-symlinks:
kaf24@2859 59 [ -e xen/linux ] || mkdir -p xen/linux
kaf24@2864 60 [ -e xen/io ] || mkdir -p xen/io
kaf24@2864 61 ( cd xen >/dev/null ; \
kaf24@2864 62 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
kaf24@2864 63 ( cd xen/io >/dev/null ; \
kaf24@2864 64 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
kaf24@2864 65 ( cd xen/linux >/dev/null ; \
kaf24@2864 66 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
kaf24@2825 67
mjw@1661 68 install: all
cl349@3599 69 [ -d $(DESTDIR)/usr/lib ] || $(INSTALL_DIR) $(DESTDIR)/usr/lib
cl349@3599 70 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
kaf24@3623 71 $(INSTALL_PROG) libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib
kaf24@3582 72 ln -sf libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/libxc.so.$(MAJOR)
kaf24@3582 73 ln -sf libxc.so.$(MAJOR) $(DESTDIR)/usr/lib/libxc.so
iap10@3537 74 $(INSTALL_DATA) xc.h $(DESTDIR)/usr/include
mjw@1661 75
mjw@1661 76 clean:
kaf24@3574 77 rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen
mjw@1661 78
mjw@1661 79 rpm: all
mjw@1661 80 rm -rf staging
mjw@1661 81 mkdir staging
mjw@1661 82 mkdir staging/i386
mjw@1661 83 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
mjw@1661 84 --define "_rpmdir$$PWD/staging" -bb rpm.spec
mjw@1661 85 mv staging/i386/*.rpm .
mjw@1661 86 rm -rf staging
mjw@1661 87
kaf24@3574 88 libxc.so:
kaf24@3574 89 ln -sf libxc.so.$(MAJOR) $@
kaf24@3574 90 libxc.so.$(MAJOR):
kaf24@3574 91 ln -sf libxc.so.$(MAJOR).$(MINOR) $@
kaf24@3574 92 libxc.so.$(MAJOR).$(MINOR): $(OBJS)
kaf24@1664 93 $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil -lxutil -lz
mjw@1661 94
mjw@1661 95 -include $(DEPS)