ia64/xen-unstable

view tools/libxc/Makefile @ 6424:4abd299ef2f6

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