include config.mak
vpath %.c $(SRC_PATH)
-vpath %.m $(SRC_PATH)
+vpath %.cpp $(SRC_PATH)
vpath %.h $(SRC_PATH)
+vpath %.inc $(SRC_PATH)
+vpath %.m $(SRC_PATH)
vpath %.S $(SRC_PATH)
vpath %.asm $(SRC_PATH)
+vpath %.rc $(SRC_PATH)
vpath %.v $(SRC_PATH)
vpath %.texi $(SRC_PATH)
+vpath %/fate_config.sh.template $(SRC_PATH)
-ifndef V
-Q = @
-ECHO = printf "$(1)\t%s\n" $(2)
-BRIEF = CC HOSTCC HOSTLD AS YASM AR LD
-SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM STRIP
-MSG = $@
-M = @$(call ECHO,$(TAG),$@);
-$(foreach VAR,$(BRIEF), \
- $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
-$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
-$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
-endif
-
-ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil swscale
-
-IFLAGS := -I. -I$(SRC_PATH)
-CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
-CFLAGS += $(ECFLAGS)
-CCFLAGS = $(CPPFLAGS) $(CFLAGS)
-OBJCFLAGS += $(EOBJCFLAGS)
-OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
-ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
-YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
-HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
-LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
-
-define COMPILE
- $(call $(1)DEP,$(1))
- $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
-endef
-
-COMPILE_C = $(call COMPILE,CC)
-COMPILE_S = $(call COMPILE,AS)
-COMPILE_M = $(call COMPILE,OBJCC)
-COMPILE_HOSTC = $(call COMPILE,HOSTCC)
-
-%.o: %.c
- $(COMPILE_C)
-
-%.o: %.S
- $(COMPILE_S)
-
-%.o: %.m
- $(COMPILE_M)
-
-%_host.o: %.c
- $(COMPILE_HOSTC)
-
-%.o: %.asm
- $(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
- $(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
- -$(STRIP) $(STRIPFLAGS) $@
+AVPROGS-$(CONFIG_FFMPEG) += ffmpeg
+AVPROGS-$(CONFIG_FFPLAY) += ffplay
+AVPROGS-$(CONFIG_FFPROBE) += ffprobe
+AVPROGS-$(CONFIG_FFSERVER) += ffserver
-%.i: %.c
- $(CC) $(CCFLAGS) $(CC_E) $<
-
-%.h.c:
- $(Q)echo '#include "$*.h"' >$@
-
-%.c %.h %.ver: TAG = GEN
-
-AVPROGS-$(CONFIG_AVCONV) += avconv
-AVPROGS-$(CONFIG_AVPLAY) += avplay
-AVPROGS-$(CONFIG_AVPROBE) += avprobe
-
-AVPROGS := $(AVPROGS-yes:%=%$(EXESUF))
+AVPROGS := $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
+INSTPROGS = $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
PROGS += $(AVPROGS)
-AVBASENAMES = avconv avplay avprobe
-ALLAVPROGS = $(AVBASENAMES:%=%$(EXESUF))
+AVBASENAMES = ffmpeg ffplay ffprobe ffserver
+ALLAVPROGS = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
+ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog) += cmdutils.o))
+$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_opencl.o))
+
+OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o
+OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += ffmpeg_videotoolbox.o
+OBJS-ffmpeg-$(CONFIG_LIBMFX) += ffmpeg_qsv.o
+OBJS-ffmpeg-$(CONFIG_VAAPI) += ffmpeg_vaapi.o
+ifndef CONFIG_VIDEOTOOLBOX
+OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_videotoolbox.o
+endif
+OBJS-ffmpeg-$(CONFIG_CUVID) += ffmpeg_cuvid.o
+OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
+OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
+OBJS-ffserver += ffserver_config.o
-OBJS-avconv += avconv_opt.o avconv_filter.o
-OBJS-avconv-$(CONFIG_LIBMFX) += avconv_qsv.o
-OBJS-avconv-$(CONFIG_VAAPI) += avconv_vaapi.o
-OBJS-avconv-$(CONFIG_VDA) += avconv_vda.o
-OBJS-avconv-$(HAVE_DXVA2_LIB) += avconv_dxva2.o
-OBJS-avconv-$(HAVE_VDPAU_X11) += avconv_vdpau.o
-
-TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
+TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
- TOOLS = qt-faststart trasher uncoded_frame
- TOOLS-$(CONFIG_ZLIB) += cws2fws
# $(FFLIBS-yes) needs to be in linking order
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
all: $(AVPROGS)
$(TOOLS): %$(EXESUF): %.o
- $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS) $(ELIBS)
-
-tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
+ $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS)
- tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
- tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
- tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
-
CONFIGURABLE_COMPONENTS = \
$(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \
$(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/version.h)) \
-include $$(OBJS-$(1):.o=.d)
endef
-$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(EXESUF)=))))
+$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
+
+ffprobe.o cmdutils.o libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
-$(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
+$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
+ $(CP) $< $@
+ $(STRIP) $@
+
+%$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
- OBJDIRS += tools
-
- -include $(wildcard tools/*.d)
-
VERSION_SH = $(SRC_PATH)/version.sh
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
$(RM) -r "$(DATADIR)"
clean::
- $(RM) $(ALLAVPROGS)
+ $(RM) $(ALLAVPROGS) $(ALLAVPROGS_G)
$(RM) $(CLEANSUFFIXES)
- $(RM) $(CLEANSUFFIXES:%=tools/%)
- $(RM) -rf coverage.info lcov
+ $(RM) $(CLEANSUFFIXES:%=compat/msvcrt/%)
+ $(RM) $(CLEANSUFFIXES:%=compat/atomics/pthread/%)
+ $(RM) $(CLEANSUFFIXES:%=compat/%)
+ $(RM) -r coverage-html
+ $(RM) -rf coverage.info coverage.info.in lcov
distclean::
$(RM) $(DISTCLEANSUFFIXES)