New APIs: copy-{file,device}-to-{file,device}.
[libguestfs.git] / daemon / Makefile.am
1 # libguestfs-daemon
2 # Copyright (C) 2011 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 libsrcdir = $(top_builddir)/src
21
22 generator_built = \
23         actions.h \
24         stubs.c \
25         names.c
26
27 BUILT_SOURCES = \
28         $(generator_built) \
29         guestfs_protocol.c \
30         guestfs_protocol.h \
31         errnostring_gperf.c \
32         errnostring_gperf.gperf \
33         errnostring.c \
34         errnostring.h
35
36 EXTRA_DIST = $(BUILT_SOURCES)
37
38 noinst_LIBRARIES = libprotocol.a
39
40 # This convenience library is solely to compile its generated sources with
41 # custom flags.
42 libprotocol_a_SOURCES = guestfs_protocol.c guestfs_protocol.h
43 libprotocol_a_CFLAGS = -Wall -Wno-unused -fno-strict-aliasing
44
45 guestfs_protocol.c: $(libsrcdir)/guestfs_protocol.c
46         rm -f $@
47         ln $< $@
48 guestfs_protocol.h: $(libsrcdir)/guestfs_protocol.h
49         rm -f $@
50         ln $< $@
51 $(libsrcdir)/guestfs_protocol.c: force
52         $(MAKE) -C $(libsrcdir) guestfs_protocol.c
53 $(libsrcdir)/guestfs_protocol.h: force
54         $(MAKE) -C $(libsrcdir) guestfs_protocol.h
55
56 # Build the errnostring perfect hash code.  The generated code has lots
57 # of warnings so we must compile it in a separate mini-library.
58 noinst_LIBRARIES += liberrnostring.a
59 liberrnostring_a_SOURCES = \
60         errnostring_gperf.c \
61         errnostring.h \
62         errnostring.c
63 liberrnostring_a_CFLAGS =
64
65 errnostring_gperf.c: errnostring_gperf.gperf
66         rm -f $@
67         $(GPERF) -t $< > $@-t
68         mv $@-t $@
69 errnostring_gperf.gperf: $(libsrcdir)/errnostring_gperf.gperf
70         rm -f $@
71         ln $< $@
72 errnostring.c: $(libsrcdir)/errnostring.c
73         rm -f $@
74         ln $< $@
75 errnostring.h: $(libsrcdir)/errnostring.h
76         rm -f $@
77         ln $< $@
78
79 if INSTALL_DAEMON
80 sbin_PROGRAMS = guestfsd
81 else
82 noinst_PROGRAMS = guestfsd
83 endif
84
85 guestfsd_SOURCES = \
86         9p.c \
87         actions.h \
88         available.c \
89         augeas.c \
90         base64.c \
91         blkid.c \
92         blockdev.c \
93         btrfs.c \
94         checksum.c \
95         cmp.c \
96         command.c \
97         compress.c \
98         copy.c \
99         cpmv.c \
100         daemon.h \
101         dd.c \
102         debug.c \
103         devsparts.c \
104         df.c \
105         dir.c \
106         dmesg.c \
107         dropcaches.c \
108         du.c \
109         echo_daemon.c \
110         ext2.c \
111         fallocate.c \
112         file.c \
113         findfs.c \
114         fill.c \
115         find.c \
116         fsck.c \
117         glob.c \
118         grep.c \
119         grub.c \
120         guestfsd.c \
121         headtail.c \
122         hexdump.c \
123         htonl.c \
124         initrd.c \
125         inotify.c \
126         is.c \
127         link.c \
128         ls.c \
129         luks.c \
130         lvm.c \
131         lvm-filter.c \
132         mkfs.c \
133         mknod.c \
134         modprobe.c \
135         mount.c \
136         names.c \
137         ntfs.c \
138         optgroups.c \
139         optgroups.h \
140         parted.c \
141         pingdaemon.c \
142         proto.c \
143         readdir.c \
144         realpath.c \
145         scrub.c \
146         selinux.c \
147         sfdisk.c \
148         sleep.c \
149         stat.c \
150         statvfs.c \
151         strings.c \
152         stubs.c \
153         swap.c \
154         sync.c \
155         tar.c \
156         truncate.c \
157         umask.c \
158         upload.c \
159         utimens.c \
160         wc.c \
161         xattr.c \
162         zero.c \
163         zerofree.c
164 guestfsd_LDADD = \
165         liberrnostring.a \
166         libprotocol.a \
167         $(SELINUX_LIB) \
168         $(AUGEAS_LIB) \
169         $(top_builddir)/gnulib/lib/.libs/libgnu.a \
170         $(GETADDRINFO_LIB) \
171         $(HOSTENT_LIB) \
172         $(INET_NTOP_LIB) \
173         $(LIBSOCKET) \
174         $(LIB_CLOCK_GETTIME) \
175         $(LIBINTL) \
176         $(SERVENT_LIB)
177
178 guestfsd_CPPFLAGS = -I$(top_srcdir)/gnulib/lib
179 guestfsd_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
180
181 .PHONY: force