# common bits used by all libraries
#
-all: # make "all" default target
+# first so "all" becomes default target
+all: all-yes
ifndef SUBDIR
vpath %.c $(SRC_DIR)
ifndef V
Q = @
ECHO = printf "$(1)\t%s\n" $(2)
-BRIEF = CC AS YASM AR LD HOSTCC RANLIB STRIP CP
-SILENT = CCDEP ASDEP YASMDEP RM
+BRIEF = CC AS YASM AR LD HOSTCC STRIP CP
+SILENT = DEPCC YASMDEP RM RANLIB
MSG = $@
+M = @$(call ECHO,$(TAG),$@);
$(foreach VAR,$(BRIEF), \
- $(eval $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
-$(foreach VAR,$(SILENT),$(eval $(VAR) = @$($(VAR))))
+ $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
+$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
endif
-ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
+ALLFFLIBS = avcodec avcore avdevice avfilter avformat avutil postproc swscale
-CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
+IFLAGS := -I$(BUILD_ROOT_REL) -I$(SRC_PATH)
+CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
CFLAGS += $(ECFLAGS)
+YASMFLAGS += $(IFLAGS) -Pconfig.asm
+
+HOSTCFLAGS += $(IFLAGS)
%.o: %.c
$(CCDEP)
%.ver: %.v
$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
-SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
-ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
-$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
-endif
+%.c %.h: TAG = GEN
-$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak
- $< $(SRC_PATH) $@ $(EXTRA_VERSION)
+# Dummy rule to stop make trying to rebuild removed or renamed headers
+%.h:
+ @:
install: install-libs install-headers
+install-libs: install-libs-yes
uninstall: uninstall-libs uninstall-headers
.SUFFIXES:
# Do not delete intermediate files from chains of implicit rules
-.SECONDARY:
+$(OBJS):
endif
OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
-OBJS := $(addprefix $(SUBDIR),$(OBJS))
+OBJS := $(addprefix $(SUBDIR),$(sort $(OBJS)))
+TESTOBJS := $(addprefix $(SUBDIR),$(TESTOBJS))
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
-SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-))
+SKIPHEADERS += $(addprefix $(ARCH)/,$(ARCH_HEADERS))
+SKIPHEADERS := $(addprefix $(SUBDIR),$(SKIPHEADERS-) $(SKIPHEADERS))
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
$(HOSTOBJS): %.o: %.c
$(HOSTPROGS): %$(HOSTEXESUF): %.o
$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
-DEPS := $(OBJS:.o=.d)
-depend dep: $(DEPS)
-
CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
DISTCLEANSUFFIXES = *.pc
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
--include $(wildcard $(DEPS))
+-include $(wildcard $(OBJS:.o=.d))