From f3ffc8ca3a8af230a9bb6170f4a04de9992d4495 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 13 Apr 2008 10:54:33 +0000 Subject: Sync with latest FFmpeg changes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26435 b3059339-0415-0410-9bf9-f77b7e298cf2 --- common.mak | 33 ++++++++++++++++++++++++--------- subdir.mak | 3 +-- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/common.mak b/common.mak index 62dddcd5cf..1fbdf2b489 100644 --- a/common.mak +++ b/common.mak @@ -24,6 +24,15 @@ CFLAGS = -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ %.ho: %.h $(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $< +%.d: %.c + $(DEPEND_CMD) > $@ + +%.d: %.S + $(DEPEND_CMD) > $@ + +%.d: %.cpp + $(DEPEND_CMD) > $@ + install: install-libs install-headers uninstall: uninstall-libs uninstall-headers @@ -48,13 +57,17 @@ SRCS := $(addprefix $(SUBDIR),$(SRCS)) OBJS := $(addprefix $(SUBDIR),$(OBJS)) TESTS := $(addprefix $(SUBDIR),$(TESTS)) +DEP_LIBS:=$(foreach NAME,$(FFLIBS),lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME)) + ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h)) checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho)) -depend dep: $(SUBDIR).depend +DEPS := $(OBJS:.o=.d) +depend dep: $(DEPS) -CLEANFILES += *.o *~ *.a *.lib *.so *.so.* *.dylib *.dll \ - *.def *.dll.a *.exp *.ho *.map +CLEANSUFFIXES = *.o *~ *.ho +LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map +DISTCLEANSUFFIXES = *.d define RULES $(SUBDIR)%: $(SUBDIR)%.o $(LIBNAME) @@ -63,18 +76,20 @@ $(SUBDIR)%: $(SUBDIR)%.o $(LIBNAME) $(SUBDIR)%-test$(EXESUF): $(SUBDIR)%.c $(LIBNAME) $(CC) $(CFLAGS) $(FFLDFLAGS) -DTEST -o $$@ $$^ $(FFEXTRALIBS) -$(SUBDIR).depend: $(SRCS) - $(DEPEND_CMD) > $$@ - clean:: - rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES)) + rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ + $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) distclean:: clean - rm -f $(SUBDIR).depend + rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \ + $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) endef $(eval $(RULES)) +# Clear DIRS variable so that it is not used in other subdirectories. +DIRS = + tests: $(TESTS) --include $(SUBDIR).depend +-include $(DEPS) diff --git a/subdir.mak b/subdir.mak index 5b92f78566..68850c80ba 100644 --- a/subdir.mak +++ b/subdir.mak @@ -33,8 +33,7 @@ $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIB_EXTRA_CMD) ifdef SUBDIR -$(SUBDIR)$(SLIBNAME_WITH_MAJOR): \ - $(foreach L,$(FFLIBS),lib$(L)/$(SLIBPREF)$(L)$(SLIBSUF)) +$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS) endif endif -- cgit v1.2.3