]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
build: Remove duplicates from $all_objs.
authorAndre Noll <maan@systemlinux.org>
Fri, 13 Sep 2013 03:13:38 +0000 (03:13 +0000)
committerAndre Noll <maan@systemlinux.org>
Sun, 1 Dec 2013 10:51:58 +0000 (11:51 +0100)
In Makefile.in $all_objs is defined as the concatenation of the
object lists of all executables. This variable is used to determine
the set of dependency files to include. Since the concatenation
contains common objects more than once, we currently include common
dependencies multiple times.

This is not a problem, but it may slow down the build. The make sort
function removes duplicate words, so by sorting $all_objs we make
sure to include each dependency file only once.

Makefile.in

index dae4976074585cd30f5a7306936a6a7e21a730ec..df61b2fb273b5a0ec37ffba9c60f99c1b3014a09 100644 (file)
@@ -227,9 +227,10 @@ $(dep_dir)/%.d: %.c | $(dep_dir)
        $(Q) ./depend.sh $(dep_dir) $(object_dir) $(cmdline_dir) \
                $(CPPFLAGS) $< > $@
 
        $(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@ \
        @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@))
 
 deps := $(addprefix $(dep_dir)/, $(all_objs:.o=.d))
 m4_deps := $(addprefix $(m4depdir)/, $(addsuffix .m4d, @executables@))