build: Add Make variable for clock_gettime_ldflags.
[paraslash.git] / Makefile.in
index 855b66937054186ca85ba1c0805daf58b43d80be..a976dc973e988bbbdc977206ada0a3787c98dbfc 100644 (file)
@@ -4,6 +4,7 @@ exec_prefix := @exec_prefix@
 BINDIR := @bindir@
 VARDIR := /var/paraslash
 MANDIR := @datarootdir@/man/man1
+PACKAGE_TARNAME := @PACKAGE_TARNAME@
 PACKAGE_VERSION := @PACKAGE_VERSION@
 INSTALL := @install@
 STRIP := $(CROSS_COMPILE)strip
@@ -17,6 +18,18 @@ GENGETOPT := @gengetopt@
 HELP2MAN := @help2man@
 MKDIR_P := mkdir -p
 
+recv_objs := @recv_objs@
+filter_objs := @filter_objs@
+client_objs := @client_objs@
+gui_objs := @gui_objs@
+audiod_objs := @audiod_objs@
+audioc_objs := @audioc_objs@
+fade_objs := @fade_objs@
+server_objs := @server_objs@
+write_objs := @write_objs@
+afh_objs := @afh_objs@
+play_objs := @play_objs@
+
 speex_cppflags := @speex_cppflags@
 opus_cppflags := @opus_cppflags@
 arch_cppflags := @arch_cppflags@
@@ -29,6 +42,7 @@ faad_cppflags := @faad_cppflags@
 curses_cppflags := @curses_cppflags@
 ao_cppflags := @ao_cppflags@
 
+clock_gettime_ldflags := @clock_gettime_ldflags@
 id3tag_ldflags := @id3tag_ldflags@
 ogg_ldflags := @ogg_ldflags@
 vorbis_ldflags := @vorbis_ldflags@
@@ -75,6 +89,27 @@ m4depdir := $(build_dir)/m4deps
 help2man_dir := $(build_dir)/help2man
 hostbin_dir := $(build_dir)/host/bin
 
+# 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))
+deps := $(addprefix $(dep_dir)/, $(all_objs:.o=.d))
+m4_deps := $(addprefix $(m4depdir)/, $(addsuffix .m4d, $(executables)))
+
+# now prefix all objects with object dir
+recv_objs := $(addprefix $(object_dir)/, $(recv_objs))
+filter_objs := $(addprefix $(object_dir)/, $(filter_objs))
+client_objs := $(addprefix $(object_dir)/, $(client_objs))
+gui_objs := $(addprefix $(object_dir)/, $(gui_objs))
+audiod_objs := $(addprefix $(object_dir)/, $(audiod_objs))
+audioc_objs := $(addprefix $(object_dir)/, $(audioc_objs))
+fade_objs := $(addprefix $(object_dir)/, $(fade_objs))
+server_objs := $(addprefix $(object_dir)/, $(server_objs))
+write_objs := $(addprefix $(object_dir)/, $(write_objs))
+afh_objs := $(addprefix $(object_dir)/, $(afh_objs))
+play_objs := $(addprefix $(object_dir)/, $(play_objs))
+
+
 DEBUG_CPPFLAGS += -g -Wunused -Wundef -W
 DEBUG_CPPFLAGS += -Wredundant-decls
 DEBUG_CPPFLAGS += -Wall -Wno-sign-compare -Wno-unknown-pragmas
@@ -106,15 +141,15 @@ CPPFLAGS += -I/usr/local/include
 CPPFLAGS += -I$(cmdline_dir)
 CPPFLAGS += $(osl_cppflags)
 
-LDFLAGS += @clock_gettime_ldflags@
+LDFLAGS += $(clock_gettime_ldflags)
 
 man_pages := $(patsubst %, $(man_dir)/%.1, $(prefixed_executables))
 
 autocrap := config.h.in configure
-tarball_pfx := @PACKAGE_TARNAME@-$(PACKAGE_VERSION)
+tarball_pfx := $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
 tarball_delete := $(addprefix $(tarball_pfx)/,\
        web .changelog_before_cvs .changelog_cvs .gitignore)
-tarball := @PACKAGE_TARNAME@-$(PACKAGE_VERSION).tar.bz2
+tarball := $(tarball_pfx).tar.bz2
 
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
@@ -232,25 +267,6 @@ $(dep_dir)/%.d: %.c | $(dep_dir)
        $(Q) ./depend.sh $(dep_dir) $(object_dir) $(cmdline_dir) \
                $(CPPFLAGS) $< > $@
 
-# 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@)
-deps := $(addprefix $(dep_dir)/, $(all_objs:.o=.d))
-m4_deps := $(addprefix $(m4depdir)/, $(addsuffix .m4d, $(executables)))
-
-recv_objs := $(addprefix $(object_dir)/, @recv_objs@)
-filter_objs := $(addprefix $(object_dir)/, @filter_objs@)
-client_objs := $(addprefix $(object_dir)/, @client_objs@)
-gui_objs := $(addprefix $(object_dir)/, @gui_objs@)
-audiod_objs := $(addprefix $(object_dir)/, @audiod_objs@)
-audioc_objs := $(addprefix $(object_dir)/, @audioc_objs@)
-fade_objs := $(addprefix $(object_dir)/, @fade_objs@)
-server_objs := $(addprefix $(object_dir)/, @server_objs@)
-write_objs := $(addprefix $(object_dir)/, @write_objs@)
-afh_objs := $(addprefix $(object_dir)/, @afh_objs@)
-play_objs := $(addprefix $(object_dir)/, @play_objs@)
-
 ifeq ($(findstring clean, $(MAKECMDGOALS)),)
 -include $(deps)
 -include $(m4_deps)