1
SUBDIRS=tools decoder playlists encoder protocols plugins stream lang \
2
ogg_formats converters operators sources conversions outputs io \
3
visualization analyze synth
5
DISTFILES = $(wildcard *.mli) Makefile $(wildcard *.ml) META.in
7
ocaml_progs= liquidsoap
10
include $(top_srcdir)/Makefile.defs
12
# Liquidsoap source files work as follows.
13
# Each file has to be either added to liquidsoap's files if compiled builtin
14
# or to the corresponding plugin if built as a plugin.
15
# For this purpose, we define the make function
16
# conditional_compilation, which redirects each of those files to
17
# the correct make variable. Its parameters are:
18
# $1: name of the make variable where the file should go if compiled builtin.
19
# $2: the $W_FOO variable
20
# $3: path to the file
21
# $4: type of source: empty for .ml sources,
22
# c_ for c sources and camlp4_ for camlp4 sources.
23
# (Camlp4 sources are not supported yet..)
25
# For now, the old style Makefile has been converted to
26
# this new style by replacing $(if $(W_FOO),..) by
27
# $(call conditional_compilation,..). However, this may
28
# cause some trouble as the order of declaration is important
29
# both for the builtin case and plugin case.. See for instance
30
# SDL files, whose declaration have been moved at the end.
31
conditional_compilation = \
34
$(eval $(2)_$(4)sources += $(3)),\
35
$(eval $(1) += $(3))))
37
liquidsoap_c_files = tools/locale_c.c
39
# Add conditional files..
40
$(call conditional_compilation,liquidsoap_c_files,$(W_OSS),io/oss_io_c.c,c_)
42
# Camlp4 compilation works as follow:
43
# both .camlp4 and .ml files are present in the
45
# If camlp4o is detected, then a .camlp4.ml target
46
# is executed for each .camlp4. This target creates a .camlp4.ml
47
# file that is not used and regenerate the .ml files used for compilation.
48
liquidsoap_camlp4_files = \
49
$(if $(W_DUPPY_SYNTAX),outputs/harbor_output.camlp4) \
50
$(if $(W_DUPPY_SYNTAX),tools/server.camlp4) \
51
$(if $(W_DUPPY_SYNTAX),tools/harbor.camlp4)
53
# This variable contains only conditional files..
56
$(call conditional_compilation,ogg_demuxer,$(W_SPEEX),ogg_formats/speex_decoder.ml)
57
$(call conditional_compilation,ogg_demuxer,$(W_VORBIS),ogg_formats/vorbis_decoder.ml)
58
$(call conditional_compilation,ogg_demuxer,$(W_OPUS),ogg_formats/opus_decoder.ml)
59
$(call conditional_compilation,ogg_demuxer,$(W_THEORA),ogg_formats/theora_decoder.ml)
60
$(call conditional_compilation,ogg_demuxer,$(W_FLAC_OGG),ogg_formats/ogg_flac_decoder.ml)
61
$(call conditional_compilation,ogg_demuxer,$(W_SCHROEDINGER),ogg_formats/dirac_decoder.ml)
63
# This variable contains only conditional files..
66
$(call conditional_compilation,ogg_muxer,$(W_OGG),ogg_formats/ogg_muxer.ml)
67
$(call conditional_compilation,ogg_muxer,$(W_OGG), encoder/ogg_encoder.ml)
68
$(call conditional_compilation,ogg_muxer,$(W_SPEEX),ogg_formats/speex_encoder.ml)
69
$(call conditional_compilation,ogg_muxer,$(W_VORBIS),ogg_formats/vorbis_encoder.ml)
70
$(call conditional_compilation,ogg_muxer,$(W_OPUS),ogg_formats/opus_encoder.ml)
71
$(call conditional_compilation,ogg_muxer,$(W_THEORA),ogg_formats/theora_encoder.ml)
72
$(call conditional_compilation,ogg_muxer,$(W_FLAC_OGG),ogg_formats/ogg_flac_encoder.ml)
73
$(call conditional_compilation,ogg_muxer,$(W_SCHROEDINGER),ogg_formats/dirac_encoder.ml)
76
converters/audio/native_audio_converter.ml
78
$(call conditional_compilation,audio_converters,$(W_SAMPLERATE),converters/audio/libsamplerate_converter.ml)
81
converters/video_converter.ml \
82
converters/video/native_video_converter.ml
84
$(call conditional_compilation,video_converters,$(W_GAVL),converters/video/gavl_converter.ml)
85
$(call conditional_compilation,video_converters,$(W_FFMPEG),converters/video/ffmpeg_video_converter.ml)
88
decoder/metadata_decoder.ml \
89
decoder/wav_decoder.ml decoder/midi_decoder.ml \
90
decoder/image_decoder.ml decoder/image/ppm_decoder.ml \
91
$(if ($(OS_TYPE):Win32=),decoder/external_decoder.ml)
93
$(call conditional_compilation,decoders,$(W_FLAC),decoder/flac_decoder.ml)
94
$(call conditional_compilation,decoders,$(W_FAAD),decoder/aac_decoder.ml)
95
$(call conditional_compilation,decoders,$(W_OGG),decoder/ogg_decoder.ml)
96
$(call conditional_compilation,decoders,$(W_MAD),decoder/mad_decoder.ml)
97
$(call conditional_compilation,decoders,$(W_VORBIS),decoder/vorbisduration.ml)
98
$(call conditional_compilation,decoders,$(W_FLAC),decoder/flacduration.ml)
99
$(call conditional_compilation,decoders,$(W_FLAC_OGG),decoder/ogg_flac_duration.ml)
100
$(call conditional_compilation,decoders,$(W_TAGLIB),decoder/taglib_plug.ml)
103
playlists/playlist_basic.ml
105
$(call conditional_compilation,playlists,$(W_XMLPLAYLIST),playlists/playlist_xml.ml)
108
$(if ($(OS_TYPE):Win32=),protocols/say.ml) \
109
protocols/annotate.ml \
111
$(if ($(OS_TYPE):Win32=),protocols/extproto.ml)
114
sources/synthesized.ml sources/noise.ml sources/blank.ml \
115
sources/audio_gen.ml sources/request_source.ml \
116
sources/req_simple.ml sources/playlist.ml \
117
sources/req_queue.ml sources/req_equeue.ml \
118
sources/generated.ml sources/http_source.ml \
119
tools/harbor.ml sources/harbor_input.ml \
120
$(if ($(OS_TYPE):Win32=),sources/external_input.ml) \
123
$(call conditional_compilation,sources,$(W_BJACK),sources/bjack_in.ml)
126
operators/insert_metadata.ml operators/map_metadata.ml \
127
operators/on_metadata.ml operators/store_metadata.ml \
128
operators/on_track.ml operators/on_end.ml operators/delay.ml \
129
operators/switch.ml operators/fade.ml operators/add.ml \
130
operators/sequence.ml operators/cross.ml operators/smartcross.ml \
131
operators/compress_exp.ml operators/pitch.ml \
132
operators/fir_filter.ml operators/iir_filter.ml \
133
operators/biquad_filter.ml operators/cuepoint.ml \
134
operators/map_op.ml operators/flanger.ml operators/comb.ml \
135
operators/compress.ml operators/clip.ml operators/filter.ml \
136
operators/setvol.ml operators/normalize.ml operators/echo.ml \
137
operators/append.ml operators/pan.ml operators/ms_stereo.ml \
138
operators/dyn_op.ml operators/video_effects.ml operators/video_fade.ml \
139
operators/noblank.ml operators/compand.ml \
140
operators/mixing_table.ml operators/prepend.ml \
141
operators/midi_routing.ml \
142
operators/time_warp.ml operators/resample.ml \
143
operators/chord.ml operators/video_text.ml
145
$(call conditional_compilation,operators,$(W_SOUNDTOUCH),operators/soundtouch_op.ml)
146
$(call conditional_compilation,operators,$(W_SOUNDTOUCH),operators/st_bpm.ml)
147
$(call conditional_compilation,operators,$(W_LADSPA),operators/ladspa_op.ml)
148
$(call conditional_compilation,operators,$(W_FREI0R),operators/frei0r_op.ml)
151
conversions/audio_to_stereo.ml conversions/drop.ml conversions/id.ml \
152
conversions/swap.ml conversions/mean.ml conversions/mux.ml
154
analyze = analyze/analyze_rms.ml
157
encoder/wav_encoder.ml \
158
encoder/lame_encoder.ml \
159
encoder/aacplus_encoder.ml \
160
$(if ($(OS_TYPE):Win32=),encoder/external_encoder.ml) \
161
$(if $(W_LAME_DYN),encoder/lame_encoder_dynlink.ml) \
162
$(if $(W_AACPLUS_DYN),encoder/aacplus_encoder_dynlink.ml)
164
$(call conditional_compilation,encoders,$(W_SHINE),encoder/shine_encoder.ml)
165
$(call conditional_compilation,encoders,$(W_LAME),encoder/lame_encoder_builtin.ml)
166
$(call conditional_compilation,encoders,$(W_FLAC),encoder/flac_encoder.ml)
167
$(call conditional_compilation,encoders,$(W_AACPLUS),encoder/aacplus_encoder_builtin.ml)
168
$(call conditional_compilation,encoders,$(W_VOAACENC),encoder/voaacenc_encoder.ml)
169
$(call conditional_compilation,encoders,$(W_FDKAAC),encoder/fdkaac_encoder.ml)
170
$(call conditional_compilation,encoders,$(W_TAGLIB),encoder/taglib_id3v2.ml)
172
outputs = outputs/output.ml \
173
outputs/pipe_output.ml \
174
outputs/harbor_output.ml
176
$(call conditional_compilation,outputs,$(W_AO),outputs/ao_out.ml)
177
$(call conditional_compilation,outputs,$(W_CRY),outputs/icecast2.ml)
178
$(call conditional_compilation,outputs,$(W_GRAPHICS),outputs/graphics_out.ml)
179
$(call conditional_compilation,outputs,$(W_BJACK),outputs/bjack_out.ml)
183
$(call conditional_compilation,io,$(W_OSS),io/oss_io.ml)
184
$(call conditional_compilation,io,$(W_PULSEAUDIO),io/pulseaudio_io.ml)
185
$(call conditional_compilation,io,$(W_PORTAUDIO),io/portaudio_io.ml)
187
tools = tools/stdlib.ml tools/doc.ml tools/plug.ml tools/utils.ml \
188
$(if $(W_DYNLINK),tools/dyntools.ml) \
190
$(if $(W_LAME_DYN),tools/lame_dynlink.ml) \
191
$(if $(W_AACPLUS_DYN),tools/aacplus_dynlink.ml) \
192
tools/wav.ml tools/tutils.ml \
193
tools/file_watcher.ml tools/file_watcher_mtime.ml \
195
tools/http.ml tools/pool.ml
197
$(call conditional_compilation,tools,$(W_INOTIFY),tools/file_watcher_inotify.ml)
199
stream =stream/frame.ml stream/generator.ml \
200
stream/aFrame.ml stream/vFrame.ml stream/mFrame.ml
202
visualization = visualization/vumeter.ml \
203
visualization/midimeter.ml \
204
visualization/video_volume.ml
206
$(call conditional_compilation,visualization,$(W_GRAPHICS),visualization/vis_volume.ml)
208
synth = synth/keyboard.ml synth/synth_op.ml
210
$(call conditional_compilation,synth,$(W_DSSI),synth/dssi_op.ml)
212
builtins = lang/lang_builtins.ml \
213
$(if $(W_YOJSON),lang/builtins_json.ml)
215
$(call conditional_compilation,builtins,$(W_LO),lang/builtins_lo.ml)
216
$(call conditional_compilation,builtins,$(W_MAGIC),lang/builtins_magic.ml)
217
$(call conditional_compilation,builtins,$(W_CRY),lang/builtins_cry.ml)
219
liquidsoap_sources= $(tools) SVN.ml converters/audio_converter.ml $(stream) \
220
decoder/decoder.ml request.ml tools/server.ml \
221
source.ml clock.ml tools/rutils.ml \
222
playlist_parser.ml encoder/encoder.ml \
223
tools/server_builtins.ml
225
# Some for camlimages
226
$(call conditional_compilation,decoders,$(W_CAMLIMAGES),decoder/image/camlimages_decoder.ml)
228
# Include SDL now. Order matters so we group them all here..
229
$(call conditional_compilation,liquidsoap_sources,$(W_SDL),tools/sdl_utils.ml)
230
$(call conditional_compilation,synth,$(W_SDL),synth/keyboard_sdl.ml)
231
$(call conditional_compilation,decoders,$(W_SDL),decoder/image/sdlimage_decoder.ml)
232
$(call conditional_compilation,operators,$(W_SDL),operators/video_text_sdl.ml)
233
$(call conditional_compilation,outputs,$(W_SDL),outputs/sdl_out.ml)
236
$(call conditional_compilation,liquidsoap_sources,$(W_LASTFM),tools/liqfm.ml)
237
$(call conditional_compilation,protocols,$(W_LASTFM),protocols/lastfm_req.ml)
238
$(call conditional_compilation,sources,$(W_LASTFM),sources/lastfm_input.ml)
239
$(call conditional_compilation,builtins,$(W_LASTFM),lang/builtins_lastfm.ml)
242
$(call conditional_compilation,liquidsoap_sources,$(W_ALSA), alsa_settings.ml)
243
$(call conditional_compilation,sources,$(W_ALSA),sources/alsa_in.ml)
244
$(call conditional_compilation,outputs,$(W_ALSA),outputs/alsa_out.ml)
245
$(call conditional_compilation,io,$(W_ALSA),io/alsa_io.ml)
248
$(call conditional_compilation,operators,$(W_GD),operators/video_text_gd.ml)
251
$(call conditional_compilation,stream,$(W_GSTREAMER),tools/gstreamer_utils.ml)
252
$(call conditional_compilation,decoders,$(W_GSTREAMER),decoder/gstreamer_decoder.ml)
253
$(call conditional_compilation,encoders,$(W_GSTREAMER),encoder/gstreamer_encoder.ml)
254
$(call conditional_compilation,operators,$(W_GSTREAMER),operators/video_text_gstreamer.ml)
255
$(call conditional_compilation,io,$(W_GSTREAMER),io/gstreamer_io.ml)
257
liquidsoap_sources += \
258
lang/lang_types.ml lang/lang_values.ml \
259
lang/lang_encoders.ml lang/lang_parser.ml lang/lang_lexer.ml \
260
lang/lang_pp.ml lang/lang.ml tools/start_stop.ml tools/ioRing.ml \
261
tools/icecast_utils.ml \
262
$(video_converters) $(audio_converters) $(ogg_demuxer) $(protocols) \
263
$(sources) $(conversions) $(outputs) $(operators) \
264
$(encoders) $(ogg_muxer) $(io) \
265
$(analyze) $(playlists) $(visualization) $(synth) $(decoders) \
266
shebang.ml $(builtins) main.ml \
267
$(if $(W_WINSVC),runner_service.ml,runner.ml)
269
include $(top_srcdir)/Makefile.rules
273
@echo " ERROR Missing src/configure.ml, Please run ./configure first!"
274
@if [ -f ../configure-with-options ] ; then \
275
echo " Note that you can source configure-with-options" ; \
276
echo " for running configure with the same options as last time." \
281
OCAML_CFLAGS= -thread $(patsubst %,-I %,$(SUBDIRS))
282
DEP_OPTS= $(patsubst %,-I %,$(SUBDIRS))
284
liquidsoap_doc_sources= \
285
source.ml clock.ml encoder/encoder.ml \
286
tools/plug.ml tools/http.ml \
287
decoder/decoder.ml request.ml outputs/output.ml \
288
lang/lang.ml lang/lang_types.ml lang/lang_values.ml \
289
tools/server.ml tools/tutils.ml playlist_parser.ml \
290
tools/doc.ml tools/wav.ml tools/ioRing.ml \
292
converters/audio_converter.ml converters/video_converter.ml \
293
ogg_formats/ogg_muxer.ml \
294
sources/generated.ml sources/request_source.ml sources/synthesized.ml \
295
operators/switch.ml \
297
stream/frame.ml stream/aFrame.ml \
298
stream/vFrame.ml stream/mFrame.ml stream/generator.ml
300
# Compute something like " (trunk/liquidsoap@rev1234)" when .svn is present,
301
SVN.ml: Makefile $(liquidsoap_sources:SVN.ml=)
302
if test -e ../.git && which git > /dev/null ; then \
303
url=`git remote -v | grep fetch | sed 's/origin[ \t]*//' | sed 's/[ \t]*(.*)//'` ; \
304
head=`git rev-parse HEAD` ; \
305
date=`date +%Y%m%d:%H%M%S`; \
306
echo "let rev = \" ($$url@$$head:$$date)\"" > SVN.ml ; \
307
elif test -d .svn && which svn > /dev/null ; then \
308
url=`LC_ALL=C svn info | grep URL | \
309
sed -e 's:.*svnroot/savonet/\(.*\)/src:\1:'`; \
310
revision=`LC_ALL=C svn info | grep Revision | \
311
sed -e 's/Revision: \(.*\)/\1/'` ; \
312
echo "let rev = \" ($$url@rev$$revision)\"" > SVN.ml ; \
313
elif test -d ../../.hg && which hg > /dev/null ; then \
314
branch=`hg branch`; \
315
revision=`LC_ALL=C hg parents | grep changeset: | \
316
sed -e 's/changeset: *['0'-'9']*:\([^ ]*\).*/\1/'`; \
317
date=`date +%Y%m%d:%H%M%S`; \
318
echo "let rev = \" ($$branch@$$revision:$$date)\"" > SVN.ml ; \
320
echo "let rev = \"\"" > SVN.ml ; \
327
$(INSTALL_DATA) plugins/$*.$(s) $(libdir)/liquidsoap/$(libs_dir_version)/plugins
330
$(eval INSTALL_PLUGINS+=install-plugin-$(1))
331
$(foreach plugin,$(liquidsoap_PLUGINS),$(call install_plugins,$(plugin)))
334
$(INSTALL_DIRECTORY) $(libdir)/liquidsoap/$(libs_dir_version)/plugins
336
install-local: all-auto install-plugin-dir $(INSTALL_PLUGINS)
337
$(INSTALL) -d $(bindir)
338
$(INSTALL_PROGRAM) liquidsoap $(bindir)
340
ifneq ($(NO_CUSTOM),)
341
$(OCAMLFIND) install liquidsoap META dllliquidsoap.so $(wildcard plugins/dll*.so)
343
$(OCAMLFIND) install liquidsoap META $(wildcard plugins/dll*.so)
347
# Dirty hack since ocamlcp does not play nicely with include
350
cd lang; ocamlc -c -I .. -I ../tools lang_values.ml