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