96b5581e3d00153c3e5c042bca5c7c140a16d406
[febootstrap.git] / helper / Makefile.am
1 # febootstrap Makefile.am
2 # (C) Copyright 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., 675 Mass Ave, Cambridge, MA 02139, USA.
17 #
18 # Written by Richard W.M. Jones <rjones@redhat.com>
19
20 bin_PROGRAMS = \
21         febootstrap-supermin-helper
22
23 febootstrap_supermin_helper_SOURCES = \
24         helper.h \
25         appliance.c \
26         cpio.c \
27         ext2.c \
28         ext2cpio.c \
29         ext2initrd.c \
30         ext2internal.h \
31         kernel.c \
32         main.c \
33         utils.c
34 febootstrap_supermin_helper_CFLAGS = -Wall -I../lib
35 febootstrap_supermin_helper_LDADD = \
36         ext2init.o -lext2fs -lcom_err $(LTLIBINTL) -L../lib -lgnu
37
38 # init "script" used by ext2 initrd.
39 noinst_PROGRAMS = init
40 init_SOURCES = init.c
41 init_CFLAGS = -static
42 init_LDFLAGS = -all-static
43
44 # http://www.doof.me.uk/2010/05/07/cute-objcopy-hack/
45 ELF_DEFAULT_ARCH = $(shell $(srcdir)/elf-default-arch)
46 ext2init.o: init
47         strip --strip-all $<
48         @file $< | grep -isq static || \
49           (echo "*** error: init is not staticly linked"; exit 1)
50         objcopy -I binary -B i386 -O $(ELF_DEFAULT_ARCH) $< $@
51
52 man_MANS = \
53         febootstrap-supermin-helper.8
54
55 if HAVE_PERLDOC
56
57 febootstrap-supermin-helper.8: febootstrap-supermin-helper.pod
58         pod2man \
59           --section 8 \
60           -c "Virtualization Support" \
61           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
62           $< > $@
63
64 febootstrap-supermin-helper.txt: febootstrap-supermin-helper.pod
65         pod2text $< > $@
66
67 endif
68
69 EXTRA_DIST = \
70         febootstrap-supermin-helper.8 febootstrap-supermin-helper.txt \
71           febootstrap-supermin-helper.pod \
72           elf-default-arch