ia64/xen-unstable

view tools/libxen/Makefile @ 12637:9493864f7a3c

Add libxen to overall xen build via a config option in Config.mk.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
author jfehlig@jfehlig2.provo.novell.com
date Wed Nov 22 14:25:07 2006 -0700 (2006-11-22)
parents 3d4a027bd04b
children d30be569532d
line source
1 #
2 # Copyright (c) 2006, 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 = 0.1
22 MINOR = 0
24 CFLAGS = -Iinclude \
25 $(shell xml2-config --cflags) \
26 $(shell curl-config --cflags) \
27 -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
29 LDFLAGS = $(shell xml2-config --libs) \
30 $(shell curl-config --libs)
32 LIBXENAPI_HDRS = $(wildcard include/*.h)
33 LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
36 .PHONY: all
37 all: libxenapi.so libxenapi.a
39 libxenapi.so: libxenapi.so.$(MAJOR)
40 ln -sf $< $@
42 libxenapi.so.$(MAJOR): libxenapi.so.$(MAJOR).$(MINOR)
43 ln -sf $< $@
45 libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS)
46 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
48 libxenapi.a: $(LIBXENAPI_OBJS)
49 $(AR) rcs libxenapi.a $^
52 .PHONY: install
53 install: all
54 $(INSTALL_DIR) -p $(DESTDIR)/usr/include/xen/api
55 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
56 $(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
57 ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so.$(MAJOR)
58 ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so
59 $(INSTALL_DATA) libxenapi.a $(DESTDIR)/usr/$(LIBDIR)
60 for i in $(LIBXENAPI_HDRS); do \
61 $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
62 done
64 .PHONY: clean
65 clean:
66 rm -f `find -name *.o`
67 rm -f libxenapi.so*
68 rm -f libxenapi.a
69 rm -f test/test_bindings