direct-io.hg

view tools/libaio/src/Makefile @ 11136:7ed73735fd30

This is a small patch that makes a cross compiler successfully compile
the sources under the tools directory. This patch became necessary
after qemu-dm is updated to a newer version.

Signed-off-by: Hiroya INAKOSHI <inakoshi.hiroya@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Wed Aug 16 11:53:37 2006 +0100 (2006-08-16)
parents 2937703f0ed0
children
line source
1 XEN_ROOT = ../../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 prefix=/usr
5 includedir=$(prefix)/include
6 libdir=$(prefix)/lib
8 ARCH := $(shell uname -m | sed -e s/i.86/i386/)
9 CFLAGS := -nostdlib -nostartfiles -Wall -I. -g -fomit-frame-pointer -O2 -fPIC
10 SO_CFLAGS=-shared $(CFLAGS)
11 L_CFLAGS=$(CFLAGS)
12 LINK_FLAGS=
14 soname=libaio.so.1
15 minor=0
16 micro=1
17 libname=$(soname).$(minor).$(micro)
18 all_targets += libaio.a $(libname)
20 all: $(all_targets)
22 # libaio provided functions
23 libaio_srcs := io_queue_init.c io_queue_release.c
24 libaio_srcs += io_queue_wait.c io_queue_run.c
26 # real syscalls
27 libaio_srcs += io_getevents.c io_submit.c io_cancel.c
28 libaio_srcs += io_setup.c io_destroy.c
30 # internal functions
31 libaio_srcs += raw_syscall.c
33 # old symbols
34 libaio_srcs += compat-0_1.c
36 libaio_objs := $(patsubst %.c,%.ol,$(libaio_srcs))
37 libaio_sobjs := $(patsubst %.c,%.os,$(libaio_srcs))
39 $(libaio_objs) $(libaio_sobjs): libaio.h vsys_def.h
41 %.os: %.c
42 $(CC) $(SO_CFLAGS) -c -o $@ $<
44 %.ol: %.c
45 $(CC) $(L_CFLAGS) -c -o $@ $<
48 libaio.a: $(libaio_objs)
49 rm -f libaio.a
50 $(AR) r libaio.a $^
51 $(RANLIB) libaio.a
53 $(libname): $(libaio_sobjs) libaio.map
54 $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
56 install: $(all_targets)
57 install -D -m 644 libaio.h $(includedir)/libaio.h
58 install -D -m 644 libaio.a $(libdir)/libaio.a
59 install -D -m 755 $(libname) $(libdir)/$(libname)
60 ln -sf $(libname) $(libdir)/$(soname)
61 ln -sf $(libname) $(libdir)/libaio.so
63 $(libaio_objs): libaio.h
65 clean:
66 rm -f $(all_targets) $(libaio_objs) $(libaio_sobjs) $(soname).new
67 rm -f *.so* *.a *.o