ia64/xen-unstable

view tools/libxen/Makefile @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 89995ccec15a
children
line source
1 #
2 # Copyright (c) 2006-2007, XenSource Inc.
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #
18 XEN_ROOT=../..
19 include $(XEN_ROOT)/tools/Rules.mk
21 MAJOR = 1.0
22 MINOR = 0
24 CFLAGS += -Iinclude \
25 $(shell xml2-config --cflags) \
26 $(shell curl-config --cflags) \
27 -fPIC
29 LDFLAGS += $(shell xml2-config --libs) \
30 $(shell curl-config --libs)
32 LIBXENAPI_HDRS = $(wildcard include/xen/api/*.h) include/xen/api/xen_all.h
33 LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
35 TEST_PROGRAMS = test/test_bindings test/test_event_handling
37 .PHONY: all
38 all: libxenapi.so libxenapi.a
40 libxenapi.so: libxenapi.so.$(MAJOR)
41 ln -sf $< $@
43 libxenapi.so.$(MAJOR): libxenapi.so.$(MAJOR).$(MINOR)
44 ln -sf $< $@
46 libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS)
47 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
49 libxenapi.a: $(LIBXENAPI_OBJS)
50 $(AR) rcs libxenapi.a $^
52 $(TEST_PROGRAMS): test/%: test/%.o libxenapi.so
53 $(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
56 .PHONY: install
57 install: all
58 $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/api
59 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
60 $(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
61 ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenapi.so.$(MAJOR)
62 ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenapi.so
63 $(INSTALL_DATA) libxenapi.a $(DESTDIR)$(LIBDIR)
64 set -e; for i in $(LIBXENAPI_HDRS); do \
65 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEDIR)/xen/api; \
66 done
69 .PHONY: clean
70 clean:
71 rm -f `find -name *.o`
72 rm -f libxenapi.so*
73 rm -f libxenapi.a
74 rm -f $(TEST_PROGRAMS)