ia64/xen-unstable

view tools/libxen/Makefile.dist @ 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 #
19 MAJOR = 1.0
20 MINOR = 0
22 CFLAGS = -Iinclude \
23 $(shell xml2-config --cflags) \
24 $(shell curl-config --cflags) \
25 -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
27 LDFLAGS = $(shell xml2-config --libs) \
28 $(shell curl-config --libs)
30 # -h for Solaris
31 SONAME_LDFLAG ?= -soname
32 # -R /usr/sfw/$(LIBDIR) -shared for Solaris
33 SHLIB_CFLAGS ?= -shared
35 # ginstall for Solaris
36 INSTALL = install
37 INSTALL_DIR = $(INSTALL) -d -m0755 -p
38 INSTALL_DATA = $(INSTALL) -m0644 -p
40 LIBXENAPI_HDRS = $(wildcard include/*.h)
41 LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
43 TEST_PROGRAMS = test/test_bindings test/test_event_handling
45 TARBALL_DEST = libxenapi-$(MAJOR).$(MINOR)
47 .PHONY: all
48 all: $(TEST_PROGRAMS)
50 libxenapi.so: libxenapi.so.$(MAJOR)
51 ln -sf $< $@
53 libxenapi.so.$(MAJOR): libxenapi.so.$(MAJOR).$(MINOR)
54 ln -sf $< $@
56 libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS)
57 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
59 libxenapi.a: $(LIBXENAPI_OBJS)
60 $(AR) rcs libxenapi.a $^
62 $(TEST_PROGRAMS): test/%: test/%.o libxenapi.so
63 $(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
66 .PHONY: install
67 install: all
68 $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/api
69 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
70 $(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
71 ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenapi.so.$(MAJOR)
72 ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenapi.so
73 $(INSTALL_DATA) libxenapi.a $(DESTDIR)$(LIBDIR)
74 set -e; for i in $(LIBXENAPI_HDRS); do \
75 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEDIR)/xen/api; \
76 done
79 .PHONY: tarball
80 tarball: $(TARBALL_DEST).tar.bz2
82 $(TARBALL_DEST).tar.bz2: all
83 rm -Rf $(TARBALL_DEST)
84 mkdir -p $(TARBALL_DEST)/include/xen/api
85 mkdir -p $(TARBALL_DEST)/src
86 mkdir -p $(TARBALL_DEST)/test
87 cp COPYING $(TARBALL_DEST)
88 cp Makefile.dist $(TARBALL_DEST)/Makefile
89 cp Makefile.dist $(TARBALL_DEST)/Makefile.dist
90 cp README $(TARBALL_DEST)
91 cp include/*.h $(TARBALL_DEST)/include
92 cp include/xen/api/*.h $(TARBALL_DEST)/include/xen/api
93 cp src/*.c $(TARBALL_DEST)/src
94 cp test/*.c $(TARBALL_DEST)/test
95 fakeroot chown root:root -R $(TARBALL_DEST)
96 fakeroot tar cjf $(TARBALL_DEST).tar.bz2 $(TARBALL_DEST)
99 .PHONY: clean
100 clean:
101 rm -f `find -name *.o`
102 rm -f libxenapi.so*
103 rm -f libxenapi.a
104 rm -f $(TEST_PROGRAMS)
107 .PHONY: uberheader
108 uberheader: include/xen/api/xen_all.h
109 include/xen/api/xen_all.h::
110 echo "/* This file is autogenerated */" >$@
111 echo "#ifndef XEN_API_XEN_ALL_H" >>$@
112 echo "#define XEN_API_XEN_ALL_H" >>$@
113 ls include/xen/api/*.h | grep -v xen_all.h | grep -v _decl.h | \
114 sed 's,^include/\(.*\)$$,#include <\1>,g' >>$@
115 echo "#endif" >>$@