Whitespace: indent some names in images/Makefile.am correctly.
[libguestfs.git] / images / Makefile.am
1 # libguestfs test images
2 # Copyright (C) 2009 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 # Old RHEL 5 autoconf doesn't have builddir.
19 builddir ?= $(top_builddir)/images
20
21 EXTRA_DIST = \
22         helloworld.tar \
23         helloworld.tar.gz \
24         mbr-ext2-empty.img.gz \
25         empty known-1 known-2 known-3
26
27 noinst_DATA = test.sqsh
28
29 CLEANFILES = \
30         test.sqsh \
31         100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \
32         initrd
33
34 squash_files_src = \
35         $(srcdir)/helloworld.tar \
36         $(srcdir)/helloworld.tar.gz \
37         $(srcdir)/empty \
38         $(srcdir)/known-1 \
39         $(srcdir)/known-2 \
40         $(srcdir)/known-3
41
42 squash_files_build = \
43         $(builddir)/100kallzeroes \
44         $(builddir)/100kallnewlines \
45         $(builddir)/100kallspaces \
46         $(builddir)/100krandom \
47         $(builddir)/10klines \
48         $(builddir)/initrd
49
50 squash_files = $(squash_files_src) $(squash_files_build)
51
52 test.sqsh: $(squash_files)
53         rm -f $@
54         $(MKSQUASHFS) $(squash_files) $@
55
56 $(builddir)/100kallzeroes:
57         rm -f $@ $@-t
58         dd if=/dev/zero of=$@-t bs=1024 count=100
59         mv $@-t $@
60
61 $(builddir)/100kallnewlines: $(builddir)/100kallzeroes
62         rm -f $@ $@-t
63         tr '\0' '\n' < $< > $@-t
64         mv $@-t $@
65
66 $(builddir)/100kallspaces: $(builddir)/100kallzeroes
67         rm -f $@ $@-t
68         tr '\0' ' ' < $< > $@-t
69         mv $@-t $@
70
71 $(builddir)/100krandom:
72         rm -f $@ $@-t
73         dd if=/dev/urandom of=$@-t bs=1024 count=100
74         mv $@-t $@
75
76 $(builddir)/10klines:
77         rm -f $@ $@-t
78         i=0; \
79         while [ $$i -lt 10000 ]; do \
80           echo "$${i}abcdefghijklmnopqrstuvwxyz"; \
81           i=$$(($$i+1)); \
82         done > $@-t
83         mv $@-t $@
84
85 $(builddir)/initrd: empty known-1 known-2 known-3
86         rm -f $@ $@-t
87         for f in $^; do echo $$f; done | cpio -o -H newc | gzip --best > $@-t
88         mv $@-t $@