ia64/xen-unstable

view tools/libxc/Makefile @ 6141:7c2fdcb2c933

another merge
author kaf24@firebug.cl.cam.ac.uk
date Fri Aug 12 14:53:26 2005 +0000 (2005-08-12)
parents 38bee85ddeb8 46cf22571980
children 4995d5f167c9 f51fe43c5d1c 6783e59e1c45
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 SRCS += xc_sedf.c
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_load_bin.c
23 SRCS += xc_load_elf.c
24 SRCS += xc_linux_build.c
25 SRCS += xc_misc.c
26 SRCS += xc_physdev.c
27 SRCS += xc_private.c
28 ifeq ($(XEN_TARGET_ARCH),ia64)
29 SRCS += xc_ia64_stubs.c
30 else
31 SRCS += xc_load_aout9.c
32 SRCS += xc_linux_restore.c
33 SRCS += xc_linux_save.c
34 SRCS += xc_vmx_build.c
35 SRCS += xc_ptrace.c
36 SRCS += xc_ptrace_core.c
37 endif
39 CFLAGS += -Wall
40 CFLAGS += -Werror
41 CFLAGS += -O3
42 CFLAGS += -fno-strict-aliasing
43 CFLAGS += $(INCLUDES) -I.
44 # Get gcc to generate the dependencies for us.
45 CFLAGS += -Wp,-MD,.$(@F).d
46 DEPS = .*.d
48 LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
49 PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
51 LIB := libxc.a libxc-pic.a
52 LIB += libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
54 all: build
55 build: check-for-zlib mk-symlinks
56 $(MAKE) $(LIB)
58 check-for-zlib:
59 @if [ ! -e /usr/include/zlib.h ]; then \
60 echo "***********************************************************"; \
61 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
62 echo "***********************************************************"; \
63 false; \
64 fi
66 LINUX_ROOT := $(XEN_ROOT)/linux-2.6-xen-sparse
67 mk-symlinks:
68 [ -e xen/linux ] || mkdir -p xen/linux
69 [ -e xen/io ] || mkdir -p xen/io
70 ( cd xen >/dev/null ; \
71 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
72 ( cd xen/io >/dev/null ; \
73 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
74 ( cd xen/linux >/dev/null ; \
75 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
77 install: build
78 [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
79 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
80 $(INSTALL_PROG) libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
81 $(INSTALL_DATA) libxc.a $(DESTDIR)/usr/$(LIBDIR)
82 ln -sf libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxc.so.$(MAJOR)
83 ln -sf libxc.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxc.so
84 $(INSTALL_DATA) xc.h $(DESTDIR)/usr/include
86 .PHONY: TAGS clean rpm install all
88 TAGS:
89 etags -t $(SRCS) *.h
91 clean:
92 rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
94 rpm: build
95 rm -rf staging
96 mkdir staging
97 mkdir staging/i386
98 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
99 --define "_rpmdir$$PWD/staging" -bb rpm.spec
100 mv staging/i386/*.rpm .
101 rm -rf staging
103 libxc.a: $(LIB_OBJS)
104 $(AR) rc $@ $^
106 libxc-pic.a: $(PIC_OBJS)
107 $(AR) rc $@ $^
109 libxc.so: libxc.so.$(MAJOR)
110 ln -sf $< $@
111 libxc.so.$(MAJOR): libxc.so.$(MAJOR).$(MINOR)
112 ln -sf $< $@
114 libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
115 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -lz
117 -include $(DEPS)