ffmpeg: Use codec hardware config to configure hwaccels
[ffmpeg.git] / fftools / Makefile
1 AVPROGS-$(CONFIG_FFMPEG)   += ffmpeg
2 AVPROGS-$(CONFIG_FFPLAY)   += ffplay
3 AVPROGS-$(CONFIG_FFPROBE)  += ffprobe
4 AVPROGS-$(CONFIG_FFSERVER) += ffserver
5
6 AVPROGS     := $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
7 PROGS       += $(AVPROGS)
8
9 AVBASENAMES  = ffmpeg ffplay ffprobe ffserver
10 ALLAVPROGS   = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
11 ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
12
13 OBJS-ffmpeg                        += fftools/ffmpeg_opt.o fftools/ffmpeg_filter.o fftools/ffmpeg_hw.o
14 OBJS-ffmpeg-$(CONFIG_CUVID)        += fftools/ffmpeg_cuvid.o
15 OBJS-ffmpeg-$(CONFIG_LIBMFX)       += fftools/ffmpeg_qsv.o
16 ifndef CONFIG_VIDEOTOOLBOX
17 OBJS-ffmpeg-$(CONFIG_VDA)          += fftools/ffmpeg_videotoolbox.o
18 endif
19 OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += fftools/ffmpeg_videotoolbox.o
20 OBJS-ffserver                      += fftools/ffserver_config.o
21
22 define DOFFTOOL
23 OBJS-$(1) += fftools/cmdutils.o fftools/$(1).o $(OBJS-$(1)-yes)
24 $(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
25 $$(OBJS-$(1)): | fftools
26 $$(OBJS-$(1)): CFLAGS  += $(CFLAGS-$(1))
27 $(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
28 $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1))
29 -include $$(OBJS-$(1):.o=.d)
30 endef
31
32 $(foreach P,$(AVPROGS-yes),$(eval $(call DOFFTOOL,$(P))))
33
34 all: $(AVPROGS)
35
36 fftools/ffprobe.o fftools/cmdutils.o: libavutil/ffversion.h | fftools
37 OBJDIRS += fftools
38
39 ifdef AVPROGS
40 install: install-progs install-data
41 endif
42
43 install-progs-yes:
44 install-progs-$(CONFIG_SHARED): install-libs
45
46 install-progs: install-progs-yes $(AVPROGS)
47         $(Q)mkdir -p "$(BINDIR)"
48         $(INSTALL) -c -m 755 $(AVPROGS) "$(BINDIR)"
49
50 uninstall: uninstall-progs
51
52 uninstall-progs:
53         $(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
54
55 clean::
56         $(RM) $(ALLAVPROGS) $(ALLAVPROGS_G) $(CLEANSUFFIXES:%=fftools/%)