appliance: Don't hard-code febootstrap --exclude parameters.
[libguestfs.git] / appliance / Makefile.am
1 # libguestfs
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 include $(top_srcdir)/subdir-rules.mk
19
20 EXTRA_DIST = \
21         packagelist.in \
22         excludelist.in \
23         init \
24         make.sh.in
25
26 fsdir = $(libdir)/guestfs
27 superminfsdir = $(libdir)/guestfs/supermin.d
28
29 fs_DATA =
30 superminfs_DATA = \
31         supermin.d/base.img \
32         supermin.d/daemon.img \
33         supermin.d/init.img \
34         supermin.d/hostfiles
35
36 # This used to be a configure-generated file (as is update.sh still).
37 # However config.status always touches the destination file, which
38 # means the appliance got rebuilt too often.
39 make.sh: make.sh.in
40         cd $(top_builddir) && \
41           ./config.status --file=appliance/$@-t:appliance/$<
42         chmod +x $@-t
43         mv $@-t $@
44
45 packagelist: packagelist.in
46         cpp -undef -D$(DISTRO)=1 < $< | \
47         grep -v '^[[:space:]]*$$' | grep -v '^#' > $@-t
48         mv $@-t $@
49
50 excludelist: excludelist.in
51         cpp -undef -D$(DISTRO)=1 < $< | \
52         grep -v '^[[:space:]]*$$' | grep -v '^#' > $@-t
53         mv $@-t $@
54
55 supermin.d/base.img supermin.d/hostfiles: stamp-supermin
56 stamp-supermin: make.sh packagelist excludelist
57         mkdir -p supermin.d
58         rm -f $@ supermin.d/base.img supermin.d/hostfiles
59         ./make.sh
60         touch $@
61
62 supermin.d/daemon.img: ../daemon/guestfsd
63         mkdir -p supermin.d
64         rm -f $@ $@-t
65         mkdir sbin
66         cd sbin && ln ../../daemon/guestfsd
67         echo -e "sbin\nsbin/guestfsd" | cpio --quiet -o -H newc > $@-t
68         rm -r sbin
69         mv $@-t $@
70
71 supermin.d/init.img: init
72         mkdir -p supermin.d
73         rm -f $@ $@-t
74         echo "init" | cpio --quiet -o -H newc > $@-t
75         mv $@-t $@
76
77 # Make clean.
78
79 CLEANFILES = packagelist excludelist
80
81 clean-local:
82         rm -rf supermin.d