Makefile 2.56 KB
Newer Older
1 2
# This file is part of autopkgtest
# autopkgtest is a tool for testing Debian binary packages
3
#
4
# autopkgtest is Copyright (C) 2006 Canonical Ltd.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# See the file CREDITS for a full list of credits information (often
21
# installed as /usr/share/doc/autopkgtest/CREDITS).
22

Martin Pitt's avatar
Martin Pitt committed
23 24 25 26 27 28
prefix =	/usr
share =		$(DESTDIR)$(prefix)/share
bindir =	$(DESTDIR)$(prefix)/bin
man1dir =	$(share)/man/man1
pkgname =	autopkgtest
docdir =	$(share)/doc/$(pkgname)
29
datadir =	$(share)/$(pkgname)
30
pythondir = 	$(datadir)/lib
Martin Pitt's avatar
Martin Pitt committed
31 32 33 34 35

INSTALL =	install
INSTALL_DIRS =	$(INSTALL) -d
INSTALL_PROG =	$(INSTALL) -m 0755
INSTALL_DATA =	$(INSTALL) -m 0644
36

37 38 39 40 41 42 43
virts =		chroot \
		lxc \
		lxd \
		null \
		qemu \
		schroot \
		ssh \
44 45
		$(NULL)

46
programs =	tools/autopkgtest-buildvm-ubuntu-cloud \
47
		tools/autopkgtest-build-lxc \
48
		tools/autopkgtest-build-lxd \
49
		tools/autopkgtest-build-qemu \
50 51
		runner/autopkgtest \
		$(NULL)
52

Martin Pitt's avatar
Martin Pitt committed
53
pythonfiles =	lib/VirtSubproc.py \
54
		lib/adtlog.py \
Martin Pitt's avatar
Martin Pitt committed
55
		lib/autopkgtest_args.py \
56 57
		lib/adt_testbed.py \
		lib/adt_binaries.py \
58 59
		lib/testdesc.py \
		$(NULL)
60

61 62 63 64 65 66 67
rstfiles =	$(wildcard doc/*.rst)
htmlfiles =	$(patsubst %.rst,%.html,$(rstfiles))

%.html: %.rst
	rst2html -v $< > $@

all: $(htmlfiles)
68

Martin Pitt's avatar
Martin Pitt committed
69
install:
70
	$(INSTALL_DIRS) $(bindir) $(docdir) $(man1dir) $(pythondir) $(datadir)/setup-commands $(datadir)/ssh-setup
71
	set -e; for f in $(programs); do \
Martin Pitt's avatar
Martin Pitt committed
72 73
		$(INSTALL_PROG) $$f $(bindir); \
		test ! -f $$f.1 || $(INSTALL_DATA) $$f.1 $(man1dir); \
74
		done
75
	set -e; for f in $(virts); do \
76 77
		$(INSTALL_PROG) virt/autopkgtest-virt-$$f $(bindir); \
		$(INSTALL_DATA) virt/autopkgtest-virt-$${f}.1 $(man1dir); \
78
		done
79
	$(INSTALL_DATA) $(pythonfiles) $(pythondir)
Martin Pitt's avatar
Martin Pitt committed
80
	$(INSTALL_DATA) CREDITS $(docdir)
81
	$(INSTALL_DATA) $(rstfiles) $(htmlfiles) $(docdir)
82
	$(INSTALL_PROG) setup-commands/*[!~] $(datadir)/setup-commands
83
	$(INSTALL_PROG) ssh-setup/[a-z]*[!~] $(datadir)/ssh-setup
Martin Pitt's avatar
Martin Pitt committed
84
	$(INSTALL_DATA) ssh-setup/SKELETON $(datadir)/ssh-setup
85

86
clean:
87
	rm -f */*.pyc
88
	rm -f $(htmlfiles)