ia64/xen-unstable

annotate tools/libxc/Makefile @ 6432:b54144915ae6

merge?
author cl349@firebug.cl.cam.ac.uk
date Thu Aug 25 16:26:30 2005 +0000 (2005-08-25)
parents 3428d58a85e1 e26f574eac9a
children 0610add7c3fe
rev   line source
kaf24@3664 1
iap10@3491 2 INSTALL = install
iap10@3491 3 INSTALL_PROG = $(INSTALL) -m0755
iap10@3491 4 INSTALL_DATA = $(INSTALL) -m0644
iap10@3491 5 INSTALL_DIR = $(INSTALL) -d -m0755
mjw@1623 6
kaf24@3539 7 MAJOR = 3.0
kaf24@3536 8 MINOR = 0
mjw@1623 9
vh249@6140 10 CC = gcc
mjw@1623 11
mjw@1623 12 XEN_ROOT = ../..
kaf24@3549 13 include $(XEN_ROOT)/tools/Rules.mk
mjw@1623 14
cl349@6404 15 SRCS :=
cl349@6404 16 BUILD_SRCS :=
cl349@6404 17 SRCS += xc_bvtsched.c
cl349@6404 18 SRCS += xc_core.c
cl349@6404 19 SRCS += xc_domain.c
cl349@6404 20 SRCS += xc_evtchn.c
cl349@6404 21 SRCS += xc_gnttab.c
cl349@6404 22 SRCS += xc_misc.c
cl349@6404 23 SRCS += xc_physdev.c
cl349@6404 24 SRCS += xc_private.c
cl349@6404 25 SRCS += xc_sedf.c
cl349@6404 26
kaf24@5930 27 ifeq ($(XEN_TARGET_ARCH),ia64)
cl349@6404 28 BUILD_SRCS += xc_ia64_stubs.c
kaf24@5930 29 else
cl349@6404 30 SRCS += xc_ptrace.c
cl349@6404 31 SRCS += xc_ptrace_core.c
cl349@6404 32
cl349@6404 33 BUILD_SRCS := xc_load_aout9.c
cl349@6404 34 BUILD_SRCS += xc_load_bin.c
cl349@6404 35 BUILD_SRCS += xc_load_elf.c
cl349@6404 36 BUILD_SRCS += xc_linux_build.c
cl349@6404 37 BUILD_SRCS += xc_linux_restore.c
cl349@6404 38 BUILD_SRCS += xc_linux_save.c
cl349@6404 39 BUILD_SRCS += xc_vmx_build.c
cl349@6404 40 BUILD_SRCS += xg_private.c
kaf24@5930 41 endif
mjw@1623 42
mjw@1623 43 CFLAGS += -Wall
mjw@1623 44 CFLAGS += -Werror
mjw@1623 45 CFLAGS += -O3
mjw@1623 46 CFLAGS += -fno-strict-aliasing
kaf24@2821 47 CFLAGS += $(INCLUDES) -I.
mjw@1623 48 # Get gcc to generate the dependencies for us.
mjw@1623 49 CFLAGS += -Wp,-MD,.$(@F).d
cl349@6404 50 LDFLAGS += -L.
mjw@1623 51 DEPS = .*.d
mjw@1623 52
kaf24@3664 53 LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
iap10@3660 54 PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
mjw@1623 55
cl349@6404 56 LIB_BUILD_OBJS := $(patsubst %.c,%.o,$(BUILD_SRCS))
cl349@6404 57 PIC_BUILD_OBJS := $(patsubst %.c,%.opic,$(BUILD_SRCS))
cl349@6404 58
cl349@6404 59 LIB := libxenctrl.a
cl349@6404 60 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
cl349@6404 61
cl349@6404 62 LIB += libxenguest.a
cl349@6404 63 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
mjw@1623 64
doogie@4109 65 all: build
cl349@5139 66 build: check-for-zlib mk-symlinks
cl349@5139 67 $(MAKE) $(LIB)
mjw@1623 68
mjw@1623 69 check-for-zlib:
mjw@1623 70 @if [ ! -e /usr/include/zlib.h ]; then \
mjw@1623 71 echo "***********************************************************"; \
mjw@1623 72 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
mjw@1623 73 echo "***********************************************************"; \
mjw@1623 74 false; \
mjw@1623 75 fi
mjw@1623 76
kaf24@5740 77 LINUX_ROOT := $(XEN_ROOT)/linux-2.6-xen-sparse
kaf24@2787 78 mk-symlinks:
kaf24@2821 79 [ -e xen/linux ] || mkdir -p xen/linux
kaf24@2826 80 [ -e xen/io ] || mkdir -p xen/io
kaf24@2826 81 ( cd xen >/dev/null ; \
kaf24@2826 82 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
kaf24@2826 83 ( cd xen/io >/dev/null ; \
kaf24@2826 84 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
kaf24@2826 85 ( cd xen/linux >/dev/null ; \
kaf24@2826 86 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
kaf24@2787 87
doogie@4109 88 install: build
katzj@4544 89 [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
cl349@3561 90 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
cl349@6403 91 $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
cl349@6403 92 $(INSTALL_DATA) libxenctrl.a $(DESTDIR)/usr/$(LIBDIR)
cl349@6403 93 ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so.$(MAJOR)
cl349@6403 94 ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so
kaf24@6409 95 $(INSTALL_DATA) xenctrl.h $(DESTDIR)/usr/include
mjw@1623 96
cl349@6404 97 $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
cl349@6404 98 $(INSTALL_DATA) libxenguest.a $(DESTDIR)/usr/$(LIBDIR)
cl349@6404 99 ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so.$(MAJOR)
cl349@6404 100 ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so
cl349@6404 101
maf46@3878 102 .PHONY: TAGS clean rpm install all
maf46@3878 103
maf46@3878 104 TAGS:
maf46@3878 105 etags -t $(SRCS) *.h
maf46@3878 106
mjw@1623 107 clean:
kaf24@3664 108 rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
mjw@1623 109
doogie@4109 110 rpm: build
mjw@1623 111 rm -rf staging
mjw@1623 112 mkdir staging
mjw@1623 113 mkdir staging/i386
mjw@1623 114 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
mjw@1623 115 --define "_rpmdir$$PWD/staging" -bb rpm.spec
mjw@1623 116 mv staging/i386/*.rpm .
mjw@1623 117 rm -rf staging
mjw@1623 118
cl349@6404 119 # libxenctrl
cl349@6404 120
cl349@6403 121 libxenctrl.a: $(LIB_OBJS)
iap10@3660 122 $(AR) rc $@ $^
iap10@3660 123
cl349@6403 124 libxenctrl.so: libxenctrl.so.$(MAJOR)
kaf24@3664 125 ln -sf $< $@
cl349@6403 126 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
iap10@3660 127 ln -sf $< $@
kaf24@3664 128
cl349@6403 129 libxenctrl.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
cl349@6404 130 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenctrl.so.$(MAJOR) -shared -o $@ $^
cl349@6404 131
cl349@6404 132 # libxenguest
cl349@6404 133
cl349@6404 134 libxenguest.a: $(LIB_BUILD_OBJS)
cl349@6404 135 $(AR) rc $@ $^
cl349@6404 136
cl349@6404 137 libxenguest.so: libxenguest.so.$(MAJOR)
cl349@6404 138 ln -sf $< $@
cl349@6404 139 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
cl349@6404 140 ln -sf $< $@
cl349@6404 141
cl349@6404 142 libxenguest.so.$(MAJOR).$(MINOR): $(PIC_BUILD_OBJS)
cl349@6404 143 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenguest.so.$(MAJOR) -shared -o $@ $^ -lz -lxenctrl
mjw@1623 144
mjw@1623 145 -include $(DEPS)