Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. AVPROGS-$(CONFIG_FFMPEG) += ffmpeg
  2. AVPROGS-$(CONFIG_FFPLAY) += ffplay
  3. AVPROGS-$(CONFIG_FFPROBE) += ffprobe
  4. AVPROGS := $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
  5. PROGS += $(AVPROGS)
  6. AVBASENAMES = ffmpeg ffplay ffprobe
  7. ALLAVPROGS = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
  8. ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
  9. OBJS-ffmpeg += fftools/ffmpeg_opt.o fftools/ffmpeg_filter.o fftools/ffmpeg_hw.o
  10. OBJS-ffmpeg-$(CONFIG_CUVID) += fftools/ffmpeg_cuvid.o
  11. OBJS-ffmpeg-$(CONFIG_LIBMFX) += fftools/ffmpeg_qsv.o
  12. ifndef CONFIG_VIDEOTOOLBOX
  13. OBJS-ffmpeg-$(CONFIG_VDA) += fftools/ffmpeg_videotoolbox.o
  14. endif
  15. OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += fftools/ffmpeg_videotoolbox.o
  16. define DOFFTOOL
  17. OBJS-$(1) += fftools/cmdutils.o fftools/$(1).o $(OBJS-$(1)-yes)
  18. $(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
  19. $$(OBJS-$(1)): | fftools
  20. $$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
  21. $(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
  22. $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1))
  23. -include $$(OBJS-$(1):.o=.d)
  24. endef
  25. $(foreach P,$(AVPROGS-yes),$(eval $(call DOFFTOOL,$(P))))
  26. all: $(AVPROGS)
  27. fftools/ffprobe.o fftools/cmdutils.o: libavutil/ffversion.h | fftools
  28. OUTDIRS += fftools
  29. ifdef AVPROGS
  30. install: install-progs install-data
  31. endif
  32. install-progs-yes:
  33. install-progs-$(CONFIG_SHARED): install-libs
  34. install-progs: install-progs-yes $(AVPROGS)
  35. $(Q)mkdir -p "$(BINDIR)"
  36. $(INSTALL) -c -m 755 $(AVPROGS) "$(BINDIR)"
  37. uninstall: uninstall-progs
  38. uninstall-progs:
  39. $(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
  40. clean::
  41. $(RM) $(ALLAVPROGS) $(ALLAVPROGS_G) $(CLEANSUFFIXES:%=fftools/%)