HELP2MAN := @help2man@
MKDIR_P := mkdir -p
+id3tag_ldflags := @id3tag_ldflags@
+ogg_ldflags := @ogg_ldflags@
+
build_date := $(shell date)
uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS")
uname_rs := $(shell uname -rs)
DEBUG_CPPFLAGS += -Wall -Wno-sign-compare -Wno-unknown-pragmas
DEBUG_CPPFLAGS += -Wformat-security
DEBUG_CPPFLAGS += -Wmissing-format-attribute
-# produces false positives
-# DEBUG_CPPFLAGS += -Wunreachable-code
-# DEBUG_CPPFLAGS += -Wwrite-strings
-
-# invalid option for gcc-3.3.3
-# DEBUG_CPPFLAGS += -Wextra
-# DEBUG_CPPFLAGS += -Wold-style-definition
-# DEBUG_CPPFLAGS += -Wdeclaration-after-statement
-# DEBUG_CPPFLAGS += -Wsuggest-attribute=const
-
-# many warnings about trivial stuff
-# CPPFLAGS += -Wconversion
ifeq ($(uname_s),Linux)
CPPFLAGS += -fdata-sections -ffunction-sections
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+
+$(object_dir)/mp3_afh.o: CPPFLAGS += @id3tag_cppflags@
$(object_dir)/mp3_afh.o: mp3_afh.c | $(object_dir)
- @[ -z "$(Q)" ] || echo 'CC $<'
- $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @id3tag_cppflags@ $<
$(object_dir)/gui%.o: gui%.c | $(object_dir)
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) ./depend.sh $(dep_dir) $(object_dir) $(cmdline_dir) \
$(CPPFLAGS) $< > $@
-all_objs := @recv_objs@ @filter_objs@ @client_objs@ @gui_objs@ \
+# sort removes duplicate words, which is all we need here
+all_objs := $(sort @recv_objs@ @filter_objs@ @client_objs@ @gui_objs@ \
@audiod_objs@ @audioc_objs@ @fade_objs@ @server_objs@ \
- @write_objs@ @afh_objs@ @play_objs@
+ @write_objs@ @afh_objs@ @play_objs@)
deps := $(addprefix $(dep_dir)/, $(all_objs:.o=.d))
m4_deps := $(addprefix $(m4depdir)/, $(addsuffix .m4d, @executables@))
-include $(m4_deps)
endif
+para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags)
+
+para_server \
+para_filter \
+para_audiod \
+para_play \
+para_afh \
+para_recv \
+: LDFLAGS += $(ogg_ldflags)
+
para_recv: $(recv_objs)
@[ -z "$(Q)" ] || echo 'LD $@'
$(Q) $(CC) $(recv_objs) -o $@ @recv_ldflags@ $(LDFLAGS)