inspect: Abstract the wrapper that sets up Augeas.
[libguestfs.git] / cat / Makefile.am
1 # libguestfs virt-cat.
2 # Copyright (C) 2010 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
25 bin_PROGRAMS = virt-cat
26
27 SHARED_SOURCE_FILES = \
28         ../fish/inspect.c \
29         ../fish/keys.c \
30         ../fish/options.h \
31         ../fish/options.c \
32         ../fish/virt.c
33
34 virt_cat_SOURCES = \
35         $(SHARED_SOURCE_FILES) \
36         virt-cat.c
37
38 virt_cat_CFLAGS = \
39         -I$(top_srcdir)/src -I$(top_builddir)/src \
40         -I$(top_srcdir)/fish \
41         -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
42         -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
43         $(WARN_CFLAGS) $(WERROR_CFLAGS)
44
45 virt_cat_LDADD = \
46         $(top_builddir)/src/libguestfs.la \
47         ../gnulib/lib/libgnu.la
48
49 # Manual pages and HTML files for the website.
50 man_MANS = virt-cat.1
51
52 noinst_DATA = $(top_builddir)/html/virt-cat.1.html
53
54 virt-cat.1: virt-cat.pod
55         $(POD2MAN) \
56           --section 1 \
57           -c "Virtualization Support" \
58           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
59           $< > $@-t && mv $@-t $@
60
61 $(top_builddir)/html/virt-cat.1.html: virt-cat.pod
62         mkdir -p $(top_builddir)/html
63         cd $(top_builddir) && pod2html \
64           --css 'pod.css' \
65           --htmldir html \
66           --outfile html/$@ \
67           $(abs_srcdir)/$<
68
69 # Tests.
70
71 random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
72
73 TESTS_ENVIRONMENT = \
74         MALLOC_PERTURB_=$(random_val) \
75         LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
76         LIBGUESTFS_PATH=$(top_builddir)/appliance
77
78 TESTS = test-virt-cat.sh
79
80 # Build a partly-static library (for the binary distribution).
81
82 virt-cat.static$(EXEEXT): $(virt_cat_OBJECTS) $(virt_cat_DEPENDENCIES)
83         $(top_srcdir)/relink-static.sh \
84         $(virt_cat_LINK) $(virt_cat_OBJECTS) -static $(virt_cat_LDADD) $(virt_cat_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -lpcre -lhivex -lmagic -lz -lm