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