aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile.am
blob: 00891cfc0ec841eacf4d75bc94392ee93aff2f4c (plain) (blame)
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
bin_PROGRAMS = mpd

mpd_headers = \
	notify.h \
	ack.h \
	audio.h \
	audio_format.h \
	audioOutput.h \
	output_internal.h \
	output_api.h \
	output_list.h \
	output_thread.h \
	output_control.h \
	output/shout_plugin.h \
	buffer2array.h \
	command.h \
	idle.h \
	cmdline.h \
	conf.h \
	crossfade.h \
	dbUtils.h \
	decoder_thread.h \
	decoder_control.h \
	decoder_api.h \
	decoder_internal.h \
	directory.h \
	directory_save.h \
	directory_print.h \
	database.h \
	update.h \
	dirvec.h \
	gcc.h \
	decoder_list.h \
	decoder/_flac_common.h \
	decoder/_ogg_common.h \
	input_stream.h \
	input_file.h \
	input_curl.h \
	icy_metadata.h \
	client.h \
	listen.h \
	log.h \
	ls.h \
	main.h \
	event_pipe.h \
	daemon.h \
	normalize.h \
	compress.h \
	pipe.h \
	path.h \
	mapper.h \
	pcm_utils.h \
	pcm_volume.h \
	pcm_mix.h \
	pcm_channels.h \
	pcm_format.h \
	pcm_resample.h \
	pcm_dither.h \
	pcm_prng.h \
	permission.h \
	player_thread.h \
	player_control.h \
	playerData.h \
	playlist.h \
	playlist_save.h \
	replay_gain.h \
	sig_handlers.h \
	song.h \
	song_print.h \
	song_save.h \
	songvec.h \
	state_file.h \
	stats.h \
	tag.h \
	tag_internal.h \
	tag_pool.h \
	tag_id3.h \
	tag_print.h \
	tag_save.h \
	strset.h \
	utils.h \
	volume.h \
	zeroconf.h zeroconf-internal.h \
	locate.h \
	stored_playlist.h \
	timer.h \
	archive_api.h \
	archive_list.h \
	input_archive.h


mpd_SOURCES = \
	$(mpd_headers) \
	notify.c \
	audio.c \
	audioOutput.c \
	output_api.c \
	output_list.c \
	output_thread.c \
	output_control.c \
	output_init.c \
	output/null_plugin.c \
	buffer2array.c \
	command.c \
	idle.c \
	cmdline.c \
	conf.c \
	crossfade.c \
	dbUtils.c \
	decoder_thread.c \
	decoder_control.c \
	decoder_api.c \
	directory.c \
	directory_save.c \
	directory_print.c \
	database.c \
	dirvec.c \
	update.c \
	decoder_list.c \
	input_stream.c \
	input_file.c \
	client.c \
	listen.c \
	log.c \
	ls.c \
	main.c \
	event_pipe.c \
	daemon.c \
	normalize.c \
	compress.c \
	pipe.c \
	path.c \
	mapper.c \
	pcm_utils.c \
	pcm_volume.c \
	pcm_mix.c \
	pcm_channels.c \
	pcm_format.c \
	pcm_resample.c \
	pcm_dither.c \
	permission.c \
	player_thread.c \
	player_control.c \
	playerData.c \
	playlist.c \
	playlist_save.c \
	replay_gain.c \
	sig_handlers.c \
	song.c \
	song_print.c \
	song_save.c \
	songvec.c \
	state_file.c \
	stats.c \
	tag.c \
	tag_pool.c \
	tag_print.c \
	tag_save.c \
	strset.c \
	utils.c \
	volume.c \
	locate.c \
	stored_playlist.c \
	timer.c

if HAVE_LIBSAMPLERATE
mpd_SOURCES += pcm_resample_libsamplerate.c
else
mpd_SOURCES += pcm_resample_fallback.c
endif

if HAVE_ID3TAG
mpd_SOURCES += tag_id3.c
endif

# archive plugins

if HAVE_BZ2
mpd_SOURCES += archive/bz2_plugin.c
endif

if HAVE_ZIP
mpd_SOURCES += archive/zip_plugin.c
endif

if HAVE_ISO
mpd_SOURCES += archive/iso_plugin.c
endif

if ENABLE_ARCHIVE
mpd_SOURCES += \
	archive_api.c \
	archive_list.c \
	input_archive.c
endif


# decoder plugins

if HAVE_MAD
mpd_SOURCES += decoder/mp3_plugin.c
endif

if HAVE_MPCDEC
mpd_SOURCES += decoder/mpc_plugin.c
endif

if HAVE_WAVPACK
mpd_SOURCES += decoder/wavpack_plugin.c
endif

if HAVE_FAAD
mpd_SOURCES += decoder/aac_plugin.c
endif

if HAVE_MP4
mpd_SOURCES += decoder/mp4_plugin.c
endif

if HAVE_OGG_COMMON
mpd_SOURCES += decoder/_ogg_common.c
endif

if HAVE_FLAC_COMMON
mpd_SOURCES += decoder/_flac_common.c
endif

if HAVE_OGGVORBIS
mpd_SOURCES += decoder/oggvorbis_plugin.c
endif

if HAVE_FLAC
mpd_SOURCES += decoder/flac_plugin.c
endif

if HAVE_OGGFLAC
mpd_SOURCES += decoder/oggflac_plugin.c
endif

if HAVE_AUDIOFILE
mpd_SOURCES += decoder/audiofile_plugin.c
endif

if HAVE_MIKMOD
mpd_SOURCES += decoder/mod_plugin.c
endif

if HAVE_MODPLUG
mpd_SOURCES += decoder/modplug_plugin.c
endif

if HAVE_FFMPEG
mpd_SOURCES += decoder/ffmpeg_plugin.c
endif


if HAVE_ZEROCONF
mpd_SOURCES += zeroconf.c

if HAVE_AVAHI
mpd_SOURCES += zeroconf-avahi.c
endif

if HAVE_BONJOUR
mpd_SOURCES += zeroconf-bonjour.c
endif
endif


if HAVE_CURL
mpd_SOURCES += input_curl.c icy_metadata.c
endif


if HAVE_ALSA
mpd_SOURCES += output/alsa_plugin.c
mpd_SOURCES += mixer/alsa_mixer.c
endif

if HAVE_AO
mpd_SOURCES += output/ao_plugin.c
endif

if HAVE_FIFO
mpd_SOURCES += output/fifo_plugin.c
endif

if HAVE_JACK
mpd_SOURCES += output/jack_plugin.c
endif

if HAVE_MVP
mpd_SOURCES += output/mvp_plugin.c
endif

if HAVE_OSS
mpd_SOURCES += output/oss_plugin.c
mpd_SOURCES += mixer/oss_mixer.c
endif

if HAVE_OSX
mpd_SOURCES += output/osx_plugin.c
endif

if HAVE_PULSE
mpd_SOURCES += output/pulse_plugin.c
endif

if HAVE_SHOUT
mpd_SOURCES += output/shout_plugin.c
endif

if HAVE_SHOUT_MP3
mpd_SOURCES += output/shout_mp3.c
endif

if HAVE_SHOUT_OGG
mpd_SOURCES += output/shout_ogg.c
endif

mpd_CFLAGS = $(MPD_CFLAGS)
mpd_CPPFLAGS = \
	$(CURL_CFLAGS) \
	$(AO_CFLAGS) $(ALSA_CFLAGS) \
	$(SHOUT_CFLAGS) \
	$(OGGVORBIS_CFLAGS) $(VORBISENC_CFLAGS) \
	$(patsubst -I%/FLAC,-I%,$(FLAC_CFLAGS)) \
	$(AUDIOFILE_CFLAGS) $(LIBMIKMOD_CFLAGS) \
	$(MODPLUG_CFLAGS) \
	$(ID3TAG_CFLAGS) \
	$(MAD_CFLAGS) \
	$(FFMPEG_CFLAGS) \
	$(GLIB_CFLAGS)
mpd_LDADD = $(MPD_LIBS) \
	$(CURL_LIBS) \
	$(AO_LIBS) $(ALSA_LIBS) \
	$(SHOUT_LIBS) \
	$(OGGVORBIS_LIBS) $(VORBISENC_LIBS) $(FLAC_LIBS) \
	$(AUDIOFILE_LIBS) $(LIBMIKMOD_LIBS) \
	$(MODPLUG_LIBS) \
	$(ID3TAG_LIBS) \
	$(MAD_LIBS) \
	$(MP4FF_LIBS) \
	$(FFMPEG_LIBS) \
	$(GLIB_LIBS)

# sparse is a semantic parser
# URL: git://www.kernel.org/pub/scm/devel/sparse/sparse.git
SPARSE = sparse
SPARSE_FLAGS =
SPARSE_CPPFLAGS = $(DEFAULT_INCLUDES) \
	-I$(shell $(CC) -print-file-name=include) \
	-I$(shell $(CC) -print-file-name=include-fixed)
sparse-check:
	for i in $(mpd_SOURCES); \
	do \
		$(SPARSE) -I. $(mpd_CFLAGS) $(mpd_CPPFLAGS) $(SPARSE_FLAGS) $(SPARSE_CPPFLAGS) $(srcdir)/$$i || exit; \
	done

TEST_CFLAGS = -DUNIT_TEST
TEST_FILES := $(shell grep UNIT_TEST \
               $(addprefix $(srcdir)/, $(mpd_SOURCES)) | \
               awk -F: '{print $$1}' | uniq)

test: $(addprefix test-, $(subst .c,,$(TEST_FILES)))

test-%: %.c
	$(CC) $(CFLAGS) $(TEST_CFLAGS) -o $@ $<
	@./$@
	@echo $@: OK

.PHONY: sparse-check test