Version 1.0.52.
[libguestfs.git] / src / Makefile.am
1 # libguestfs
2 # Copyright (C) 2009 Red Hat Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program 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
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 EXTRA_DIST = guestfs_protocol.x \
19         guestfs_protocol.c \
20         guestfs_protocol.h \
21         MAX_PROC_NR
22
23 EXTRA_DIST += generator.ml
24
25 include_HEADERS = guestfs.h guestfs-actions.h guestfs-structs.h
26
27 lib_LTLIBRARIES = libguestfs.la
28
29 # From the libtool info file, with comments:
30 #
31 # |  1. Start with version information of `0:0:0' for each libtool library.
32 # |
33 # |  2. Update the version information only immediately before a public
34 # |     release of your software.  More frequent updates are unnecessary,
35 # |     and only guarantee that the current interface number gets larger
36 # |     faster.
37 # |
38 # |  3. If the library source code has changed at all since the last
39 # |     update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
40 #
41 # [So it seems like we should always update the middle 'R' field
42 # for any release.]
43 #
44 # |  4. If any interfaces have been added, removed, or changed since the
45 # |     last update, increment CURRENT, and set REVISION to 0.
46 # |
47 # |  5. If any interfaces have been added since the last public release,
48 # |     then increment AGE.
49 #
50 # [These two rules seem to mean that if any change is made to the
51 # generator, we should increment C and A, and set R to 0, so:
52 # C+1:0:A+1.]
53 #
54 # |  6. If any interfaces have been removed since the last public release,
55 # |     then set AGE to 0.
56 #
57 # [Our ABI guarantee means we won't remove interfaces except in
58 # very exceptional circumstances.]
59 #
60 # The maximum proc number (see guestfs_protocol.x:guestfs_procedure) is
61 # a mostly accurate stand-in for C & A in rules 5 & 6, so we use that.  It
62 # is always incremented when we add a new appliance interface, and easy to
63 # calculate.
64 #
65 # The middle number is hard to increment-and-reset as described in rules
66 # 4 & 5, so for the moment it is always set to 0.
67 #
68 # Note that this scheme means the real library version will always be
69 # 'libguestfs.so.0.$(MAX_PROC_NR).0'.
70
71 libguestfs_la_LDFLAGS = -version-info $(MAX_PROC_NR):0:$(MAX_PROC_NR)
72 libguestfs_la_SOURCES = \
73         guestfs.c \
74         guestfs.h \
75         guestfs_protocol.c \
76         guestfs_protocol.h \
77         guestfs-actions.h \
78         guestfs-actions.c \
79         guestfs-bindtests.c \
80         gettext.h
81
82 libguestfs_la_CFLAGS = -Wall -DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"'
83
84 if HAVE_RPCGEN
85 guestfs_protocol.c: guestfs_protocol.x
86         rm -f $@-t
87         $(RPCGEN) -c -o $@-t $<
88         mv $@-t $@
89
90 guestfs_protocol.h: guestfs_protocol.x
91         rm -f $@-t
92         $(RPCGEN) -h -o $@-t $<
93         mv $@-t $@
94 endif