]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - Makefile.real
build: Rename all_objs -> dep_objs.
[paraslash.git] / Makefile.real
index b28619f19a3e65e4dc50d8c6d64d6d100f58e1c7..92a5724b3cc6543553dcaf8dbdf6385e4169e41e 100644 (file)
@@ -14,7 +14,6 @@ SEVERITIES := \"debug\",\"info\",\"notice\",\"warning\",\"error\",\"crit\",\"eme
 vardir := /var/paraslash
 mandir := $(datarootdir)/man/man1
 MKDIR_P := mkdir -p
-prefixed_executables := $(addprefix para_, $(executables))
 
 build_date := $(shell date)
 uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS")
@@ -38,8 +37,10 @@ test_dir := t
 yy_src_dir := yy
 yy_build_dir := $(build_dir)/yy
 
+executables := recv filter audioc write afh play
 ifneq ($(CRYPTOLIB),)
        ifeq ($(HAVE_OSL),yes)
+       executables += server upgrade_db
                server_objs := $(addsuffix .o, \
                        server afh_common mp3_afh vss command net string \
                        signal time daemon http_send close_on_fork \
@@ -76,6 +77,7 @@ ifneq ($(CRYPTOLIB),)
        endif
 endif
 ifneq ($(CRYPTOLIB),)
+       executables += client audiod
        client_objs := $(addsuffix .o, \
                client net string fd lsu sched stdin stdout time sideband client_common \
                buffer_tree crypt_common base64 version $(CRYPTOLIB) \
@@ -130,6 +132,7 @@ ifneq ($(CRYPTOLIB),)
        endif
 endif
 ifneq ($(HAVE_OSS)-$(HAVE_ALSA),no-no)
+       executables += mixer
        mixer_objs := $(addsuffix .o, mixer exec string fd time lsu version)
        ifeq ($(HAVE_OSS),yes)
                mixer_objs += oss_mix.o
@@ -138,13 +141,156 @@ ifneq ($(HAVE_OSS)-$(HAVE_ALSA),no-no)
                mixer_objs += alsa_mix.o
        endif
 endif
+ifeq ($(HAVE_CURSES),yes)
+       executables += gui
+       gui_objs := $(addsuffix .o, exec signal string stat ringbuffer fd \
+               gui gui_theme lsu time sched version)
+endif
+filter_objs := $(addsuffix .o, \
+       filter_common wav_filter compress_filter filter string stdin stdout \
+       sched fd amp_filter fecdec_filter fec lsu version prebuffer_filter \
+       time bitstream imdct wma_common wmadec_filter buffer_tree net \
+       sync_filter \
+)
+ifeq ($(NEED_VORBIS_OBJECTS),yes)
+       filter_objs += oggdec_filter.o
+endif
+ifeq ($(NEED_SPEEX_OBJECTS),yes)
+       filter_objs += spxdec_filter.o spx_common.o
+endif
+ifeq ($(NEED_OPUS_OBJECTS),yes)
+       filter_objs += opusdec_filter.o opus_common.o
+endif
+ifeq ($(NEED_FLAC_OBJECTS),yes)
+       filter_objs += flacdec_filter.o
+endif
+ifeq ($(HAVE_FAAD),yes)
+       filter_objs += aacdec_filter.o
+endif
+ifeq ($(HAVE_MAD),yes)
+       filter_objs += mp3dec_filter.o
+endif
+ifeq ($(HAVE_SAMPLERATE),yes)
+       filter_objs += resample_filter.o check_wav.o
+endif
+
+recv_objs := $(addsuffix .o, \
+       http_recv recv_common recv time string net dccp_recv fd sched stdout \
+       udp_recv buffer_tree afh_recv afh_common wma_afh wma_common mp3_afh \
+       version \
+)
+ifeq ($(NEED_OGG_OBJECTS),yes)
+       recv_objs += ogg_afh_common.o
+endif
+ifeq ($(NEED_VORBIS_OBJECTS),yes)
+       recv_objs += ogg_afh.o
+endif
+ifeq ($(NEED_SPEEX_OBJECTS),yes)
+       recv_objs += spx_afh.o spx_common.o
+endif
+ifeq ($(NEED_OPUS_OBJECTS),yes)
+       recv_objs += opus_afh.o opus_common.o
+endif
+ifeq ($(NEED_FLAC_OBJECTS),yes)
+       recv_objs += flac_afh.o
+endif
+ifeq ($(HAVE_FAAD),yes)
+       recv_objs += aac_afh.o mp4.o
+endif
+
+audio_format_handlers := mp3 wma
+afh_objs := $(addsuffix .o, afh string fd mp3_afh afh_common time wma_afh \
+       wma_common version)
+ifeq ($(NEED_OGG_OBJECTS),yes)
+       afh_objs += ogg_afh_common.o
+endif
+ifeq ($(NEED_VORBIS_OBJECTS),yes)
+       afh_objs += ogg_afh.o
+       audio_format_handlers += ogg
+endif
+ifeq ($(NEED_SPEEX_OBJECTS),yes)
+       afh_objs += spx_common.o
+       audio_format_handlers += spx
+endif
+ifeq ($(NEED_OPUS_OBJECTS),yes)
+       afh_objs += opus_afh.o opus_common.o
+       audio_format_handlers += opus
+endif
+ifeq ($(NEED_FLAC_OBJECTS),yes)
+       afh_objs += flac_afh.o
+       audio_format_handlers += flac
+endif
+ifeq ($(HAVE_FAAD),yes)
+       afh_objs += aac_afh.o mp4.o
+       audio_format_handlers += aac
+endif
+
+play_objs := $(addsuffix .o, \
+       play fd sched buffer_tree time string net afh_recv afh_common \
+       wma_afh wma_common mp3_afh recv_common udp_recv http_recv dccp_recv \
+       filter_common fec bitstream imdct wav_filter compress_filter \
+       amp_filter prebuffer_filter fecdec_filter wmadec_filter write_common \
+       file_write version sync_filter lsu \
+)
+ifeq ($(NEED_OGG_OBJECTS),yes)
+       play_objs += ogg_afh_common.o
+endif
+ifeq ($(NEED_VORBIS_OBJECTS),yes)
+       play_objs += oggdec_filter.o ogg_afh.o
+endif
+ifeq ($(NEED_SPEEX_OBJECTS),yes)
+       play_objs += spxdec_filter.o spx_afh.o spx_common.o
+endif
+ifeq ($(NEED_OPUS_OBJECTS),yes)
+       play_objs += opusdec_filter.o opus_afh.o opus_common.o
+endif
+ifeq ($(NEED_FLAC_OBJECTS),yes)
+       play_objs += flacdec_filter.o flac_afh.o
+endif
+ifeq ($(HAVE_FAAD),yes)
+       play_objs += aac_afh.o aacdec_filter.o mp4.o
+endif
+ifeq ($(HAVE_MAD),yes)
+       play_objs += mp3dec_filter.o
+endif
+ifeq ($(HAVE_OSS),yes)
+       play_objs += oss_write.o
+endif
+ifeq ($(HAVE_ALSA),yes)
+       play_objs += alsa_write.o
+endif
+ifeq ($(NEED_AO_OBJECTS),yes)
+       play_objs += ao_write.o
+endif
+ifeq ($(HAVE_READLINE),yes)
+       play_objs += interactive.o
+endif
+ifeq ($(HAVE_SAMPLERATE),yes)
+       play_objs += resample_filter.o check_wav.o
+endif
+
+write_objs := $(addsuffix .o, write write_common file_write time fd \
+       string sched stdin buffer_tree check_wav version)
+ifeq ($(NEED_AO_OBJECTS),yes)
+       write_objs += ao_write.o
+endif
+ifeq ($(HAVE_OSS),yes)
+       write_objs += oss_write.o
+endif
+ifeq ($(HAVE_ALSA),yes)
+       write_objs += alsa_write.o
+endif
+
+audioc_objs := $(addsuffix .o, audioc string lsu net fd time version)
+ifeq ($(HAVE_READLINE),yes)
+       audioc_objs += buffer_tree.o interactive.o sched.o
+endif
 
 # sort removes duplicate words, which is all we need here
-all_objs := $(sort $(recv_objs) $(filter_objs) $(client_objs) $(gui_objs) \
+dep_objs := $(sort $(recv_objs) $(filter_objs) $(client_objs) $(gui_objs) \
        $(audiod_objs) $(audioc_objs) $(mixer_objs) $(server_objs) \
-       $(write_objs) $(afh_objs) $(play_objs))
-deps := $(addprefix $(dep_dir)/, $(all_objs:.o=.d))
-deps += $(addprefix $(dep_dir)/, mp.bison.d mp.flex.d)
+       $(write_objs) $(afh_objs) $(play_objs) mp.bison mp.flex)
+deps := $(addprefix $(dep_dir)/, $(dep_objs:.o=.d))
 
 afh_objs += afh.lsg.o
 audioc_objs += audioc.lsg.o
@@ -185,6 +331,7 @@ write_objs := $(addprefix $(object_dir)/, $(write_objs))
 afh_objs := $(addprefix $(object_dir)/, $(afh_objs))
 play_objs := $(addprefix $(object_dir)/, $(play_objs))
 
+prefixed_executables := $(addprefix para_, $(executables))
 man_pages := $(patsubst %, $(man_dir)/%.1, $(prefixed_executables))
 
 autocrap := config.h.in configure
@@ -303,6 +450,8 @@ OD = $(addsuffix .d, $(addprefix $(dep_dir)/, $(1))) \
 
 $(call OD, audiod): \
        CPPFLAGS += -DAUDIOD_AUDIO_FORMAT_ARRAY='$(audiod_audio_formats)'
+$(call OD, afh command): \
+       CPPFLAGS += -DAUDIO_FORMAT_HANDLERS='"$(audio_format_handlers)"'
 $(call OD, opus%): CPPFLAGS += $(opus_cppflags)
 $(call OD, gui gui%): CPPFLAGS += $(curses_cppflags)
 $(call OD, spx%): CPPFLAGS += $(speex_cppflags)