2 # Copyright (C) 2010 Red Hat Inc.
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.
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.
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.
18 include $(top_srcdir)/subdir-rules.mk
25 bin_PROGRAMS = virt-cat
27 SHARED_SOURCE_FILES = \
35 $(SHARED_SOURCE_FILES) \
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)
46 $(top_builddir)/src/libguestfs.la \
47 ../gnulib/lib/libgnu.la
49 # Manual pages and HTML files for the website.
52 noinst_DATA = $(top_builddir)/html/virt-cat.1.html
54 virt-cat.1: virt-cat.pod
57 -c "Virtualization Support" \
58 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
59 $< > $@-t && mv $@-t $@
61 $(top_builddir)/html/virt-cat.1.html: virt-cat.pod
62 mkdir -p $(top_builddir)/html
63 cd $(top_builddir) && pod2html \
71 random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
74 MALLOC_PERTURB_=$(random_val) \
75 LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
76 LIBGUESTFS_PATH=$(top_builddir)/appliance
78 TESTS = test-virt-cat.sh
80 # Build a partly-static library (for the binary distribution).
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