Simplify code in sws_getContext() which logs if the destination format
[ffmpeg.git] / subdir.mak
index 6b098cd..e0ac681 100644 (file)
@@ -5,7 +5,7 @@ include $(SUBDIR)../common.mak
 LIBVERSION := $(lib$(NAME)_VERSION)
 LIBMAJOR   := $(lib$(NAME)_VERSION_MAJOR)
 
-ifeq ($(BUILD_STATIC),yes)
+ifdef CONFIG_STATIC
 all: $(SUBDIR)$(LIBNAME)
 
 install-libs: install-lib$(NAME)-static
@@ -18,31 +18,32 @@ endif
 
 INCINSTDIR := $(INCDIR)/lib$(NAME)
 
+THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
+
 define RULES
 $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
-       $(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS)
+       $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
 
 $(SUBDIR)%-test.o: $(SUBDIR)%.c
-       $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
+       $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
 
 $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
-       $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
+       $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
 
 $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
+       $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$@ $$< > $$(@:.o=.d)
        $(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
 
-$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
-       $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
-
 clean::
-       rm -f $(EXAMPLES) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
-           $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
+       rm -f $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
+           $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) \
+           $(HOSTOBJS) $(HOSTPROGS)
 
 distclean:: clean
        rm -f  $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
             $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
 
-ifdef BUILD_SHARED
+ifdef CONFIG_SHARED
 all: $(SUBDIR)$(SLIBNAME)
 
 install-libs: install-lib$(NAME)-shared
@@ -50,9 +51,9 @@ install-libs: install-lib$(NAME)-shared
 $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
        cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
 
-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS)
+$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
        $(SLIB_CREATE_DEF_CMD)
-       $(CC) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter-out $(DEP_LIBS),$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
+       $(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
        $(SLIB_EXTRA_CMD)
 
 ifdef SUBDIR
@@ -80,21 +81,11 @@ install-headers::
        install -d "$(LIBDIR)/pkgconfig"
        install -m 644 $(addprefix "$(SRC_DIR)"/,$(HEADERS)) "$(INCINSTDIR)"
        install -m 644 $(BUILD_ROOT)/lib$(NAME)/lib$(NAME).pc "$(LIBDIR)/pkgconfig"
-
-uninstall-libs::
-       -rm -f "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
-              "$(SHLIBDIR)/$(SLIBNAME)"            \
-              "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
-       -$(SLIB_UNINSTALL_EXTRA_CMD)
-       -rm -f "$(LIBDIR)/$(LIBNAME)"
-
-uninstall-headers::
-       rm -f $(addprefix "$(INCINSTDIR)/",$(HEADERS))
-       rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
-       -rmdir "$(INCDIR)"
 endef
 
 $(eval $(RULES))
 
+$(EXAMPLES) $(TESTPROGS): $(THIS_LIB) $(DEP_LIBS)
+
 examples: $(EXAMPLES)
 testprogs: $(TESTPROGS)