]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - Makefile.real
build: Construct audiod and client object list in Makefile.
[paraslash.git] / Makefile.real
index 0ba0feaca572f2937bae45624d72d4da577d6fa8..a261fa6f8aaff0d1580709f579cd29985b76b07e 100644 (file)
@@ -75,6 +75,60 @@ ifneq ($(CRYPTOLIB),)
                        upgrade_db version base64)
        endif
 endif
+ifneq ($(CRYPTOLIB),)
+       client_objs := $(addsuffix .o, \
+               client net string fd lsu sched stdin stdout time sideband client_common \
+               buffer_tree crypt_common base64 version $(CRYPTOLIB) \
+       )
+       ifeq ($(HAVE_READLINE),yes)
+               client_objs += interactive.o
+       endif
+       audiod_objs := $(addsuffix .o, \
+               audiod signal string daemon stat net crypt_common base64 sideband \
+               time grab_client filter_common wav_filter compress_filter amp_filter \
+               http_recv dccp_recv recv_common fd sched write_common file_write \
+               audiod_command fecdec_filter client_common udp_recv color fec \
+               prebuffer_filter version bitstream imdct wma_common wmadec_filter \
+               buffer_tree sync_filter lsu $(CRYPTOLIB) \
+       )
+       audiod_audio_formats := "wma"
+       ifeq ($(NEED_VORBIS_OBJECTS),yes)
+               audiod_objs += oggdec_filter.o
+               audiod_audio_formats += ,"ogg"
+       endif
+       ifeq ($(NEED_SPEEX_OBJECTS),yes)
+               audiod_objs += spxdec_filter.o spx_common.o
+               audiod_audio_formats += ,"spx"
+       endif
+       ifeq ($(NEED_OPUS_OBJECTS),yes)
+               audiod_objs += opusdec_filter.o opus_common.o
+               audiod_audio_formats += ,"opus"
+       endif
+       ifeq ($(NEED_FLAC_OBJECTS),yes)
+               audiod_objs += flacdec_filter.o
+               audiod_audio_formats += ,"flac"
+       endif
+       ifeq ($(HAVE_FAAD),yes)
+               audiod_objs += aacdec_filter.o
+               audiod_audio_formats += ,"aac"
+       endif
+       ifeq ($(HAVE_MAD),yes)
+               audiod_objs += mp3dec_filter.o
+               audiod_audio_formats += ,"mp3"
+       endif
+       ifeq ($(HAVE_OSS),yes)
+               audiod_objs += oss_write.o
+       endif
+       ifeq ($(HAVE_ALSA),yes)
+               audiod_objs += alsa_write.o
+       endif
+       ifeq ($(NEED_AO_OBJECTS),yes)
+               audiod_objs += ao_write.o
+       endif
+       ifeq ($(HAVE_SAMPLERATE),yes)
+               audiod_objs += resample_filter.o check_wav.o
+       endif
+endif
 
 # sort removes duplicate words, which is all we need here
 all_objs := $(sort $(recv_objs) $(filter_objs) $(client_objs) $(gui_objs) \
@@ -238,6 +292,8 @@ $(object_dir)/%.o: %.c | $(object_dir)
 OD = $(addsuffix .d, $(addprefix $(dep_dir)/, $(1))) \
        $(addsuffix .o, $(addprefix $(object_dir)/, $(1)))
 
+$(call OD, audiod): \
+       CPPFLAGS += -DAUDIOD_AUDIO_FORMAT_ARRAY='$(audiod_audio_formats)'
 $(call OD, opus%): CPPFLAGS += $(opus_cppflags)
 $(call OD, gui gui%): CPPFLAGS += $(curses_cppflags)
 $(call OD, spx%): CPPFLAGS += $(speex_cppflags)