avconv: Generic device setup
[ffmpeg.git] / avtools / Makefile
1 AVPROGS-$(CONFIG_AVCONV)   += avconv
2 AVPROGS-$(CONFIG_AVPLAY)   += avplay
3 AVPROGS-$(CONFIG_AVPROBE)  += avprobe
4
5 AVPROGS    := $(AVPROGS-yes:%=%$(EXESUF))
6 PROGS      += $(AVPROGS)
7
8 AVBASENAMES = avconv avplay avprobe
9 ALLAVPROGS  = $(AVBASENAMES:%=%$(EXESUF))
10
11 OBJS-avconv                   += avtools/avconv_opt.o avtools/avconv_filter.o \
12                                  avtools/avconv_hw.o
13 OBJS-avconv-$(CONFIG_LIBMFX)  += avtools/avconv_qsv.o
14 OBJS-avconv-$(CONFIG_VAAPI)   += avtools/avconv_vaapi.o
15 OBJS-avconv-$(CONFIG_VDA)     += avtools/avconv_vda.o
16 OBJS-avconv-$(HAVE_DXVA2_LIB) += avtools/avconv_dxva2.o
17 OBJS-avconv-$(HAVE_VDPAU_X11) += avtools/avconv_vdpau.o
18
19 define DOAVTOOL
20 OBJS-$(1) += avtools/cmdutils.o avtools/$(1).o $(OBJS-$(1)-yes)
21 $(1)$(EXESUF): $$(OBJS-$(1))
22 $$(OBJS-$(1)): | avtools
23 $$(OBJS-$(1)): CFLAGS  += $(CFLAGS-$(1))
24 $(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
25 $(1)$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1))
26 -include $$(OBJS-$(1):.o=.d)
27 endef
28
29 $(foreach P,$(AVPROGS-yes),$(eval $(call DOAVTOOL,$(P))))
30
31 all: $(AVPROGS)
32
33 avtools/cmdutils.o: avversion.h | avtools
34 OBJDIRS += avtools
35
36 ifdef AVPROGS
37 install: install-progs install-data
38 endif
39
40 install-progs-yes:
41 install-progs-$(CONFIG_SHARED): install-libs
42
43 install-progs: install-progs-yes $(AVPROGS)
44         $(Q)mkdir -p "$(BINDIR)"
45         $(INSTALL) -c -m 755 $(AVPROGS) "$(BINDIR)"
46
47 uninstall: uninstall-progs
48
49 uninstall-progs:
50         $(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
51
52 clean::
53         $(RM) $(ALLAVPROGS) $(CLEANSUFFIXES:%=avtools/%)