Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 194 lines (145 sloc) 5.326 kb
e1a5430 Move SRC_PATH hack around to allow compilation from subdir again.
Reimar Döffinger authored
1 MAIN_MAKEFILE=1
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
2 include config.mak
3
f038cf3 @mansr build: remove SRC_PATH_BARE variable
mansr authored
4 vpath %.c $(SRC_PATH)
006d2ab @hexene C++ Support ;)
hexene authored
5 vpath %.cpp $(SRC_PATH)
f038cf3 @mansr build: remove SRC_PATH_BARE variable
mansr authored
6 vpath %.h $(SRC_PATH)
7 vpath %.S $(SRC_PATH)
8 vpath %.asm $(SRC_PATH)
9 vpath %.v $(SRC_PATH)
10 vpath %.texi $(SRC_PATH)
bd9d4a6 @beastd build: Try to find fate_config.sh.template in source path
beastd authored
11 vpath %/fate_config.sh.template $(SRC_PATH)
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
12
13 PROGS-$(CONFIG_FFMPEG) += ffmpeg
14 PROGS-$(CONFIG_FFPLAY) += ffplay
336ce91 Add FFprobe tool.
Stefano Sabatini authored
15 PROGS-$(CONFIG_FFPROBE) += ffprobe
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
16 PROGS-$(CONFIG_FFSERVER) += ffserver
17
95d1af1 @jamrial build: Fix compilation when configuring with a prog suffix
jamrial authored
18 PROGS := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
c975cfa @ubitux build: fix install rule with --progs-suffix.
ubitux authored
19 INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
baac24e @mansr build: generalise rules and variable settings for av* programs
mansr authored
20 OBJS = cmdutils.o
11a1033 @michaelni Merge remote-tracking branch 'qatar/master'
michaelni authored
21 OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
3d157bf @mansr Makefile: fix cleaning of tools in tests directory
mansr authored
22 TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
0d0b81f @elenril Generate manpages for AV{Format,Codec}Context AVOptions.
elenril authored
23 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
28e1c97 @mansr build: rework rules for things in the tools dir
mansr authored
24 TOOLS = qt-faststart trasher
25 TOOLS-$(CONFIG_ZLIB) += cws2fws
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
26
def6789 @michaelni Remove avconv
michaelni authored
27 BASENAMES = ffmpeg ffplay ffprobe ffserver
33d9077 @ubitux build: introduce --progs-suffix option.
ubitux authored
28 ALLPROGS = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
29 ALLPROGS_G = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
583fcb5 @mansr Makefile: simplify setting of some variables
mansr authored
30 ALLMANPAGES = $(BASENAMES:%=%.1)
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
31
5a0f713 @mansr Allow disabling of lavc, lavf, lavd, and lsws
mansr authored
32 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
33 FFLIBS-$(CONFIG_AVFILTER) += avfilter
5a0f713 @mansr Allow disabling of lavc, lavf, lavd, and lsws
mansr authored
34 FFLIBS-$(CONFIG_AVFORMAT) += avformat
c8af852 @justinruggles Add libavresample
justinruggles authored
35 FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
97d5fa3 @mansr 10l: fix linking
mansr authored
36 FFLIBS-$(CONFIG_AVCODEC) += avcodec
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
37 FFLIBS-$(CONFIG_POSTPROC) += postproc
b5875b9 @michaelni Add libswresample.
michaelni authored
38 FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
5a0f713 @mansr Allow disabling of lavc, lavf, lavd, and lsws
mansr authored
39 FFLIBS-$(CONFIG_SWSCALE) += swscale
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
40
5a0f713 @mansr Allow disabling of lavc, lavf, lavd, and lsws
mansr authored
41 FFLIBS := avutil
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
42
29c1b25 @michaelni Makefile: fix path to ffprobe.xsd
michaelni authored
43 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
0cc9ee5 @ubitux doc/examples: install them with the shared data.
ubitux authored
44 EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile
a1a84f6 @superdump Add (un)installation targets for ffpresets using the new DATADIR variabl...
superdump authored
45
9b55e2e @mansr Skip cmdutils_common_opts.h fragment in checkheaders
mansr authored
46 SKIPHEADERS = cmdutils_common_opts.h
47
57b4a3d @mansr build: include sub-makefiles using full path instead of symlinks
mansr authored
48 include $(SRC_PATH)/common.mak
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
49
50 FF_EXTRALIBS := $(FFEXTRALIBS)
51 FF_DEP_LIBS := $(DEP_LIBS)
52
c83ef63 @michaelni build: Disable avconv more completely while leaving the user the option ...
michaelni authored
53 all: $(PROGS)
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
54
95d1af1 @jamrial build: Fix compilation when configuring with a prog suffix
jamrial authored
55 $(PROGS): %$(EXESUF): %_g$(EXESUF)
56 $(CP) $< $@
57 $(STRIP) $@
b1ca964 @michaelni Revert "Remove support for stripping executables"
michaelni authored
58
28e1c97 @mansr build: rework rules for things in the tools dir
mansr authored
59 $(TOOLS): %$(EXESUF): %.o
8f7c26e @DonDiego build: Use portable abstraction for linker/hostcc output file syntax
DonDiego authored
60 $(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)
28e1c97 @mansr build: rework rules for things in the tools dir
mansr authored
61
7baa115 @mansr build: export filtered -lz flag in config.mak
mansr authored
62 tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
28e1c97 @mansr build: rework rules for things in the tools dir
mansr authored
63
8660191 @mansr Rerun configure when all*.c files have changed
mansr authored
64 config.h: .config
f038cf3 @mansr build: remove SRC_PATH_BARE variable
mansr authored
65 .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
9d0b304 @mansr Do not automatically run configure
mansr authored
66 @-tput bold 2>/dev/null
67 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
68 @-tput sgr0 2>/dev/null
8660191 @mansr Rerun configure when all*.c files have changed
mansr authored
69
e7e19b1 @DonDiego build: Only clean the architecture subdirectory we build for.
DonDiego authored
70 SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
ad0e31f @DonDiego build: prettyprinting cosmetics
DonDiego authored
71 ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
5864eb4 @DonDiego build: cosmetics: Reorder some lists in a more logical fashion
DonDiego authored
72 ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS \
73 MMI-OBJS ALTIVEC-OBJS VIS-OBJS \
74 MMX-OBJS YASM-OBJS \
3827a86 @nbabic Optimization of AMR NB and WB decoders for MIPS
nbabic authored
75 MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS \
24d3796 @DonDiego build: add HOSTOBJS to SUBDIR_VARS list
DonDiego authored
76 OBJS HOSTOBJS TESTOBJS
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
77
78 define RESET
79 $(1) :=
80 $(1)-yes :=
81 endef
82
83 define DOSUBDIR
84 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
85 SUBDIR := $(1)/
57b4a3d @mansr build: include sub-makefiles using full path instead of symlinks
mansr authored
86 include $(SRC_PATH)/$(1)/Makefile
07a873a @DonDiego build: Automatically include architecture-specific library Makefile snip...
DonDiego authored
87 -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
144904e @DonDiego build: rename subdir.mak ---> library.mak
DonDiego authored
88 include $(SRC_PATH)/library.mak
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
89 endef
90
91 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
92
baac24e @mansr build: generalise rules and variable settings for av* programs
mansr authored
93 define DOPROG
94 OBJS-$(1) += $(1).o
95d1af1 @jamrial build: Fix compilation when configuring with a prog suffix
jamrial authored
95 $(1)$(PROGSSUF)_g$(EXESUF): $(OBJS-$(1))
baac24e @mansr build: generalise rules and variable settings for av* programs
mansr authored
96 $$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
95d1af1 @jamrial build: Fix compilation when configuring with a prog suffix
jamrial authored
97 $(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
98 $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
baac24e @mansr build: generalise rules and variable settings for av* programs
mansr authored
99 -include $$(OBJS-$(1):.o=.d)
100 endef
101
102 $(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
103
33d9077 @ubitux build: introduce --progs-suffix option.
ubitux authored
104 %$(PROGSSUF)_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
8f7c26e @DonDiego build: Use portable abstraction for linker/hostcc output file syntax
DonDiego authored
105 $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS)
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
106
5e27ec2 @mansr build: create output directories as needed
mansr authored
107 OBJDIRS += tools
108
08df7f8 @mansr Makefile: include deps from tools directory
mansr authored
109 -include $(wildcard tools/*.d)
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
110
f038cf3 @mansr build: remove SRC_PATH_BARE variable
mansr authored
111 VERSION_SH = $(SRC_PATH)/version.sh
112 GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
6a53fff @mansr Improve version.h generation
mansr authored
113
faa6f1c get rid of the last svn mentions
Janne Grunau authored
114 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
6a53fff @mansr Improve version.h generation
mansr authored
115 .version: M=@
116
117 version.h .version:
0853a2b @mansr 10l: fix version.h generation
mansr authored
118 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
6a53fff @mansr Improve version.h generation
mansr authored
119 $(Q)touch .version
120
121 # force version.sh to run whenever version might have changed
122 -include .version
36798f1 @mansr Declare version.h dependencies explicitly
mansr authored
123
623ffe8 @mansr build: simplify some conditional targets
mansr authored
124 ifdef PROGS
125 install: install-progs install-data
126 endif
127
128 install: install-libs install-headers
d7a72d2 @mansr build: move all (un)install* target aliases to toplevel Makefile
mansr authored
129
130 install-libs: install-libs-yes
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
131
151c584 @mansr build: fix "make install" with documentation disabled
mansr authored
132 install-progs-yes:
623ffe8 @mansr build: simplify some conditional targets
mansr authored
133 install-progs-$(CONFIG_SHARED): install-libs
134
135 install-progs: install-progs-yes $(PROGS)
63611f3 @mansr Prettify make output
mansr authored
136 $(Q)mkdir -p "$(BINDIR)"
c975cfa @ubitux build: fix install rule with --progs-suffix.
ubitux authored
137 $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
138
0cc9ee5 @ubitux doc/examples: install them with the shared data.
ubitux authored
139 install-data: $(DATA_FILES) $(EXAMPLES_FILES)
140 $(Q)mkdir -p "$(DATADIR)/examples"
fd676de @mansr Add INSTALL makefile variable
mansr authored
141 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
0cc9ee5 @ubitux doc/examples: install them with the shared data.
ubitux authored
142 $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
a1a84f6 @superdump Add (un)installation targets for ffpresets using the new DATADIR variabl...
superdump authored
143
f87b03b @mansr build: move documentation rules to doc/Makefile
mansr authored
144 uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
d3cb93b @ramiropolla Revert r21226, it was a joke:
ramiropolla authored
145
146 uninstall-progs:
50e10cb @mansr Use $(RM) to delete files
mansr authored
147 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
d3cb93b @ramiropolla Revert r21226, it was a joke:
ramiropolla authored
148
149 uninstall-data:
50e10cb @mansr Use $(RM) to delete files
mansr authored
150 $(RM) -r "$(DATADIR)"
d3cb93b @ramiropolla Revert r21226, it was a joke:
ramiropolla authored
151
698a183 @mansr build: move test rules to tests/Makefile
mansr authored
152 clean::
b1ca964 @michaelni Revert "Remove support for stripping executables"
michaelni authored
153 $(RM) $(ALLPROGS) $(ALLPROGS_G)
50e10cb @mansr Use $(RM) to delete files
mansr authored
154 $(RM) $(CLEANSUFFIXES)
155 $(RM) $(TOOLS)
4032137 Allow "make clean" to clean files in tools
Stefano Sabatini authored
156 $(RM) $(CLEANSUFFIXES:%=tools/%)
840ecc9 Add coverage support.
Reimar Döffinger authored
157 $(RM) coverage.info
158 $(RM) -r coverage-html
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
159
160 distclean::
50e10cb @mansr Use $(RM) to delete files
mansr authored
161 $(RM) $(DISTCLEANSUFFIXES)
7621c35 @michaelni Makefile: remove old codec_names.h on distclean
michaelni authored
162 $(RM) config.* .version version.h libavutil/avconfig.h libavcodec/codec_names.h
bde51e6 @justinruggles restore accidently deleted file
justinruggles authored
163
9d0b304 @mansr Do not automatically run configure
mansr authored
164 config:
e528cda @michaelni Revert "replace FFMPEG with LIBAV in FFMPEG_CONFIGURATION"
michaelni authored
165 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
0c3b2d6 @mansr Add "config" make target to rerun configure with old options
mansr authored
166
840ecc9 Add coverage support.
Reimar Döffinger authored
167 # Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
168 coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
169 $(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@
170
171 coverage-html: coverage.info
172 $(Q)mkdir -p $@
173 $(Q)genhtml -o $@ $<
174 $(Q)touch $@
175
7c8b5d1 @michaelni Makefile: remove checkheaders from the main check target
michaelni authored
176 check: all alltools examples testprogs fate
4982e1d @DonDiego build: Add 'check' target to run all compile and test targets.
DonDiego authored
177
57b4a3d @mansr build: include sub-makefiles using full path instead of symlinks
mansr authored
178 include $(SRC_PATH)/doc/Makefile
179 include $(SRC_PATH)/tests/Makefile
d29d9cc @mansr fate: print list of tests with "make fate-list"
mansr authored
180
5e27ec2 @mansr build: create output directories as needed
mansr authored
181 $(sort $(OBJDIRS)):
182 $(Q)mkdir -p $@
183
8d853ef @mansr build: move special targets to end of main Makefile
mansr authored
184 # Dummy rule to stop make trying to rebuild removed or renamed headers
185 %.h:
186 @:
187
188 # Disable suffix rules. Most of the builtin rules are suffix rules,
189 # so this saves some time on slow systems.
190 .SUFFIXES:
191
06e4b98 @ubitux build: remove non-existant examples rule.
ubitux authored
192 .PHONY: all all-yes alltools check *clean config install*
698a183 @mansr build: move test rules to tests/Makefile
mansr authored
193 .PHONY: testprogs uninstall*
Something went wrong with that request. Please try again.