Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 362 lines (301 sloc) 15.163 kb
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

SUBDIRS= tools decoder playlists encoder protocols plugins stream lang \
ogg_formats converters converters/audio converters/video \
operators sources conversions outputs io visualization analyze synth

DISTFILES = $(wildcard *.mli) Makefile $(wildcard *.ml) META.in

ocaml_progs= liquidsoap

top_srcdir=..
include $(top_srcdir)/Makefile.defs

# Liquidsoap source files work as follows.
# Each file has to be either added to liquidsoap's files if compiled builtin
# or to the corresponding plugin if built as a plugin.
# For this purpose, we define the make function
# conditional_compilation, which redirects each of those files to
# the correct make variable. Its parameters are:
# $1: name of the make variable where the file should go if compiled builtin.
# $2: the $W_FOO variable
# $3: path to the file
# $4: type of source: empty for .ml sources,
# c_ for c sources and camlp4_ for camlp4 sources.
# (Camlp4 sources are not supported yet..)
#
# For now, the old style Makefile has been converted to
# this new style by replacing $(if $(W_FOO),..) by
# $(call conditional_compilation,..). However, this may
# cause some trouble as the order of declaration is important
# both for the builtin case and plugin case.. See for instance
# SDL files, whose declaration have been moved at the end.
conditional_compilation = \
  $(if $(2),\
    $(if $(2:yes=),\
      $(eval $(2)_$(4)sources += $(3)),\
      $(eval $(1) += $(3))))

liquidsoap_c_files = \
tools/locale_c.c

# Add conditional files..
$(call conditional_compilation,liquidsoap_c_files,$(W_OSS),io/oss_io_c.c,c_)

# Camlp4 compilation works as follow:
# both .camlp4 and .ml files are present in the
# source tree.
# If camlp4o is detected, then a .camlp4.ml target
# is executed for each .camlp4. This target creates a .camlp4.ml
# file that is not used and regenerate the .ml files used for compilation.
liquidsoap_camlp4_files = \
$(if $(W_DUPPY_SYNTAX),outputs/harbor_output.camlp4) \
$(if $(W_DUPPY_SYNTAX),tools/server.camlp4) \
$(if $(W_DUPPY_SYNTAX),tools/harbor.camlp4)

# This variable contains only conditional files..
ogg_demuxer =

$(call conditional_compilation,ogg_demuxer,$(W_SPEEX),ogg_formats/speex_decoder.ml)
$(call conditional_compilation,ogg_demuxer,$(W_VORBIS),ogg_formats/vorbis_decoder.ml)
$(call conditional_compilation,ogg_demuxer,$(W_OPUS),ogg_formats/opus_decoder.ml)
$(call conditional_compilation,ogg_demuxer,$(W_THEORA),ogg_formats/theora_decoder.ml)
$(call conditional_compilation,ogg_demuxer,$(W_FLAC_OGG),ogg_formats/ogg_flac_decoder.ml)
$(call conditional_compilation,ogg_demuxer,$(W_SCHROEDINGER),ogg_formats/dirac_decoder.ml)

# This variable contains only conditional files..
ogg_muxer =

$(call conditional_compilation,ogg_muxer,$(W_OGG),ogg_formats/ogg_muxer.ml)
$(call conditional_compilation,ogg_muxer,$(W_OGG), encoder/ogg_encoder.ml)
$(call conditional_compilation,ogg_muxer,$(W_SPEEX),ogg_formats/speex_encoder.ml)
$(call conditional_compilation,ogg_muxer,$(W_VORBIS),ogg_formats/vorbis_encoder.ml)
$(call conditional_compilation,ogg_muxer,$(W_OPUS),ogg_formats/opus_encoder.ml)
$(call conditional_compilation,ogg_muxer,$(W_THEORA),ogg_formats/theora_encoder.ml)
$(call conditional_compilation,ogg_muxer,$(W_FLAC_OGG),ogg_formats/ogg_flac_encoder.ml)
$(call conditional_compilation,ogg_muxer,$(W_SCHROEDINGER),ogg_formats/dirac_encoder.ml)

audio_converters = \
converters/audio/native_audio_converter.ml

$(call conditional_compilation,audio_converters,$(W_SAMPLERATE),converters/audio/libsamplerate_converter.ml)

video_converters = \
converters/video_converter.ml \
converters/video/native_video_converter.ml

$(call conditional_compilation,video_converters,$(W_GAVL),converters/video/gavl_converter.ml)
$(call conditional_compilation,video_converters,$(W_FFMPEG),converters/video/ffmpeg_video_converter.ml)

decoders = \
decoder/metadata_decoder.ml \
decoder/wav_decoder.ml decoder/midi_decoder.ml \
$(if ($(OS_TYPE):Win32=),decoder/external_decoder.ml)

$(call conditional_compilation,decoders,$(W_FLAC),decoder/flac_decoder.ml)
$(call conditional_compilation,decoders,$(W_FAAD),decoder/aac_decoder.ml)
$(call conditional_compilation,decoders,$(W_OGG),decoder/ogg_decoder.ml)
$(call conditional_compilation,decoders,$(W_MAD),decoder/mad_decoder.ml)
$(call conditional_compilation,decoders,$(W_VORBIS),decoder/vorbisduration.ml)
$(call conditional_compilation,decoders,$(W_FLAC),decoder/flacduration.ml)
$(call conditional_compilation,decoders,$(W_FLAC_OGG),decoder/ogg_flac_duration.ml)
$(call conditional_compilation,decoders,$(W_TAGLIB),decoder/taglib_plug.ml)

playlists = \
playlists/playlist_basic.ml

$(call conditional_compilation,playlists,$(W_XMLPLAYLIST),playlists/playlist_xml.ml)

protocols = \
$(if ($(OS_TYPE):Win32=),protocols/say.ml) \
protocols/annotate.ml \
protocols/mpd.ml \
$(if ($(OS_TYPE):Win32=),protocols/extproto.ml)

sources = \
sources/synthesized.ml sources/noise.ml sources/blank.ml \
sources/audio_gen.ml sources/request_source.ml \
sources/req_simple.ml sources/playlist.ml \
sources/req_queue.ml sources/req_equeue.ml \
sources/generated.ml sources/http_source.ml \
tools/harbor.ml sources/harbor_input.ml \
$(if ($(OS_TYPE):Win32=),sources/external_input.ml) \
tools/liqMM.ml

$(call conditional_compilation,sources,$(W_BJACK),sources/bjack_in.ml)

operators = \
operators/insert_metadata.ml operators/map_metadata.ml \
operators/on_metadata.ml operators/store_metadata.ml \
operators/on_track.ml operators/on_end.ml operators/delay.ml \
operators/switch.ml operators/fade.ml operators/add.ml \
operators/sequence.ml operators/cross.ml operators/smartcross.ml \
operators/compress_exp.ml operators/pitch.ml \
operators/fir_filter.ml operators/iir_filter.ml \
operators/biquad_filter.ml operators/cuepoint.ml \
operators/map_op.ml operators/flanger.ml operators/comb.ml \
operators/compress.ml operators/clip.ml operators/filter.ml \
operators/setvol.ml operators/normalize.ml operators/echo.ml \
operators/append.ml operators/pan.ml operators/ms_stereo.ml \
operators/dyn_op.ml operators/video_effects.ml operators/video_fade.ml \
operators/noblank.ml operators/compand.ml \
operators/mixing_table.ml operators/prepend.ml \
operators/midi_routing.ml \
operators/time_warp.ml operators/resample.ml \
operators/video_image.ml operators/chord.ml \
operators/video_text.ml

$(call conditional_compilation,operators,$(W_SOUNDTOUCH),operators/soundtouch_op.ml)
$(call conditional_compilation,operators,$(W_SOUNDTOUCH),operators/st_bpm.ml)
$(call conditional_compilation,operators,$(W_LADSPA),operators/ladspa_op.ml)
$(call conditional_compilation,operators,$(W_FREI0R),operators/frei0r_op.ml)

conversions = \
conversions/audio_to_stereo.ml conversions/drop.ml conversions/id.ml \
conversions/swap.ml conversions/mean.ml conversions/mux.ml

analyze = analyze/analyze_rms.ml

encoders = \
encoder/wav_encoder.ml \
encoder/lame_encoder.ml \
encoder/aacplus_encoder.ml \
$(if ($(OS_TYPE):Win32=),encoder/external_encoder.ml) \
$(if $(W_LAME_DYN),encoder/lame_encoder_dynlink.ml) \
$(if $(W_AACPLUS_DYN),encoder/aacplus_encoder_dynlink.ml)

$(call conditional_compilation,encoders,$(W_SHINE),encoder/shine_encoder.ml)
$(call conditional_compilation,encoders,$(W_LAME),encoder/lame_encoder_builtin.ml)
$(call conditional_compilation,encoders,$(W_FLAC),encoder/flac_encoder.ml)
$(call conditional_compilation,encoders,$(W_AACPLUS),encoder/aacplus_encoder_builtin.ml)
$(call conditional_compilation,encoders,$(W_VOAACENC),encoder/voaacenc_encoder.ml)
$(call conditional_compilation,encoders,$(W_TAGLIB),encoder/taglib_id3v2.ml)

outputs = outputs/output.ml \
outputs/pipe_output.ml \
outputs/harbor_output.ml

$(call conditional_compilation,outputs,$(W_AO),outputs/ao_out.ml)
$(call conditional_compilation,outputs,$(W_CRY),outputs/icecast2.ml)
$(call conditional_compilation,outputs,$(W_GRAPHICS),outputs/graphics_out.ml)
$(call conditional_compilation,outputs,$(W_BJACK),outputs/bjack_out.ml)

io = io/udp_io.ml

$(call conditional_compilation,io,$(W_OSS),io/oss_io.ml)
$(call conditional_compilation,io,$(W_PULSEAUDIO),io/pulseaudio_io.ml)
$(call conditional_compilation,io,$(W_PORTAUDIO),io/portaudio_io.ml)

tools = tools/stdlib.ml tools/doc.ml tools/plug.ml tools/utils.ml \
$(if $(W_DYNLINK),tools/dyntools.ml) \
tools/rqueue.ml \
$(if $(W_LAME_DYN),tools/lame_dynlink.ml) \
$(if $(W_AACPLUS_DYN),tools/aacplus_dynlink.ml) \
tools/wav.ml configure.ml \
tools/tutils.ml tools/http.ml tools/pool.ml

stream =stream/frame.ml stream/generator.ml \
stream/aFrame.ml stream/vFrame.ml stream/mFrame.ml

visualization = visualization/vumeter.ml \
visualization/midimeter.ml \
visualization/video_volume.ml

$(call conditional_compilation,visualization,$(W_GRAPHICS),visualization/vis_volume.ml)

synth = synth/keyboard.ml synth/synth_op.ml

$(call conditional_compilation,synth,$(W_DSSI),synth/dssi_op.ml)

builtins = lang/lang_builtins.ml \
$(if $(W_YOJSON),lang/builtins_json.ml)

$(call conditional_compilation,builtins,$(W_LO),lang/builtins_lo.ml)
$(call conditional_compilation,builtins,$(W_MAGIC),lang/builtins_magic.ml)
$(call conditional_compilation,builtins,$(W_CRY),lang/builtins_cry.ml)

liquidsoap_sources= $(tools) SVN.ml converters/audio_converter.ml $(stream) \
decoder/decoder.ml request.ml tools/server.ml \
        source.ml clock.ml tools/rutils.ml \
playlist_parser.ml encoder/encoder.ml \
tools/server_builtins.ml

# Some for camlimages
$(call conditional_compilation,decoders,$(W_CAMLIMAGES),decoder/camlimages_decoder.ml)

# Include SDL now. Order matters so we group them all here..
$(call conditional_compilation,liquidsoap_sources,$(W_SDL),tools/sdl_utils.ml)
$(call conditional_compilation,synth,$(W_SDL),synth/keyboard_sdl.ml)
$(call conditional_compilation,decoders,$(W_SDL),decoder/sdlimage_decoder.ml)
$(call conditional_compilation,operators,$(W_SDL),operators/video_text_sdl.ml)
$(call conditional_compilation,outputs,$(W_SDL),outputs/sdl_out.ml)

# Same for lastfm..
$(call conditional_compilation,liquidsoap_sources,$(W_LASTFM),tools/liqfm.ml)
$(call conditional_compilation,protocols,$(W_LASTFM),protocols/lastfm_req.ml)
$(call conditional_compilation,sources,$(W_LASTFM),sources/lastfm_input.ml)
$(call conditional_compilation,builtins,$(W_LASTFM),lang/builtins_lastfm.ml)

# Same for alsa..
$(call conditional_compilation,liquidsoap_sources,$(W_ALSA), alsa_settings.ml)
$(call conditional_compilation,sources,$(W_ALSA),sources/alsa_in.ml)
$(call conditional_compilation,outputs,$(W_ALSA),outputs/alsa_out.ml)
$(call conditional_compilation,io,$(W_ALSA),io/alsa_io.ml)

# Same for GD..
$(call conditional_compilation,operators,$(W_GD),operators/video_text_gd.ml)

# GStreamer
$(call conditional_compilation,stream,$(W_GSTREAMER),tools/gstreamer_utils.ml)
$(call conditional_compilation,decoders,$(W_GSTREAMER),decoder/gstreamer_decoder.ml)
$(call conditional_compilation,encoders,$(W_GSTREAMER),encoder/gstreamer_encoder.ml)
$(call conditional_compilation,operators,$(W_GSTREAMER),operators/video_text_gstreamer.ml)
$(call conditional_compilation,io,$(W_GSTREAMER),io/gstreamer_io.ml)

liquidsoap_sources += \
lang/lang_types.ml lang/lang_values.ml \
lang/lang_encoders.ml lang/lang_parser.ml lang/lang_lexer.ml \
lang/lang_pp.ml lang/lang.ml tools/start_stop.ml tools/ioRing.ml \
tools/icecast_utils.ml \
$(video_converters) $(audio_converters) $(ogg_demuxer) $(protocols) \
$(sources) $(conversions) $(outputs) $(operators) \
$(encoders) $(ogg_muxer) $(io) \
$(analyze) $(playlists) $(visualization) $(synth) $(decoders) \
shebang.ml $(builtins) main.ml

include $(top_srcdir)/Makefile.rules

configure.ml:
@echo
@echo " ERROR Missing src/configure.ml, Please run ./configure first!"
@if [ -f ../configure-with-options ] ; then \
echo " Note that you can source configure-with-options" ; \
echo " for running configure with the same options as last time." \
; fi
@echo
@exit 1

OCAML_CFLAGS= -thread $(patsubst %,-I %,$(SUBDIRS))
DEP_OPTS= $(patsubst %,-I %,$(SUBDIRS))

liquidsoap_doc_sources= \
source.ml clock.ml encoder/encoder.ml \
tools/plug.ml tools/http.ml \
decoder/decoder.ml request.ml outputs/output.ml \
lang/lang.ml tools/server.ml \
tools/tutils.ml playlist_parser.ml \
tools/doc.ml tools/wav.ml \
sources/request_source.ml operators/switch.ml \
configure.ml video_converter.ml \
stream/frame.ml stream/aFrame.ml \
stream/vFrame.ml audio_converter.ml \
stream/mFrame.ml stream/generator.ml

# Compute something like " (trunk/liquidsoap@rev1234)" when .svn is present,
SVN.ml: Makefile $(liquidsoap_sources:SVN.ml=)
if test -d .svn && which svn > /dev/null ; then \
url=`LC_ALL=C svn info | grep URL | \
sed -e 's:.*svnroot/savonet/\(.*\)/src:\1:'`; \
revision=`LC_ALL=C svn info | grep Revision | \
sed -e 's/Revision: \(.*\)/\1/'` ; \
echo "let rev = \" ($$url@rev$$revision)\"" > SVN.ml ; \
elif test -d ../../.hg && which hg > /dev/null ; then \
branch=`hg branch`; \
revision=`LC_ALL=C hg parents | grep changeset: | \
sed -e 's/changeset: *['0'-'9']*:\([^ ]*\).*/\1/'`; \
          date=`date +%Y%m%d:%H%M%S`; \
echo "let rev = \" ($$branch@$$revision:$$date)\"" > SVN.ml ; \
elif test -e ../.git && which git > /dev/null ; then \
url=`git remote -v | grep fetch | sed 's/origin[ \t]*//' | sed 's/[ \t]*(.*)//'` ; \
head=`git rev-parse HEAD` ; \
          date=`date +%Y%m%d:%H%M%S`; \
echo "let rev = \" ($$url@$$head:$$date)\"" > SVN.ml ; \
else \
echo "let rev = \"\"" > SVN.ml ; \
fi

clean-local:
rm -f SVN.ml

install-plugin-%:
$(INSTALL_DATA) plugins/$*.$(s) $(libdir)/liquidsoap/$(libs_dir_version)/plugins

install_plugins=\
$(eval INSTALL_PLUGINS+=install-plugin-$(1))
$(foreach plugin,$(liquidsoap_PLUGINS),$(call install_plugins,$(plugin)))

install-plugin-dir:
$(INSTALL_DIRECTORY) $(libdir)/liquidsoap/$(libs_dir_version)/plugins

install-local: all-auto install-plugin-dir $(INSTALL_PLUGINS)
$(INSTALL) -d $(bindir)
$(INSTALL_PROGRAM) liquidsoap $(bindir)
ifneq ($(BYTE),)
ifneq ($(NO_CUSTOM),)
$(OCAMLFIND) install liquidsoap META dllliquidsoap.so $(wildcard plugins/dll*.so)
else
$(OCAMLFIND) install liquidsoap META $(wildcard plugins/dll*.so)
endif
endif

# Dirty hack since ocamlcp does not play nicely with include
profile:
-$(MAKE)
cd lang; ocamlc -c -I .. -I ../tools lang_values.ml
$(MAKE)

libliq_sources= $(tools) SVN.ml audio_converter.ml $(stream) \
shebang.ml alsa_settings.ml \
tools/server.ml tools/server_builtins.ml \
lang/lang_types.ml lang/lang_values.ml \
lang/lang_encoders.ml lang/lang_parser.ml lang/lang_lexer.ml \
lang/lang_pp.ml lang/lang.ml \
$(liquidsoap_c_files) \
$(if $(W_SDL),tools/sdl_utils.ml) \
$(video_converters) $(audio_converters) \
$(ogg_utils) $(protocols) $(sources) $(operators) $(outputs) $(io) \
$(analyze) $(playlists) $(decoders) \
lang/lang_builtins.ml
libliq_objects=$(libliq_sources:.ml=.$(o))
liquidsoap.$(a): $(libliq_objects:.c=.o) Makefile
ocamlmklib $(OCAML_CFLAGS:-threads:) -linkall $(OCAML_LFLAGS) \
-o liquidsoap \
$(libliq_objects:.c=.o)
Something went wrong with that request. Please try again.