3 # (c) 2000-2004 Fabrice Bellard
9 CFLAGS
=$(OPTFLAGS
) -I
$(BUILD_ROOT
) -I
$(SRC_PATH
) -I
$(SRC_PATH
)/libavutil \
10 -I
$(SRC_PATH
)/libavcodec
-I
$(SRC_PATH
)/libavformat
-I
$(SRC_PATH
)/libswscale \
11 -D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE
-D_ISOC9X_SOURCE
14 PROGS-
$(CONFIG_FFMPEG
) += ffmpeg
15 PROGS-
$(CONFIG_FFPLAY
) += ffplay
16 PROGS-
$(CONFIG_FFSERVER
) += ffserver
18 PROGS
= $(addsuffix $(EXESUF
), $(PROGS-yes
))
19 PROGS_G
= $(addsuffix _g
$(EXESUF
), $(PROGS-yes
))
20 MANPAGES
= $(addprefix doc
/, $(addsuffix .1, $(PROGS-yes
)))
22 BASENAMES
=ffmpeg ffplay ffserver
23 ALLPROGS
=$(addsuffix $(EXESUF
), $(BASENAMES
))
24 ALLPROGS_G
=$(addsuffix _g
$(EXESUF
), $(BASENAMES
))
25 ALLMANPAGES
=$(addsuffix .1, $(BASENAMES
))
27 ifeq ($(BUILD_SHARED
),yes
)
28 DEP_LIBS
=libavcodec
/$(SLIBPREF
)avcodec
$(SLIBSUF
) libavformat
/$(SLIBPREF
)avformat
$(SLIBSUF
)
30 DEP_LIBS
=libavcodec
/$(LIBPREF
)avcodec
$(LIBSUF
) libavformat
/$(LIBPREF
)avformat
$(LIBSUF
)
33 ifeq ($(CONFIG_VHOOK
),yes
)
35 install: install-vhook
38 ifeq ($(BUILD_DOC
),yes
)
43 SRCS
= $(addsuffix .c
, $(PROGS-yes
)) cmdutils.c
44 LDFLAGS
:= -L
$(BUILD_ROOT
)/libavformat
-L
$(BUILD_ROOT
)/libavcodec
-L
$(BUILD_ROOT
)/libavutil
$(LDFLAGS
)
45 EXTRALIBS
:= -lavformat
$(BUILDSUF
) -lavcodec
$(BUILDSUF
) -lavutil
$(BUILDSUF
) $(EXTRALIBS
)
47 ifeq ($(CONFIG_SWSCALER
),yes
)
48 LDFLAGS
+=-L.
/libswscale
49 EXTRALIBS
+=-lswscale
$(BUILDSUF
)
55 $(MAKE
) -C libavutil
all
56 $(MAKE
) -C libavcodec
all
57 $(MAKE
) -C libavformat
all
58 ifeq ($(CONFIG_PP
),yes
)
59 $(MAKE
) -C libpostproc
all
61 ifeq ($(CONFIG_SWSCALER
),yes
)
62 $(MAKE
) -C libswscale
all
65 ffmpeg_g
$(EXESUF
): ffmpeg.o cmdutils.o .libs
66 $(CC
) $(LDFLAGS
) -o
$@ ffmpeg.o cmdutils.o
$(EXTRALIBS
)
68 ffserver
$(EXESUF
): ffserver.o .libs
69 $(CC
) $(LDFLAGS
) $(FFSERVERLDFLAGS
) -o
$@ ffserver.o
$(EXTRALIBS
)
71 ffplay_g
$(EXESUF
): ffplay.o cmdutils.o .libs
72 $(CC
) $(LDFLAGS
) -o
$@ ffplay.o cmdutils.o
$(EXTRALIBS
) $(SDL_LIBS
)
74 %$(EXESUF
): %_g
$(EXESUF
)
78 SVN_ENTRIES
= $(SRC_PATH_BARE
)/.svn
/entries
79 ifeq ($(wildcard $(SVN_ENTRIES
)),$(SVN_ENTRIES
))
80 version.h
: $(SVN_ENTRIES
)
84 $(SRC_PATH
)/version.sh
$(SRC_PATH
)
86 output_example
$(EXESUF
): output_example.o .libs
87 $(CC
) $(LDFLAGS
) -o
$@ output_example.o
$(EXTRALIBS
)
89 qt-faststart
$(EXESUF
): qt-faststart.c
90 $(CC
) $(CFLAGS
) $< -o
$@
92 cws2fws
$(EXESUF
): cws2fws.c
96 $(CC
) $(CFLAGS
) $(SDL_CFLAGS
) -c
-o
$@
$<
98 ffmpeg.o ffplay.o ffserver.o
: version.h
101 $(CC
) $(CFLAGS
) -c
-o
$@
$<
106 documentation
: $(addprefix doc
/, ffmpeg-doc.html faq.html ffserver-doc.html \
107 ffplay-doc.html hooks.html
$(ALLMANPAGES
))
109 doc
/%.html
: doc
/%.texi
110 texi2html
-monolithic
-number
$<
113 doc
/%.pod
: doc
/%-doc.texi
114 doc
/texi2pod.pl
$< $@
117 pod2man
--section
=1 --center
=" " --release
=" " $< > $@
119 install: install-progs install-libs install-headers
121 ifeq ($(BUILD_SHARED
),yes
)
122 install-progs
: $(PROGS
) install-libs
124 install-progs
: $(PROGS
)
126 install -d
"$(bindir)"
127 install -c
-m
755 $(PROGS
) "$(bindir)"
129 # Create the Windows installer.
130 wininstaller
: all install
131 makensis ffinstall.nsi
134 install -d
"$(mandir)/man1"
135 install -m
644 $(MANPAGES
) "$(mandir)/man1"
138 $(MAKE
) -C vhook
install
141 $(MAKE
) -C libavutil install-libs
142 $(MAKE
) -C libavcodec install-libs
143 $(MAKE
) -C libavformat install-libs
144 ifeq ($(CONFIG_PP
),yes
)
145 $(MAKE
) -C libpostproc install-libs
147 ifeq ($(CONFIG_SWSCALER
),yes
)
148 $(MAKE
) -C libswscale install-libs
151 ifeq ($(BUILD_SHARED
),yes
)
156 $(MAKE
) -C libavutil install-headers
157 $(MAKE
) -C libavcodec install-headers
158 $(MAKE
) -C libavformat install-headers
159 ifeq ($(CONFIG_PP
),yes
)
160 $(MAKE
) -C libpostproc install-headers
162 $(MAKE
) -C libswscale install-headers
164 uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
167 rm -f
$(addprefix $(bindir)/, $(ALLPROGS
))
170 rm -f
$(addprefix $(mandir)/man1
/,$(ALLMANPAGES
))
173 $(MAKE
) -C vhook
uninstall
176 $(MAKE
) -C libavutil uninstall-libs
177 $(MAKE
) -C libavcodec uninstall-libs
178 $(MAKE
) -C libavformat uninstall-libs
179 $(MAKE
) -C libpostproc uninstall-libs
182 $(MAKE
) -C libavutil uninstall-headers
183 $(MAKE
) -C libavcodec uninstall-headers
184 $(MAKE
) -C libavformat uninstall-headers
185 $(MAKE
) -C libpostproc uninstall-headers
187 -rmdir
"$(prefix)/include/postproc"
190 $(MAKE
) -C libavutil depend
191 $(MAKE
) -C libavcodec depend
192 $(MAKE
) -C libavformat depend
193 ifeq ($(CONFIG_PP
),yes
)
194 $(MAKE
) -C libpostproc depend
196 ifeq ($(CONFIG_SWSCALER
),yes
)
197 $(MAKE
) -C libswscale depend
199 ifeq ($(CONFIG_VHOOK
),yes
)
200 $(MAKE
) -C vhook depend
203 .depend
: $(SRCS
) version.h
204 $(CC
) -MM
$(CFLAGS
) $(SDL_CFLAGS
) $(filter-out %.h
,$^
) 1>.depend
212 $(MAKE
) -C libavutil
clean
213 $(MAKE
) -C libavcodec
clean
214 $(MAKE
) -C libavformat
clean
215 $(MAKE
) -C libpostproc
clean
216 $(MAKE
) -C libswscale
clean
217 $(MAKE
) -C tests
clean
218 $(MAKE
) -C vhook
clean
219 rm -f
*.o
*.d
*~ .libs gmon.out TAGS
$(ALLPROGS
) $(ALLPROGS_G
) \
220 output_example
$(EXESUF
) qt-faststart
$(EXESUF
) cws2fws
$(EXESUF
)
221 rm -f doc
/*.html doc
/*.pod doc
/*.1
224 $(MAKE
) -C libavutil
distclean
225 $(MAKE
) -C libavcodec
distclean
226 $(MAKE
) -C libavformat
distclean
227 $(MAKE
) -C libpostproc
distclean
228 $(MAKE
) -C libswscale
distclean
229 $(MAKE
) -C tests
distclean
230 $(MAKE
) -C vhook
distclean
231 rm -f .depend version.h config.
* *.
pc
234 etags
*.
[ch
] libavformat
/*.
[ch
] libavcodec
/*.
[ch
]
238 codectest libavtest test-server fulltest
test mpeg4 mpeg
: $(PROGS
)
241 .PHONY
: all lib videohook documentation
install* wininstaller
uninstall*
242 .PHONY
: dep depend
clean distclean TAGS
243 .PHONY
: codectest libavtest test-server fulltest
test mpeg4 mpeg