comment typo
[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
634444f4 62all: lib $(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
a4da50e1
MR
88SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
89ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
90version.h: $(SVN_ENTRIES)
91endif
92
f1cc88a5 93version.h:
997baf01 94 $(SRC_PATH)/version.sh $(SRC_PATH)
f1cc88a5 95
951bf3e6 96output_example$(EXESUF): output_example.o .libs
6de9e506 97 $(CC) $(LDFLAGS) -o $@ output_example.o $(EXTRALIBS)
8de65d4f 98
38100e8c 99qt-faststart$(EXESUF): qt-faststart.c
3acc68b4 100 $(CC) $(CFLAGS) $< -o $@
38100e8c 101
f7599d5f 102cws2fws$(EXESUF): cws2fws.c
3acc68b4 103 $(CC) $< -o $@ -lz
f7599d5f 104
01310af2 105ffplay.o: ffplay.c
115329f1 106 $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
2744a37f 107
496cfa3c
MR
108ffmpeg.o ffplay.o ffserver.o: version.h
109
85f07f22 110%.o: %.c
115329f1 111 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 112
be12b2a4 113videohook: .libs
142fc6b9
PG
114 $(MAKE) -C vhook all
115
146ea952
NB
116documentation:
117 $(MAKE) -C doc all
118
8233b750 119install: install-progs install-libs install-headers $(INSTALLMAN) $(INSTALLVHOOK)
81dcdc53 120
a4848db6 121ifeq ($(BUILD_SHARED),yes)
7d2f4546 122install-progs: $(PROGS) install-libs
a4848db6 123else
7d2f4546 124install-progs: $(PROGS)
a4848db6 125endif
951bf3e6 126 install -d "$(bindir)"
7d2f4546 127 install -c $(INSTALLSTRIP) -m 755 $(PROGS) "$(bindir)"
85f07f22 128
7a7be126 129# Create the Windows installer.
d35ff76b
FB
130wininstaller: all install
131 makensis ffinstall.nsi
132
23a65308 133install-man:
8233b750
DB
134 install -d "$(mandir)/man1"
135 install -m 644 $(MANPAGES) "$(mandir)/man1"
23a65308 136
aa99b8ff
MN
137install-vhook:
138 $(MAKE) -C vhook install
142fc6b9 139
b12f8273 140install-libs:
8b2121e3
MR
141 $(MAKE) -C libavutil install-libs
142 $(MAKE) -C libavcodec install-libs
143 $(MAKE) -C libavformat install-libs
1a9150b1 144ifeq ($(CONFIG_PP),yes)
6d9a2421 145 $(MAKE) -C libpostproc install-libs
1a9150b1 146endif
790c9ca7
LA
147ifeq ($(CONFIG_SWSCALER),yes)
148 $(MAKE) -C libswscale install-libs
149endif
150
8b2121e3 151ifeq ($(BUILD_SHARED),yes)
1e7ffa50 152 -$(LDCONFIG)
b12f8273 153endif
37736979 154
f29f3b5d
DB
155install-headers:
156 $(MAKE) -C libavutil install-headers
157 $(MAKE) -C libavcodec install-headers
158 $(MAKE) -C libavformat install-headers
1a9150b1 159ifeq ($(CONFIG_PP),yes)
6d9a2421 160 $(MAKE) -C libpostproc install-headers
1a9150b1 161endif
790c9ca7 162 $(MAKE) -C libswscale install-headers
f29f3b5d 163
f9edb717
DB
164uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
165
f9edb717
DB
166uninstall-progs:
167 rm -f $(addprefix $(bindir)/, $(ALLPROGS))
168
f9edb717 169uninstall-man:
f9edb717 170 rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
f9edb717
DB
171
172uninstall-vhook:
173 $(MAKE) -C vhook uninstall
174
175uninstall-libs:
176 $(MAKE) -C libavutil uninstall-libs
177 $(MAKE) -C libavcodec uninstall-libs
178 $(MAKE) -C libavformat uninstall-libs
6d9a2421 179 $(MAKE) -C libpostproc uninstall-libs
f9edb717
DB
180
181uninstall-headers:
182 $(MAKE) -C libavutil uninstall-headers
183 $(MAKE) -C libavcodec uninstall-headers
184 $(MAKE) -C libavformat uninstall-headers
6d9a2421 185 $(MAKE) -C libpostproc uninstall-headers
f9edb717
DB
186 -rmdir "$(incdir)"
187 -rmdir "$(prefix)/include/postproc"
188
354ca798 189depend dep: .depend
ea0f0681 190 $(MAKE) -C libavutil depend
5d22ccf7 191 $(MAKE) -C libavcodec depend
c80d990f 192 $(MAKE) -C libavformat depend
691c480e
DB
193ifeq ($(CONFIG_PP),yes)
194 $(MAKE) -C libpostproc depend
195endif
eaa6d7b6
DB
196ifeq ($(CONFIG_SWSCALER),yes)
197 $(MAKE) -C libswscale depend
198endif
d226c750 199ifeq ($(CONFIG_VHOOK),yes)
5d22ccf7 200 $(MAKE) -C vhook depend
811b32ed 201endif
4b8b2edb 202
fd071c26 203.depend: $(SRCS) version.h
0032cac2 204 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
57514323 205
da34f7ac
MR
206$(DEP_LIBS): lib
207
208.libs: $(DEP_LIBS)
209 touch $@
cf2818b0 210
98013cc1 211clean:
5d22ccf7
DB
212 $(MAKE) -C libavutil clean
213 $(MAKE) -C libavcodec clean
abac6175 214 $(MAKE) -C libavformat clean
6d9a2421 215 $(MAKE) -C libpostproc clean
790c9ca7 216 $(MAKE) -C libswscale clean
5d22ccf7
DB
217 $(MAKE) -C tests clean
218 $(MAKE) -C vhook clean
bf840994 219 $(MAKE) -C doc clean
3e4134f6
DB
220 rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
221 output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
142fc6b9 222
85f07f22 223distclean: clean
98013cc1
DB
224 $(MAKE) -C libavutil distclean
225 $(MAKE) -C libavcodec distclean
226 $(MAKE) -C libavformat distclean
6d9a2421 227 $(MAKE) -C libpostproc distclean
790c9ca7 228 $(MAKE) -C libswscale distclean
98013cc1
DB
229 $(MAKE) -C tests distclean
230 $(MAKE) -C vhook distclean
5c6a5d58 231 rm -f .depend version.h config.* *.pc
85f07f22
FB
232
233TAGS:
abac6175 234 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 235
dd9ca370
FB
236# regression tests
237
902d3c6d 238codectest libavtest test-server fulltest test mpeg4 mpeg: $(PROGS)
ec9fca31 239 $(MAKE) -C tests $@
dd9ca370 240
3263626f 241.PHONY: all lib videohook documentation install* wininstaller uninstall*
bedb3550 242.PHONY: dep depend clean distclean TAGS
3263626f 243.PHONY: codectest libavtest test-server fulltest test mpeg4 mpeg
cf2818b0 244
57514323
ZK
245ifneq ($(wildcard .depend),)
246include .depend
247endif