daemon: debug segv correct use of dereferencing NULL.
[libguestfs.git] / tests / guests / Makefile.am
1 # libguestfs test images
2 # Copyright (C) 2009-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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 include $(top_srcdir)/subdir-rules.mk
19
20 # Old RHEL 5 autoconf doesn't have builddir.
21 builddir ?= $(top_builddir)/tests/guests
22
23 EXTRA_DIST = \
24         guest-aux/make-debian-img.sh \
25         guest-aux/debian-packages \
26         guest-aux/make-fedora-img.pl \
27         guest-aux/fedora-name.db.txt \
28         guest-aux/fedora-name.db \
29         guest-aux/fedora-packages.db.txt \
30         guest-aux/fedora-packages.db \
31         guest-aux/make-ubuntu-img.sh \
32         guest-aux/make-windows-img.sh \
33         guest-aux/windows-software \
34         guest-aux/windows-software.reg \
35         guest-aux/windows-system \
36         guest-aux/windows-system.reg \
37         guest-aux/minimal-hive
38
39 # This is 'check_DATA' because we don't need it until 'make check'
40 # time and we need the tools we have built in order to make it.
41 check_DATA = debian.img fedora.img fedora-md1.img fedora-md2.img ubuntu.img windows.img
42
43 CLEANFILES = $(check_DATA)
44
45 # Make a (dummy) Fedora image.
46 fedora.img: guest-aux/make-fedora-img.pl \
47                 guest-aux/fedora-name.db \
48                 guest-aux/fedora-packages.db
49         TMPDIR=$(top_builddir) \
50         SRCDIR=$(srcdir) \
51         LAYOUT=partitions \
52         ../../run $<
53
54 # Make a (dummy) Fedora image using md devices
55 fedora-md1.img fedora-md2.img: guest-aux/make-fedora-img.pl \
56                 guest-aux/fedora-name.db \
57                 guest-aux/fedora-packages.db
58         TMPDIR=$(top_builddir) \
59         SRCDIR=$(srcdir) \
60         LAYOUT=partitions-md \
61         ../../run $<
62
63 guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt
64         rm -f $@ $@-t
65         mkdir -p guest-aux
66         $(DB_LOAD) $@-t < $<
67         mv $@-t $@
68
69 guest-aux/fedora-packages.db: guest-aux/fedora-packages.db.txt
70         rm -f $@ $@-t
71         mkdir -p guest-aux
72         $(DB_LOAD) $@-t < $<
73         mv $@-t $@
74
75 # Make a (dummy) Debian image.
76 debian.img: guest-aux/make-debian-img.sh
77         TMPDIR=$(top_builddir) \
78         SRCDIR=$(srcdir) \
79         bash $<
80
81 # Make a (dummy) Ubuntu image.
82 ubuntu.img: guest-aux/make-ubuntu-img.sh
83         TMPDIR=$(top_builddir) \
84         SRCDIR=$(srcdir) \
85         bash $<
86
87 # Make a (dummy) Windows image.
88 windows.img: guest-aux/make-windows-img.sh \
89              guest-aux/windows-software guest-aux/windows-system
90         TMPDIR=$(top_builddir) \
91         SRCDIR=$(srcdir) \
92         bash $<
93
94 # Since users might not have the tools needed to create this, we
95 # also distribute these files.
96 guest-aux/windows-software: guest-aux/windows-software.reg
97         rm -f $@ $@-t
98         cp guest-aux/minimal-hive $@-t
99         hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SOFTWARE' $<
100         mv $@-t $@
101
102 guest-aux/windows-system: guest-aux/windows-system.reg
103         rm -f $@ $@-t
104         cp guest-aux/minimal-hive $@-t
105         hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SYSTEM' $<
106         mv $@-t $@