skiprd doxygen comment from avcodec.h -> AVOption comment
[libav.git] / Makefile
CommitLineData
a1b63811 1#
85f07f22 2# Main ffmpeg Makefile
38100e8c 3# (c) 2000-2004 Fabrice Bellard
85f07f22 4#
980fc7b8 5include config.mak
85f07f22 6
997baf01 7VPATH=$(SRC_PATH_BARE)
dd9ca370 8
cbeee4d8 9CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
a163ed1a 10 -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libswscale \
4b65d88f 11 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
115329f1 12LDFLAGS+= -g
37736979 13
786b30af 14ifeq ($(CONFIG_FFMPEG),yes)
7d2f4546
DB
15MANPAGES=doc/ffmpeg.1
16PROGS_G+=ffmpeg_g$(EXESUF)
17PROGS+=ffmpeg$(EXESUF)
786b30af 18endif
01310af2
FB
19
20ifeq ($(CONFIG_FFSERVER),yes)
7d2f4546
DB
21MANPAGES+=doc/ffserver.1
22PROGS+=ffserver$(EXESUF)
01310af2
FB
23endif
24
25ifeq ($(CONFIG_FFPLAY),yes)
7d2f4546
DB
26MANPAGES+=doc/ffplay.1
27PROGS_G+=ffplay_g$(EXESUF)
28PROGS+=ffplay$(EXESUF)
f3ec2d46 29endif
85f07f22 30
6b991cb2
DB
31BASENAMES=ffmpeg ffplay ffserver
32ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
33ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
34ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
35
0fd94442 36ifeq ($(BUILD_SHARED),yes)
6bc114b2 37DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
0fd94442 38else
f3ec2d46 39DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
f02be79d
RS
40endif
41
d226c750 42ifeq ($(CONFIG_VHOOK),yes)
142fc6b9
PG
43VHOOK=videohook
44INSTALLVHOOK=install-vhook
47930f09 45endif
142fc6b9 46
146ea952
NB
47ifeq ($(BUILD_DOC),yes)
48DOC=documentation
8233b750 49INSTALLMAN=install-man
146ea952
NB
50endif
51
f381af7b 52OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o
57514323 53SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
84471efd 54LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
8dc6f118 55EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
57514323 56
790c9ca7 57ifeq ($(CONFIG_SWSCALER),yes)
cc654dd7 58LDFLAGS+=-L./libswscale
6de9e506 59EXTRALIBS+=-lswscale$(BUILDSUF)
790c9ca7
LA
60endif
61
4d15aae1 62all: lib $(PROGS_G) $(PROGS) $(VHOOK) $(DOC)
85f07f22 63
951bf3e6 64lib:
5d22ccf7
DB
65 $(MAKE) -C libavutil all
66 $(MAKE) -C libavcodec all
abac6175 67 $(MAKE) -C libavformat all
1a9150b1 68ifeq ($(CONFIG_PP),yes)
6d9a2421 69 $(MAKE) -C libpostproc all
1a9150b1 70endif
790c9ca7
LA
71ifeq ($(CONFIG_SWSCALER),yes)
72 $(MAKE) -C libswscale all
73endif
85f07f22 74
951bf3e6 75ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
6de9e506 76 $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
85f07f22 77
951bf3e6 78ffserver$(EXESUF): ffserver.o .libs
6de9e506 79 $(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(EXTRALIBS)
85f07f22 80
951bf3e6 81ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
6de9e506 82 $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
01310af2 83
0cfd96cc 84%$(EXESUF): %_g$(EXESUF)
01310af2
FB
85 cp -p $< $@
86 $(STRIP) $@
87
f1cc88a5 88version.h:
997baf01 89 $(SRC_PATH)/version.sh $(SRC_PATH)
f1cc88a5 90
951bf3e6 91output_example$(EXESUF): output_example.o .libs
6de9e506 92 $(CC) $(LDFLAGS) -o $@ output_example.o $(EXTRALIBS)
8de65d4f 93
38100e8c 94qt-faststart$(EXESUF): qt-faststart.c
3acc68b4 95 $(CC) $(CFLAGS) $< -o $@
38100e8c 96
f7599d5f 97cws2fws$(EXESUF): cws2fws.c
3acc68b4 98 $(CC) $< -o $@ -lz
f7599d5f 99
01310af2 100ffplay.o: ffplay.c
115329f1 101 $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
2744a37f 102
496cfa3c
MR
103ffmpeg.o ffplay.o ffserver.o: version.h
104
85f07f22 105%.o: %.c
115329f1 106 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 107
be12b2a4 108videohook: .libs
142fc6b9
PG
109 $(MAKE) -C vhook all
110
146ea952
NB
111documentation:
112 $(MAKE) -C doc all
113
8233b750 114install: install-progs install-libs install-headers $(INSTALLMAN) $(INSTALLVHOOK)
81dcdc53 115
a4848db6 116ifeq ($(BUILD_SHARED),yes)
7d2f4546 117install-progs: $(PROGS) install-libs
a4848db6 118else
7d2f4546 119install-progs: $(PROGS)
a4848db6 120endif
951bf3e6 121 install -d "$(bindir)"
7d2f4546 122 install -c $(INSTALLSTRIP) -m 755 $(PROGS) "$(bindir)"
85f07f22 123
d35ff76b
FB
124# create the window installer
125wininstaller: all install
126 makensis ffinstall.nsi
127
23a65308 128install-man:
8233b750
DB
129 install -d "$(mandir)/man1"
130 install -m 644 $(MANPAGES) "$(mandir)/man1"
23a65308 131
aa99b8ff
MN
132install-vhook:
133 $(MAKE) -C vhook install
142fc6b9 134
b12f8273 135install-libs:
8b2121e3
MR
136 $(MAKE) -C libavutil install-libs
137 $(MAKE) -C libavcodec install-libs
138 $(MAKE) -C libavformat install-libs
1a9150b1 139ifeq ($(CONFIG_PP),yes)
6d9a2421 140 $(MAKE) -C libpostproc install-libs
1a9150b1 141endif
790c9ca7
LA
142ifeq ($(CONFIG_SWSCALER),yes)
143 $(MAKE) -C libswscale install-libs
144endif
145
8b2121e3 146ifeq ($(BUILD_SHARED),yes)
1e7ffa50 147 -$(LDCONFIG)
b12f8273 148endif
37736979 149
f29f3b5d
DB
150install-headers:
151 $(MAKE) -C libavutil install-headers
152 $(MAKE) -C libavcodec install-headers
153 $(MAKE) -C libavformat install-headers
1a9150b1 154ifeq ($(CONFIG_PP),yes)
6d9a2421 155 $(MAKE) -C libpostproc install-headers
1a9150b1 156endif
790c9ca7 157 $(MAKE) -C libswscale install-headers
f29f3b5d 158
f9edb717
DB
159uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
160
f9edb717
DB
161uninstall-progs:
162 rm -f $(addprefix $(bindir)/, $(ALLPROGS))
163
f9edb717 164uninstall-man:
f9edb717 165 rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
f9edb717
DB
166
167uninstall-vhook:
168 $(MAKE) -C vhook uninstall
169
170uninstall-libs:
171 $(MAKE) -C libavutil uninstall-libs
172 $(MAKE) -C libavcodec uninstall-libs
173 $(MAKE) -C libavformat uninstall-libs
6d9a2421 174 $(MAKE) -C libpostproc uninstall-libs
f9edb717
DB
175
176uninstall-headers:
177 $(MAKE) -C libavutil uninstall-headers
178 $(MAKE) -C libavcodec uninstall-headers
179 $(MAKE) -C libavformat uninstall-headers
6d9a2421 180 $(MAKE) -C libpostproc uninstall-headers
f9edb717
DB
181 -rmdir "$(incdir)"
182 -rmdir "$(prefix)/include/postproc"
183
354ca798 184depend dep: .depend
ea0f0681 185 $(MAKE) -C libavutil depend
5d22ccf7 186 $(MAKE) -C libavcodec depend
c80d990f 187 $(MAKE) -C libavformat depend
691c480e
DB
188ifeq ($(CONFIG_PP),yes)
189 $(MAKE) -C libpostproc depend
190endif
eaa6d7b6
DB
191ifeq ($(CONFIG_SWSCALER),yes)
192 $(MAKE) -C libswscale depend
193endif
d226c750 194ifeq ($(CONFIG_VHOOK),yes)
5d22ccf7 195 $(MAKE) -C vhook depend
811b32ed 196endif
4b8b2edb 197
fd071c26 198.depend: $(SRCS) version.h
0032cac2 199 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
57514323 200
da34f7ac
MR
201$(DEP_LIBS): lib
202
203.libs: $(DEP_LIBS)
204 touch $@
cf2818b0 205
98013cc1 206clean:
5d22ccf7
DB
207 $(MAKE) -C libavutil clean
208 $(MAKE) -C libavcodec clean
abac6175 209 $(MAKE) -C libavformat clean
6d9a2421 210 $(MAKE) -C libpostproc clean
790c9ca7 211 $(MAKE) -C libswscale clean
5d22ccf7
DB
212 $(MAKE) -C tests clean
213 $(MAKE) -C vhook clean
bf840994 214 $(MAKE) -C doc clean
3e4134f6
DB
215 rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
216 output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
142fc6b9 217
85f07f22 218distclean: clean
98013cc1
DB
219 $(MAKE) -C libavutil distclean
220 $(MAKE) -C libavcodec distclean
221 $(MAKE) -C libavformat distclean
6d9a2421 222 $(MAKE) -C libpostproc distclean
790c9ca7 223 $(MAKE) -C libswscale distclean
98013cc1
DB
224 $(MAKE) -C tests distclean
225 $(MAKE) -C vhook distclean
5c6a5d58 226 rm -f .depend version.h config.* *.pc
85f07f22
FB
227
228TAGS:
abac6175 229 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 230
dd9ca370
FB
231# regression tests
232
902d3c6d 233codectest libavtest test-server fulltest test mpeg4 mpeg: $(PROGS)
ec9fca31 234 $(MAKE) -C tests $@
dd9ca370 235
3263626f 236.PHONY: all lib videohook documentation install* wininstaller uninstall*
bedb3550 237.PHONY: dep depend clean distclean TAGS
3263626f 238.PHONY: codectest libavtest test-server fulltest test mpeg4 mpeg
cf2818b0 239
57514323
ZK
240ifneq ($(wildcard .depend),)
241include .depend
242endif