summaryrefslogtreecommitdiffstats
path: root/daemon/Makefile.am
blob: 8fb070f63fc4302251b1e444b47ed4829a444223 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# libguestfs-daemon
# Copyright (C) 2010 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

ACLOCAL_AMFLAGS = -I m4

SUBDIRS = lib tests .

libsrcdir = $(top_builddir)/../src
generatorsrcdir = $(top_builddir)/../generator

generator_built = \
	actions.h \
	stubs.c \
	names.c

.PHONY: force

$(generator_built): $(generatorsrcdir)/stamp-generator
$(generatorsrcdir)/stamp-generator: force
	$(MAKE) -C $(generatorsrcdir) stamp-generator

BUILT_SOURCES = \
	$(generator_built) \
	guestfs_protocol.c \
	guestfs_protocol.h \
	errnostring_gperf.c \
	errnostring_gperf.gperf \
	errnostring.c \
	errnostring.h

EXTRA_DIST = $(BUILT_SOURCES) \
	.gitignore

noinst_LIBRARIES = libprotocol.a

# This convenience library is solely to compile its generated sources with
# custom flags.
libprotocol_a_SOURCES = guestfs_protocol.c guestfs_protocol.h
libprotocol_a_CFLAGS = -Wall -Wno-unused -fno-strict-aliasing

guestfs_protocol.c: $(libsrcdir)/guestfs_protocol.c
	rm -f $@
	ln $< $@
guestfs_protocol.h: $(libsrcdir)/guestfs_protocol.h
	rm -f $@
	ln $< $@
$(libsrcdir)/guestfs_protocol.c: force
	$(MAKE) -C $(libsrcdir) guestfs_protocol.c
$(libsrcdir)/guestfs_protocol.h: force
	$(MAKE) -C $(libsrcdir) guestfs_protocol.h

# Build the errnostring perfect hash code.  The generated code has lots
# of warnings so we must compile it in a separate mini-library.
noinst_LIBRARIES += liberrnostring.a
liberrnostring_a_SOURCES = \
	errnostring_gperf.c \
	errnostring.h \
	errnostring.c
liberrnostring_a_CFLAGS =

errnostring_gperf.c: errnostring_gperf.gperf
	rm -f $@
	$(GPERF) -t $< > $@-t
	mv $@-t $@
errnostring_gperf.gperf: $(libsrcdir)/errnostring_gperf.gperf
	rm -f $@
	ln $< $@
errnostring.c: $(libsrcdir)/errnostring.c
	rm -f $@
	ln $< $@
errnostring.h: $(libsrcdir)/errnostring.h
	rm -f $@
	ln $< $@

noinst_PROGRAMS = guestfsd
guestfsd_SOURCES = \
	actions.h \
	available.c \
	augeas.c \
	base64.c \
	blkid.c \
	blockdev.c \
	checksum.c \
	cmp.c \
	command.c \
	cpmv.c \
	daemon.h \
	dd.c \
	debug.c \
	devsparts.c \
	df.c \
	dir.c \
	dmesg.c \
	dropcaches.c \
	du.c \
	echo_daemon.c \
	ext2.c \
	fallocate.c \
	file.c \
	findfs.c \
	fill.c \
	find.c \
	fsck.c \
	glob.c \
	grep.c \
	grub.c \
	guestfsd.c \
	headtail.c \
	hexdump.c \
	htonl.c \
	initrd.c \
	inotify.c \
	is.c \
	link.c \
	ls.c \
	luks.c \
	lvm.c \
	lvm-filter.c \
	mkfs.c \
	mknod.c \
	modprobe.c \
	mount.c \
	names.c \
	ntfs.c \
	optgroups.c \
	optgroups.h \
	parted.c \
	pingdaemon.c \
	proto.c \
	readdir.c \
	realpath.c \
	scrub.c \
	selinux.c \
	sfdisk.c \
	sleep.c \
	stat.c \
	statvfs.c \
	strings.c \
	stubs.c \
	swap.c \
	sync.c \
	tar.c \
	truncate.c \
	umask.c \
	upload.c \
	utimens.c \
	wc.c \
	xattr.c \
	zero.c \
	zerofree.c
guestfsd_LDADD = \
	liberrnostring.a \
	libprotocol.a \
	lib/libgnu.a \
	$(GETADDRINFO_LIB) \
	$(HOSTENT_LIB) \
	$(INET_NTOP_LIB) \
	$(LIBSOCKET) \
	$(LIB_CLOCK_GETTIME) \
	$(LIBINTL) \
	$(SERVENT_LIB)

AM_CPPFLAGS = -I$(srcdir)/lib -Ilib
guestfsd_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)