This allows targets to include special objects when linking
executables without including them in (shared) libraries.
Signed-off-by: Mans Rullgard <mans@mansr.com>
PROGS-$(CONFIG_AVSERVER) += avserver
PROGS := $(PROGS-yes:%=%$(EXESUF))
PROGS-$(CONFIG_AVSERVER) += avserver
PROGS := $(PROGS-yes:%=%$(EXESUF))
+OBJS = cmdutils.o $(EXEOBJS)
OBJS-avconv = avconv_opt.o avconv_filter.o
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
OBJS-avconv = avconv_opt.o avconv_filter.o
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
-$(TOOLS): %$(EXESUF): %.o
- $(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)
+$(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
+ $(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS)
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
define DOPROG
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
define DOPROG
-OBJS-$(1) += $(1).o cmdutils.o
+OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS)
$(1)$(EXESUF): $$(OBJS-$(1))
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
$(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
$(1)$(EXESUF): $$(OBJS-$(1))
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
$(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
COMPAT_OBJS=$compat_objs
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
COMPAT_OBJS=$compat_objs
INSTALL=install
LIBTARGET=${LIBTARGET}
SLIBNAME=${SLIBNAME}
INSTALL=install
LIBTARGET=${LIBTARGET}
SLIBNAME=${SLIBNAME}
$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
-$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
+$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
$$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)