build: Remove *~ files when cleaning.
[qemu-sanity-check.git] / Makefile.am
1 # Makefile for qemu-sanity-check
2 # Copyright (C) 2013 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 along
15 # with this program; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 EXTRA_DIST = \
19         .gitignore \
20         qemu-sanity-check.1 \
21         qemu-sanity-check.in \
22         qemu-sanity-check.pod \
23         qemu-sanity-check.pod.in \
24         qemu-sanity-check.spec \
25         sleeper \
26         $(TESTS)
27
28 CLEANFILES = \
29         *~ \
30         qemu-sanity-check
31
32 bin_SCRIPTS = qemu-sanity-check
33 initrddir = $(libdir)/qemu-sanity-check
34 initrd_DATA = initrd
35
36 # Build the initramfs.
37 initrd: init
38         echo $< | cpio --quiet -o -H newc > $@-t
39         mv $@-t $@
40
41 noinst_PROGRAMS = init
42 init_SOURCES = init.c
43 init_CFLAGS = -static
44 init_LDFLAGS = -static
45
46 # Build the man pages.
47 qemu-sanity-check.pod: qemu-sanity-check.pod.in Makefile
48         rm -f $@ $@-t
49         $(SED) -e 's,@libdir\@,$(libdir),g' < $< > $@-t
50         mv $@-t $@
51         chmod 0555 $@
52
53 if HAVE_POD2MAN
54
55 CLEANFILES += qemu-sanity-check.1
56 man_MANS = qemu-sanity-check.1
57
58 qemu-sanity-check.1: qemu-sanity-check.pod
59         $(POD2MAN) -c "Virtualization Support" \
60           --release "$(PACKAGE)-$(VERSION)" \
61           $< > $@
62
63 endif
64
65 # Tests.
66 TESTS = \
67         run-qemu-sanity-check \
68         test-timeout \
69         test-bad-options \
70         test-bad-kernel \
71         test-bad-qemu \
72         test-bad-userspace
73
74 # Tag HEAD with current version (maintainer only).
75
76 maintainer-tag:
77         git tag -a v$(VERSION) -m "Version $(VERSION)" -f