Add a debug message to the library cancellation path.
[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 = \
19         guestfs_protocol.x \
20         guestfs_protocol.c \
21         guestfs_protocol.h \
22         MAX_PROC_NR \
23         stamp-generator \
24         generator.ml
25
26 # Rerun the generator if it has changed.
27 # Git removes empty directories, so in cases where the
28 # generator is creating the sole file in a directory, we
29 # have to create the directory first.
30 noinst_DATA = stamp-generator
31
32 stamp-generator: generator.ml
33         mkdir -p $(top_builddir)/perl/lib/Sys
34         mkdir -p $(top_builddir)/ruby/ext/guestfs
35         mkdir -p $(top_builddir)/java/com/redhat/et/libguestfs
36         cd $(top_builddir) && ocaml -warn-error A ./src/$<
37
38 guestfs_protocol.x: stamp-generator
39
40 include_HEADERS = guestfs.h guestfs-actions.h guestfs-structs.h
41
42 lib_LTLIBRARIES = libguestfs.la
43
44 # From the libtool info file, with comments:
45 #
46 # |  1. Start with version information of `0:0:0' for each libtool library.
47 # |
48 # |  2. Update the version information only immediately before a public
49 # |     release of your software.  More frequent updates are unnecessary,
50 # |     and only guarantee that the current interface number gets larger
51 # |     faster.
52 # |
53 # |  3. If the library source code has changed at all since the last
54 # |     update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
55 #
56 # [So it seems like we should always update the middle 'R' field
57 # for any release.]
58 #
59 # |  4. If any interfaces have been added, removed, or changed since the
60 # |     last update, increment CURRENT, and set REVISION to 0.
61 # |
62 # |  5. If any interfaces have been added since the last public release,
63 # |     then increment AGE.
64 #
65 # [These two rules seem to mean that if any change is made to the
66 # generator, we should increment C and A, and set R to 0, so:
67 # C+1:0:A+1.]
68 #
69 # |  6. If any interfaces have been removed since the last public release,
70 # |     then set AGE to 0.
71 #
72 # [Our ABI guarantee means we won't remove interfaces except in
73 # very exceptional circumstances.]
74 #
75 # The maximum proc number (see guestfs_protocol.x:guestfs_procedure) is
76 # a mostly accurate stand-in for C & A in rules 5 & 6, so we use that.  It
77 # is always incremented when we add a new appliance interface, and easy to
78 # calculate.
79 #
80 # The middle number is hard to increment-and-reset as described in rules
81 # 4 & 5, so for the moment it is always set to 0.
82 #
83 # Note that this scheme means the real library version will always be
84 # 'libguestfs.so.0.$(MAX_PROC_NR).0'.
85
86 BUILT_SOURCES = \
87   guestfs_protocol.x \
88   guestfs_protocol.c \
89   guestfs_protocol.h \
90   guestfs-structs.h \
91   guestfs-actions.h \
92   guestfs-actions.c \
93   guestfs-bindtests.c
94
95 $(BUILT_SOURCES): stamp-generator
96
97 libguestfs_la_LDFLAGS = -version-info $(MAX_PROC_NR):0:$(MAX_PROC_NR)
98 libguestfs_la_SOURCES = \
99         guestfs.c \
100         guestfs.h \
101         guestfs_protocol.c \
102         guestfs_protocol.h \
103         guestfs-actions.h \
104         guestfs-actions.c \
105         guestfs-bindtests.c \
106         gettext.h
107
108 libguestfs_la_CFLAGS = -Wall -DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"'
109
110 if HAVE_RPCGEN
111 guestfs_protocol.c: guestfs_protocol.x
112         rm -f $@-t
113         $(RPCGEN) -c -o $@-t $<
114         mv $@-t $@
115
116 guestfs_protocol.h: guestfs_protocol.x
117         rm -f $@-t
118         $(RPCGEN) -h -o $@-t $<
119         mv $@-t $@
120 endif