Merge remote-tracking branch 'qatar/master'
[ffmpeg.git] / library.mak
index d9e81ae..2728340 100644 (file)
@@ -5,7 +5,6 @@ include $(SRC_PATH)/common.mak
 LIBVERSION := $(lib$(NAME)_VERSION)
 LIBMAJOR   := $(lib$(NAME)_VERSION_MAJOR)
 INCINSTDIR := $(INCDIR)/lib$(NAME)
-THIS_LIB   := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
 
 all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
 all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
@@ -34,11 +33,11 @@ install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
 install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
 
 define RULES
-$(EXAMPLES) $(TOOLS): LIB = $(FULLNAME:%=$(LD_LIB))
-$(TESTPROGS):         LIB = $(SUBDIR)$(LIBNAME)
+$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
+$(TESTPROGS):         THISLIB = $(SUBDIR)$(LIBNAME)
 
 $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
-       $$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(LIB) $(FFEXTRALIBS) $$(ELIBS)
+       $$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
 
 $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
        $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
@@ -97,8 +96,8 @@ endef
 
 $(eval $(RULES))
 
-$(EXAMPLES) $(TOOLS): $(THIS_LIB) $(DEP_LIBS)
-$(TESTPROGS): $(SUBDIR)$(LIBNAME) $(DEP_LIBS)
+$(EXAMPLES) $(TOOLS): $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
+$(TESTPROGS):         $(DEP_LIBS) $(SUBDIR)$(LIBNAME)
 
 examples: $(EXAMPLES)
 testprogs: $(TESTPROGS)