ia64/xen-unstable

changeset 14892:8b0e9cb6b49b

Added Makefile.dist, which can make standalone tarballs.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author ewan@localhost.localdomain
date Sat Apr 21 12:42:58 2007 -0700 (2007-04-21)
parents 295858ddac87
children 4a792f891277
files tools/libxen/Makefile tools/libxen/Makefile.dist
line diff
     1.1 --- a/tools/libxen/Makefile	Sat Apr 21 12:21:06 2007 -0700
     1.2 +++ b/tools/libxen/Makefile	Sat Apr 21 12:42:58 2007 -0700
     1.3 @@ -72,14 +72,3 @@ clean:
     1.4  	rm -f libxenapi.so*
     1.5  	rm -f libxenapi.a
     1.6  	rm -f $(TEST_PROGRAMS)
     1.7 -
     1.8 -
     1.9 -.PHONY: uberheader
    1.10 -uberheader: include/xen/api/xen_all.h
    1.11 -include/xen/api/xen_all.h::
    1.12 -	echo "/* This file is autogenerated */" >$@
    1.13 -	echo "#ifndef XEN_API_XEN_ALL_H" >>$@
    1.14 -	echo "#define XEN_API_XEN_ALL_H" >>$@
    1.15 -	ls include/xen/api/*.h | grep -v xen_all.h | grep -v _decl.h | \
    1.16 -          sed 's,^include/\(.*\)$$,#include <\1>,g' >>$@
    1.17 -	echo "#endif" >>$@
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/libxen/Makefile.dist	Sat Apr 21 12:42:58 2007 -0700
     2.3 @@ -0,0 +1,115 @@
     2.4 +#
     2.5 +# Copyright (c) 2006-2007, XenSource Inc.
     2.6 +#
     2.7 +# This library is free software; you can redistribute it and/or
     2.8 +# modify it under the terms of the GNU Lesser General Public
     2.9 +# License as published by the Free Software Foundation; either
    2.10 +# version 2.1 of the License, or (at your option) any later version.
    2.11 +#
    2.12 +# This library is distributed in the hope that it will be useful,
    2.13 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.14 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.15 +# Lesser General Public License for more details.
    2.16 +#
    2.17 +# You should have received a copy of the GNU Lesser General Public
    2.18 +# License along with this library; if not, write to the Free Software
    2.19 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    2.20 +#
    2.21 +
    2.22 +MAJOR = 0.9
    2.23 +MINOR = 1
    2.24 +
    2.25 +CFLAGS = -Iinclude                     \
    2.26 +         $(shell xml2-config --cflags) \
    2.27 +         $(shell curl-config --cflags) \
    2.28 +         -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
    2.29 +
    2.30 +LDFLAGS = $(shell xml2-config --libs) \
    2.31 +          $(shell curl-config --libs)
    2.32 +
    2.33 +# -h for Solaris
    2.34 +SONAME_LDFLAG ?= -soname
    2.35 +# -R /usr/sfw/$(LIBDIR) -shared for Solaris
    2.36 +SHLIB_CFLAGS ?= -shared
    2.37 +
    2.38 +# ginstall for Solaris
    2.39 +INSTALL      = install
    2.40 +INSTALL_DIR  = $(INSTALL) -d -m0755 -p
    2.41 +INSTALL_DATA = $(INSTALL) -m0644 -p
    2.42 +
    2.43 +LIBXENAPI_HDRS = $(wildcard include/*.h)
    2.44 +LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
    2.45 +
    2.46 +TEST_PROGRAMS = test/test_bindings test/test_event_handling
    2.47 +
    2.48 +TARBALL_DEST = libxenapi-$(MAJOR).$(MINOR)
    2.49 +
    2.50 +.PHONY: all
    2.51 +all: $(TEST_PROGRAMS)
    2.52 +
    2.53 +libxenapi.so: libxenapi.so.$(MAJOR)
    2.54 +	ln -sf $< $@
    2.55 +
    2.56 +libxenapi.so.$(MAJOR): libxenapi.so.$(MAJOR).$(MINOR)
    2.57 +	ln -sf $< $@
    2.58 +
    2.59 +libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS)
    2.60 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
    2.61 +
    2.62 +libxenapi.a: $(LIBXENAPI_OBJS)
    2.63 +	$(AR) rcs libxenapi.a $^
    2.64 +
    2.65 +$(TEST_PROGRAMS): test/%: test/%.o libxenapi.so
    2.66 +	$(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
    2.67 +
    2.68 +
    2.69 +.PHONY: install
    2.70 +install: all
    2.71 +	$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/api
    2.72 +	$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
    2.73 +	$(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
    2.74 +	ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so.$(MAJOR)
    2.75 +	ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so
    2.76 +	$(INSTALL_DATA) libxenapi.a $(DESTDIR)/usr/$(LIBDIR)
    2.77 +	for i in $(LIBXENAPI_HDRS); do \
    2.78 +	    $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
    2.79 +	done
    2.80 +
    2.81 +
    2.82 +.PHONY: tarball
    2.83 +tarball: $(TARBALL_DEST).tar.bz2
    2.84 +
    2.85 +$(TARBALL_DEST).tar.bz2: all
    2.86 +	rm -Rf $(TARBALL_DEST)
    2.87 +	mkdir -p $(TARBALL_DEST)/include/xen/api
    2.88 +	mkdir -p $(TARBALL_DEST)/src
    2.89 +	mkdir -p $(TARBALL_DEST)/test
    2.90 +	cp COPYING $(TARBALL_DEST)
    2.91 +	cp Makefile.dist $(TARBALL_DEST)/Makefile
    2.92 +	cp Makefile.dist $(TARBALL_DEST)/Makefile.dist
    2.93 +	cp README $(TARBALL_DEST)
    2.94 +	cp include/*.h $(TARBALL_DEST)/include
    2.95 +	cp include/xen/api/*.h $(TARBALL_DEST)/include/xen/api
    2.96 +	cp src/*.c $(TARBALL_DEST)/src
    2.97 +	cp test/*.c $(TARBALL_DEST)/test
    2.98 +	fakeroot chown root:root -R $(TARBALL_DEST)
    2.99 +	fakeroot tar cjf $(TARBALL_DEST).tar.bz2 $(TARBALL_DEST)
   2.100 +
   2.101 +
   2.102 +.PHONY: clean
   2.103 +clean:
   2.104 +	rm -f `find -name *.o`
   2.105 +	rm -f libxenapi.so*
   2.106 +	rm -f libxenapi.a
   2.107 +	rm -f $(TEST_PROGRAMS)
   2.108 +
   2.109 +
   2.110 +.PHONY: uberheader
   2.111 +uberheader: include/xen/api/xen_all.h
   2.112 +include/xen/api/xen_all.h::
   2.113 +	echo "/* This file is autogenerated */" >$@
   2.114 +	echo "#ifndef XEN_API_XEN_ALL_H" >>$@
   2.115 +	echo "#define XEN_API_XEN_ALL_H" >>$@
   2.116 +	ls include/xen/api/*.h | grep -v xen_all.h | grep -v _decl.h | \
   2.117 +          sed 's,^include/\(.*\)$$,#include <\1>,g' >>$@
   2.118 +	echo "#endif" >>$@