Add custom indentation config for vim.
[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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 include $(top_srcdir)/subdir-rules.mk
19
20 EXTRA_DIST = \
21         test-virt-cat.sh \
22         virt-cat.pod \
23         test-virt-filesystems.sh \
24         virt-filesystems.pod \
25         test-virt-ls.sh \
26         virt-ls.pod
27
28 CLEANFILES = stamp-virt-cat.pod stamp-virt-ls.pod stamp-virt-filesystems.pod
29
30 bin_PROGRAMS = virt-cat virt-filesystems virt-ls
31
32 SHARED_SOURCE_FILES = \
33         ../fish/config.c \
34         ../fish/inspect.c \
35         ../fish/keys.c \
36         ../fish/options.h \
37         ../fish/options.c \
38         ../fish/virt.c
39
40 virt_cat_SOURCES = \
41         $(SHARED_SOURCE_FILES) \
42         virt-cat.c
43
44 virt_cat_CFLAGS = \
45         -DGUESTFS_WARN_DEPRECATED=1 \
46         -I$(top_srcdir)/src -I$(top_builddir)/src \
47         -I$(top_srcdir)/fish \
48         -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
49         -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
50         $(WARN_CFLAGS) $(WERROR_CFLAGS) \
51         $(LIBCONFIG_CFLAGS)
52
53 virt_cat_LDADD = \
54         $(LIBCONFIG_LIBS) \
55         $(top_builddir)/src/libguestfs.la \
56         ../gnulib/lib/libgnu.la
57
58 virt_filesystems_SOURCES = \
59         $(SHARED_SOURCE_FILES) \
60         virt-filesystems.c
61
62 virt_filesystems_CFLAGS = \
63         -DGUESTFS_WARN_DEPRECATED=1 \
64         -I$(top_srcdir)/src -I$(top_builddir)/src \
65         -I$(top_srcdir)/fish \
66         -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
67         -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
68         $(WARN_CFLAGS) $(WERROR_CFLAGS) \
69         $(LIBCONFIG_CFLAGS)
70
71 virt_filesystems_LDADD = \
72         $(LIBCONFIG_LIBS) \
73         $(top_builddir)/src/libguestfs.la \
74         ../gnulib/lib/libgnu.la
75
76 virt_ls_SOURCES = \
77         $(SHARED_SOURCE_FILES) \
78         virt-ls.c
79
80 virt_ls_CFLAGS = \
81         -DGUESTFS_WARN_DEPRECATED=1 \
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_builddir)/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_builddir)/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_builddir)/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         TMPDIR=$(top_builddir)
138
139 TESTS = test-virt-cat.sh test-virt-filesystems.sh test-virt-ls.sh