daemon: Don't include .gitignore in EXTRA_DIST.
[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         cpmv.c \
98         daemon.h \
99         dd.c \
100         debug.c \
101         devsparts.c \
102         df.c \
103         dir.c \
104         dmesg.c \
105         dropcaches.c \
106         du.c \
107         echo_daemon.c \
108         ext2.c \
109         fallocate.c \
110         file.c \
111         findfs.c \
112         fill.c \
113         find.c \
114         fsck.c \
115         glob.c \
116         grep.c \
117         grub.c \
118         guestfsd.c \
119         headtail.c \
120         hexdump.c \
121         htonl.c \
122         initrd.c \
123         inotify.c \
124         is.c \
125         link.c \
126         ls.c \
127         luks.c \
128         lvm.c \
129         lvm-filter.c \
130         mkfs.c \
131         mknod.c \
132         modprobe.c \
133         mount.c \
134         names.c \
135         ntfs.c \
136         optgroups.c \
137         optgroups.h \
138         parted.c \
139         pingdaemon.c \
140         proto.c \
141         readdir.c \
142         realpath.c \
143         scrub.c \
144         selinux.c \
145         sfdisk.c \
146         sleep.c \
147         stat.c \
148         statvfs.c \
149         strings.c \
150         stubs.c \
151         swap.c \
152         sync.c \
153         tar.c \
154         truncate.c \
155         umask.c \
156         upload.c \
157         utimens.c \
158         wc.c \
159         xattr.c \
160         zero.c \
161         zerofree.c
162 guestfsd_LDADD = \
163         liberrnostring.a \
164         libprotocol.a \
165         $(SELINUX_LIB) \
166         $(AUGEAS_LIB) \
167         $(top_builddir)/gnulib/lib/.libs/libgnu.a \
168         $(GETADDRINFO_LIB) \
169         $(HOSTENT_LIB) \
170         $(INET_NTOP_LIB) \
171         $(LIBSOCKET) \
172         $(LIB_CLOCK_GETTIME) \
173         $(LIBINTL) \
174         $(SERVENT_LIB)
175
176 guestfsd_CPPFLAGS = -I$(top_srcdir)/gnulib/lib
177 guestfsd_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
178
179 .PHONY: force