Makefile.am 6.09 KB
Newer Older
Warren Dukes's avatar
Warren Dukes committed
1
bin_PROGRAMS = mpd
Warren Dukes's avatar
Warren Dukes committed
2

3 4
mpd_CFLAGS = $(MPD_CFLAGS)
mpd_CPPFLAGS = \
5
	$(SQLITE_CFLAGS) \
6 7 8 9 10 11 12 13 14 15 16 17
	$(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) \
18
	$(SQLITE_LIBS) \
19 20 21 22 23 24 25 26 27 28 29 30
	$(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)

Warren Dukes's avatar
Warren Dukes committed
31
mpd_headers = \
32
	notify.h \
Warren Dukes's avatar
Warren Dukes committed
33 34
	ack.h \
	audio.h \
Eric Wong's avatar
Eric Wong committed
35
	audio_format.h \
36
	audioOutput.h \
37
	output_internal.h \
38
	output_api.h \
39
	output_list.h \
40
	output_thread.h \
41
	output_control.h \
42
	output/shout_plugin.h \
Warren Dukes's avatar
Warren Dukes committed
43 44
	buffer2array.h \
	command.h \
45
	idle.h \
46
	cmdline.h \
Warren Dukes's avatar
Warren Dukes committed
47
	conf.h \
48
	crossfade.h \
49
	dbUtils.h \
50
	decoder_thread.h \
51
	decoder_control.h \
Max Kellermann's avatar
Max Kellermann committed
52 53
	decoder_api.h \
	decoder_internal.h \
Warren Dukes's avatar
Warren Dukes committed
54
	directory.h \
55 56
	directory_save.h \
	directory_print.h \
57
	database.h \
58
	update.h \
59
	dirvec.h \
60
	gcc.h \
61
	decoder_list.h \
62 63
	decoder/_flac_common.h \
	decoder/_ogg_common.h \
64 65
	input_stream.h \
	input_file.h \
66
	input_curl.h \
67
	icy_metadata.h \
68
	client.h \
Warren Dukes's avatar
Warren Dukes committed
69 70 71
	listen.h \
	log.h \
	ls.h \
72
	main.h \
73
	mixer_api.h \
74
	event_pipe.h \
75
	daemon.h \
76
	normalize.h \
77
	compress.h \
78
	pipe.h \
Warren Dukes's avatar
Warren Dukes committed
79
	path.h \
80
	mapper.h \
Warren Dukes's avatar
Warren Dukes committed
81
	pcm_utils.h \
82
	pcm_convert.h \
83
	pcm_volume.h \
84
	pcm_mix.h \
85
	pcm_channels.h \
86
	pcm_format.h \
87
	pcm_resample.h \
88
	pcm_dither.h \
89
	pcm_prng.h \
Warren Dukes's avatar
Warren Dukes committed
90
	permission.h \
91
	player_thread.h \
92
	player_control.h \
Warren Dukes's avatar
Warren Dukes committed
93
	playlist.h \
94
	playlist_save.h \
95
	queue.h \
96
	queue_print.h \
97
	replay_gain.h \
Warren Dukes's avatar
Warren Dukes committed
98 99
	sig_handlers.h \
	song.h \
100 101
	song_print.h \
	song_save.h \
102
	song_sticker.h \
103
	songvec.h \
104
	state_file.h \
Warren Dukes's avatar
Warren Dukes committed
105
	stats.h \
106
	sticker.h \
Warren Dukes's avatar
Warren Dukes committed
107
	tag.h \
108
	tag_internal.h \
109
	tag_pool.h \
110
	tag_id3.h \
111
	tag_print.h \
112
	tag_save.h \
113
	strset.h \
Warren Dukes's avatar
Warren Dukes committed
114
	utils.h \
115
	volume.h \
116
	zeroconf.h zeroconf-internal.h \
117
	locate.h \
118
	stored_playlist.h \
119 120 121 122
	timer.h \
	archive_api.h \
	archive_list.h \
	input_archive.h
Warren Dukes's avatar
Warren Dukes committed
123 124 125 126


mpd_SOURCES = \
	$(mpd_headers) \
127
	notify.c \
Warren Dukes's avatar
Warren Dukes committed
128
	audio.c \
129
	audioOutput.c \
130
	output_api.c \
131
	output_list.c \
132
	output_thread.c \
133 134
	output_control.c \
	output_init.c \
135
	output/null_plugin.c \
Warren Dukes's avatar
Warren Dukes committed
136 137
	buffer2array.c \
	command.c \
138
	idle.c \
139
	cmdline.c \
Warren Dukes's avatar
Warren Dukes committed
140
	conf.c \
141
	crossfade.c \
142
	dbUtils.c \
143
	decoder_thread.c \
Max Kellermann's avatar
Max Kellermann committed
144
	decoder_control.c \
145
	decoder_api.c \
Warren Dukes's avatar
Warren Dukes committed
146
	directory.c \
147 148
	directory_save.c \
	directory_print.c \
149
	database.c \
150
	dirvec.c \
151
	update.c \
152
	decoder_list.c \
153 154
	input_stream.c \
	input_file.c \
155
	client.c \
Warren Dukes's avatar
Warren Dukes committed
156 157 158 159
	listen.c \
	log.c \
	ls.c \
	main.c \
160
	event_pipe.c \
161
	daemon.c \
Viliam Mateicka's avatar
Viliam Mateicka committed
162
	mixer_api.c \
163
	normalize.c \
164
	compress.c \
165
	pipe.c \
Warren Dukes's avatar
Warren Dukes committed
166
	path.c \
167
	mapper.c \
168
	pcm_convert.c \
169
	pcm_volume.c \
170
	pcm_mix.c \
171
	pcm_channels.c \
172
	pcm_format.c \
173
	pcm_resample.c \
174
	pcm_dither.c \
Warren Dukes's avatar
Warren Dukes committed
175
	permission.c \
176
	player_thread.c \
177
	player_control.c \
Warren Dukes's avatar
Warren Dukes committed
178
	playlist.c \
179
	playlist_save.c \
180
	queue.c \
181
	queue_print.c \
182
	replay_gain.c \
Warren Dukes's avatar
Warren Dukes committed
183 184
	sig_handlers.c \
	song.c \
185 186
	song_print.c \
	song_save.c \
187
	songvec.c \
188
	state_file.c \
Warren Dukes's avatar
Warren Dukes committed
189 190
	stats.c \
	tag.c \
191
	tag_pool.c \
192
	tag_print.c \
193
	tag_save.c \
194
	strset.c \
Warren Dukes's avatar
Warren Dukes committed
195 196
	utils.c \
	volume.c \
197
	locate.c \
198
	stored_playlist.c \
199
	timer.c
Warren Dukes's avatar
Warren Dukes committed
200

201
if ENABLE_SQLITE
202
mpd_SOURCES += sticker.c song_sticker.c
203 204
endif

205 206 207 208 209 210
if HAVE_LIBSAMPLERATE
mpd_SOURCES += pcm_resample_libsamplerate.c
else
mpd_SOURCES += pcm_resample_fallback.c
endif

211 212 213 214
if HAVE_ID3TAG
mpd_SOURCES += tag_id3.c
endif

215 216 217 218 219 220
# archive plugins

if HAVE_BZ2
mpd_SOURCES += archive/bz2_plugin.c
endif

221 222 223
if HAVE_ZIP
mpd_SOURCES += archive/zip_plugin.c
endif
224

225 226 227
if HAVE_ISO
mpd_SOURCES += archive/iso_plugin.c
endif
228

229 230 231 232 233 234 235 236
if ENABLE_ARCHIVE
mpd_SOURCES += \
	archive_api.c \
	archive_list.c \
	input_archive.c
endif


237 238 239
# decoder plugins

if HAVE_MAD
240
mpd_SOURCES += decoder/mp3_plugin.c
241 242 243
endif

if HAVE_MPCDEC
244
mpd_SOURCES += decoder/mpc_plugin.c
245 246 247
endif

if HAVE_WAVPACK
248
mpd_SOURCES += decoder/wavpack_plugin.c
249 250 251
endif

if HAVE_FAAD
252 253 254 255 256
mpd_SOURCES += decoder/aac_plugin.c
endif

if HAVE_MP4
mpd_SOURCES += decoder/mp4_plugin.c
257 258 259
endif

if HAVE_OGG_COMMON
260
mpd_SOURCES += decoder/_ogg_common.c
261 262 263
endif

if HAVE_FLAC_COMMON
264
mpd_SOURCES += decoder/_flac_common.c
265 266 267
endif

if HAVE_OGGVORBIS
268
mpd_SOURCES += decoder/oggvorbis_plugin.c
269 270 271
endif

if HAVE_FLAC
272
mpd_SOURCES += decoder/flac_plugin.c
273 274 275
endif

if HAVE_OGGFLAC
276
mpd_SOURCES += decoder/oggflac_plugin.c
277 278 279
endif

if HAVE_AUDIOFILE
280
mpd_SOURCES += decoder/audiofile_plugin.c
281 282 283
endif

if HAVE_MIKMOD
284
mpd_SOURCES += decoder/mod_plugin.c
285 286
endif

287 288 289 290
if HAVE_MODPLUG
mpd_SOURCES += decoder/modplug_plugin.c
endif

291
if HAVE_FFMPEG
292
mpd_SOURCES += decoder/ffmpeg_plugin.c
293 294
endif

295

296 297
if HAVE_ZEROCONF
mpd_SOURCES += zeroconf.c
298 299 300 301 302 303 304 305

if HAVE_AVAHI
mpd_SOURCES += zeroconf-avahi.c
endif

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

Warren Dukes's avatar
Warren Dukes committed
308

Max Kellermann's avatar
Max Kellermann committed
309
if HAVE_CURL
310
mpd_SOURCES += input_curl.c icy_metadata.c
Max Kellermann's avatar
Max Kellermann committed
311 312 313
endif


314 315
if HAVE_ALSA
mpd_SOURCES += output/alsa_plugin.c
316
mpd_SOURCES += mixer/alsa_mixer.c
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
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
337
mpd_SOURCES += mixer/oss_mixer.c
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359
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

360 361 362 363
# sparse is a semantic parser
# URL: git://www.kernel.org/pub/scm/devel/sparse/sparse.git
SPARSE = sparse
SPARSE_FLAGS =
364 365 366
SPARSE_CPPFLAGS = $(DEFAULT_INCLUDES) \
	-I$(shell $(CC) -print-file-name=include) \
	-I$(shell $(CC) -print-file-name=include-fixed)
367 368 369
sparse-check:
	for i in $(mpd_SOURCES); \
	do \
370
		$(SPARSE) -I. $(mpd_CFLAGS) $(mpd_CPPFLAGS) $(SPARSE_FLAGS) $(SPARSE_CPPFLAGS) $(srcdir)/$$i || exit; \
371 372
	done

Eric Wong's avatar
Eric Wong committed
373
TEST_CFLAGS = -DUNIT_TEST
374 375
TEST_FILES := $(shell grep UNIT_TEST \
               $(addprefix $(srcdir)/, $(mpd_SOURCES)) | \
Eric Wong's avatar
Eric Wong committed
376 377 378 379 380 381 382 383 384 385
               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