Add /etc/libguestfs-tools.conf configuration file.
[libguestfs.git] / cat / Makefile.am
1 # libguestfs virt-cat, virt-filesystems and virt-ls.
2 # Copyright (C) 2010-2011 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 include $(top_srcdir)/subdir-rules.mk
19
20 EXTRA_DIST = \
21         run-cat-locally \
22         test-virt-cat.sh \
23         virt-cat.pod \
24         run-filesystems-locally \
25         test-virt-filesystems.sh \
26         virt-filesystems.pod \
27         run-ls-locally \
28         test-virt-ls.sh \
29         virt-ls.pod
30
31 CLEANFILES = stamp-virt-cat.pod stamp-virt-ls.pod stamp-virt-filesystems.pod
32
33 bin_PROGRAMS = virt-cat virt-filesystems virt-ls
34
35 SHARED_SOURCE_FILES = \
36         ../fish/config.c \
37         ../fish/inspect.c \
38         ../fish/keys.c \
39         ../fish/options.h \
40         ../fish/options.c \
41         ../fish/virt.c
42
43 virt_cat_SOURCES = \
44         $(SHARED_SOURCE_FILES) \
45         virt-cat.c
46
47 virt_cat_CFLAGS = \
48         -I$(top_srcdir)/src -I$(top_builddir)/src \
49         -I$(top_srcdir)/fish \
50         -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
51         -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
52         $(WARN_CFLAGS) $(WERROR_CFLAGS) \
53         $(LIBCONFIG_CFLAGS)
54
55 virt_cat_LDADD = \
56         $(LIBCONFIG_LIBS) \
57         $(top_builddir)/src/libguestfs.la \
58         ../gnulib/lib/libgnu.la
59
60 virt_filesystems_SOURCES = \
61         $(SHARED_SOURCE_FILES) \
62         virt-filesystems.c
63
64 virt_filesystems_CFLAGS = \
65         -I$(top_srcdir)/src -I$(top_builddir)/src \
66         -I$(top_srcdir)/fish \
67         -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
68         -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
69         $(WARN_CFLAGS) $(WERROR_CFLAGS) \
70         $(LIBCONFIG_CFLAGS)
71
72 virt_filesystems_LDADD = \
73         $(LIBCONFIG_LIBS) \
74         $(top_builddir)/src/libguestfs.la \
75         ../gnulib/lib/libgnu.la
76
77 virt_ls_SOURCES = \
78         $(SHARED_SOURCE_FILES) \
79         virt-ls.c
80
81 virt_ls_CFLAGS = \
82         -I$(top_srcdir)/src -I$(top_builddir)/src \
83         -I$(top_srcdir)/fish \
84         -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
85         -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
86         $(WARN_CFLAGS) $(WERROR_CFLAGS) \
87         $(LIBCONFIG_CFLAGS)
88
89 virt_ls_LDADD = \
90         $(LIBCONFIG_LIBS) \
91         $(top_builddir)/src/libguestfs.la \
92         ../gnulib/lib/libgnu.la
93
94 # Manual pages and HTML files for the website.
95 man_MANS = virt-cat.1 virt-filesystems.1 virt-ls.1
96
97 noinst_DATA = \
98         $(top_builddir)/html/virt-cat.1.html \
99         $(top_builddir)/html/virt-filesystems.1.html \
100         $(top_builddir)/html/virt-ls.1.html
101
102 virt-cat.1 $(top_builddir)/html/virt-cat.1.html: stamp-virt-cat.pod
103
104 stamp-virt-cat.pod: virt-cat.pod
105         $(top_srcdir)/podwrapper.sh \
106           --man virt-cat.1 \
107           --html $(top_builddir)/html/virt-cat.1.html \
108           $<
109         touch $@
110
111 virt-ls.1 $(top_builddir)/html/virt-ls.1.html: stamp-virt-ls.pod
112
113 stamp-virt-ls.pod: virt-ls.pod
114         $(top_srcdir)/podwrapper.sh \
115           --man virt-ls.1 \
116           --html $(top_builddir)/html/virt-ls.1.html \
117           $<
118         touch $@
119
120 virt-filesystems.1 $(top_builddir)/html/virt-filesystems.1.html: stamp-virt-filesystems.pod
121
122 stamp-virt-filesystems.pod: virt-filesystems.pod
123         $(top_srcdir)/podwrapper.sh \
124           --man virt-filesystems.1 \
125           --html $(top_builddir)/html/virt-filesystems.1.html \
126           $<
127         touch $@
128
129 # Tests.
130
131 random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
132
133 TESTS_ENVIRONMENT = \
134         MALLOC_PERTURB_=$(random_val) \
135         LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
136         LIBGUESTFS_PATH=$(top_builddir)/appliance
137
138 TESTS = test-virt-cat.sh test-virt-filesystems.sh test-virt-ls.sh