Use LC_ALL instead of LANG since the former overrides the latter.
[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
dd9ca370
FB
7VPATH=$(SRC_PATH)
8
f130fd46
DB
9CFLAGS=$(OPTFLAGS) -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
10 -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat \
4b65d88f 11 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
115329f1 12LDFLAGS+= -g
37736979 13
7d2f4546
DB
14MANPAGES=doc/ffmpeg.1
15PROGS_G+=ffmpeg_g$(EXESUF)
16PROGS+=ffmpeg$(EXESUF)
951bf3e6 17PROGTEST=output_example$(EXESUF)
38100e8c 18QTFASTSTART=qt-faststart$(EXESUF)
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)
426c31a1 29FFPLAY_O=ffplay.o
f3ec2d46 30endif
85f07f22 31
6b991cb2
DB
32BASENAMES=ffmpeg ffplay ffserver
33ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
34ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
35ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
36
dfdfa47c
FR
37ifeq ($(CONFIG_AUDIO_BEOS),yes)
38EXTRALIBS+=-lmedia -lbe
39endif
a1b63811 40
0fd94442 41ifeq ($(BUILD_SHARED),yes)
6bc114b2 42DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
0fd94442 43else
f3ec2d46 44DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
f02be79d
RS
45endif
46
142fc6b9
PG
47ifeq ($(BUILD_VHOOK),yes)
48VHOOK=videohook
49INSTALLVHOOK=install-vhook
47930f09 50endif
142fc6b9 51
146ea952
NB
52ifeq ($(BUILD_DOC),yes)
53DOC=documentation
54endif
55
426c31a1 56OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
57514323 57SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
5d38ba33
MR
58FFLIBDIRS = -L./libavformat -L./libavcodec -L./libavutil
59FFLIBS = -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF)
57514323 60
f1cc88a5 61all: version.h lib $(PROGS_G) $(PROGS) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
85f07f22 62
951bf3e6 63lib:
5d22ccf7
DB
64 $(MAKE) -C libavutil all
65 $(MAKE) -C libavcodec all
abac6175 66 $(MAKE) -C libavformat all
1a9150b1 67ifeq ($(CONFIG_PP),yes)
6d9a2421 68 $(MAKE) -C libpostproc all
1a9150b1 69endif
85f07f22 70
951bf3e6 71ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
5d38ba33 72 $(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
85f07f22 73
951bf3e6 74ffserver$(EXESUF): ffserver.o .libs
c536cb09 75 $(CC) $(FFLIBDIRS) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
85f07f22 76
951bf3e6 77ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
5d38ba33 78 $(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
01310af2 79
0cfd96cc 80%$(EXESUF): %_g$(EXESUF)
01310af2
FB
81 cp -p $< $@
82 $(STRIP) $@
83
f1cc88a5
DB
84.PHONY: version.h
85version.h:
54003e1a 86 $(SRC_PATH)/version.sh "$(SRC_PATH)"
f1cc88a5 87
951bf3e6 88output_example$(EXESUF): output_example.o .libs
5d38ba33 89 $(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
8de65d4f 90
38100e8c 91qt-faststart$(EXESUF): qt-faststart.c
95ca7c94 92 $(CC) $(CFLAGS) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
38100e8c 93
f7599d5f
AB
94cws2fws$(EXESUF): cws2fws.c
95 $(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
96
01310af2 97ffplay.o: ffplay.c
115329f1 98 $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
2744a37f 99
85f07f22 100%.o: %.c
115329f1 101 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 102
be12b2a4 103videohook: .libs
142fc6b9
PG
104 $(MAKE) -C vhook all
105
146ea952
NB
106documentation:
107 $(MAKE) -C doc all
108
d35ff76b
FB
109.PHONY: install
110
b12f8273 111install: install-progs install-libs install-headers install-man $(INSTALLVHOOK)
81dcdc53 112
a4848db6 113ifeq ($(BUILD_SHARED),yes)
7d2f4546 114install-progs: $(PROGS) install-libs
a4848db6 115else
7d2f4546 116install-progs: $(PROGS)
a4848db6 117endif
951bf3e6 118 install -d "$(bindir)"
7d2f4546 119 install -c $(INSTALLSTRIP) -m 755 $(PROGS) "$(bindir)"
85f07f22 120
d35ff76b
FB
121# create the window installer
122wininstaller: all install
123 makensis ffinstall.nsi
124
23a65308
FB
125# install man from source dir if available
126install-man:
2f30a81d 127ifneq ($(CONFIG_MINGW),yes)
8b8e1c55 128 if [ -f doc/ffmpeg.1 ] ; then \
aa99b8ff 129 install -d "$(mandir)/man1" ; \
7d2f4546 130 install -m 644 $(MANPAGES) "$(mandir)/man1" ; \
23a65308 131 fi
951bf3e6 132endif
23a65308 133
aa99b8ff
MN
134install-vhook:
135 $(MAKE) -C vhook install
142fc6b9 136
b12f8273 137install-libs:
8b2121e3
MR
138 $(MAKE) -C libavutil install-libs
139 $(MAKE) -C libavcodec install-libs
140 $(MAKE) -C libavformat install-libs
1a9150b1 141ifeq ($(CONFIG_PP),yes)
6d9a2421 142 $(MAKE) -C libpostproc install-libs
1a9150b1 143endif
8b2121e3 144ifeq ($(BUILD_SHARED),yes)
1e7ffa50 145 -$(LDCONFIG)
b12f8273 146endif
37736979 147
f29f3b5d
DB
148install-headers:
149 $(MAKE) -C libavutil install-headers
150 $(MAKE) -C libavcodec install-headers
151 $(MAKE) -C libavformat install-headers
1a9150b1 152ifeq ($(CONFIG_PP),yes)
6d9a2421 153 $(MAKE) -C libpostproc install-headers
1a9150b1 154endif
f29f3b5d 155
f9edb717
DB
156uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
157
f9edb717
DB
158uninstall-progs:
159 rm -f $(addprefix $(bindir)/, $(ALLPROGS))
160
f9edb717 161uninstall-man:
2f30a81d 162ifneq ($(CONFIG_MINGW),yes)
f9edb717
DB
163 rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
164endif
165
166uninstall-vhook:
167 $(MAKE) -C vhook uninstall
168
169uninstall-libs:
170 $(MAKE) -C libavutil uninstall-libs
171 $(MAKE) -C libavcodec uninstall-libs
172 $(MAKE) -C libavformat uninstall-libs
6d9a2421 173 $(MAKE) -C libpostproc uninstall-libs
f9edb717
DB
174
175uninstall-headers:
176 $(MAKE) -C libavutil uninstall-headers
177 $(MAKE) -C libavcodec uninstall-headers
178 $(MAKE) -C libavformat uninstall-headers
6d9a2421 179 $(MAKE) -C libpostproc uninstall-headers
f9edb717
DB
180 -rmdir "$(incdir)"
181 -rmdir "$(prefix)/include/postproc"
182
57514323
ZK
183dep: depend
184
4b8b2edb 185depend: .depend
ea0f0681 186 $(MAKE) -C libavutil depend
5d22ccf7 187 $(MAKE) -C libavcodec depend
c80d990f 188 $(MAKE) -C libavformat depend
811b32ed 189ifeq ($(BUILD_VHOOK),yes)
5d22ccf7 190 $(MAKE) -C vhook depend
811b32ed 191endif
4b8b2edb 192
fd071c26 193.depend: $(SRCS) version.h
148beec7 194 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
57514323 195
cf2818b0 196.libs: lib
127d5c8d 197 @test -f .libs || touch .libs
dea4953d 198 @for i in $(DEP_LIBS) ; do if test $$i -nt .libs ; then touch .libs; fi ; done
cf2818b0 199
98013cc1 200clean:
5d22ccf7
DB
201 $(MAKE) -C libavutil clean
202 $(MAKE) -C libavcodec clean
abac6175 203 $(MAKE) -C libavformat clean
6d9a2421 204 $(MAKE) -C libpostproc clean
5d22ccf7
DB
205 $(MAKE) -C tests clean
206 $(MAKE) -C vhook clean
bf840994 207 $(MAKE) -C doc clean
98013cc1 208 rm -f *.o *.d *~ .libs gmon.out TAGS \
6b991cb2 209 $(ALLPROGS) $(ALLPROGS_G) $(PROGTEST) $(QTFASTSTART)
142fc6b9 210
f255e0ab 211# Note well: config.log is NOT removed.
85f07f22 212distclean: clean
98013cc1
DB
213 $(MAKE) -C libavutil distclean
214 $(MAKE) -C libavcodec distclean
215 $(MAKE) -C libavformat distclean
6d9a2421 216 $(MAKE) -C libpostproc distclean
98013cc1
DB
217 $(MAKE) -C tests distclean
218 $(MAKE) -C vhook distclean
5c6a5d58 219 rm -f .depend version.h config.* *.pc
85f07f22
FB
220
221TAGS:
abac6175 222 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 223
dd9ca370
FB
224# regression tests
225
7d2f4546 226libavtest test mpeg4 mpeg test-server fulltest: $(PROGS)
ec9fca31 227 $(MAKE) -C tests $@
dd9ca370 228
ac977341 229# tar release (use 'make -k tar' on a checkouted tree)
951bf3e6
FB
230FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " libavcodec/avcodec.h | \
231 cut -d "\"" -f 2 )
ac977341
FB
232
233tar:
234 rm -rf /tmp/$(FILE)
235 cp -r . /tmp/$(FILE)
36b1b0bc 236 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude .svn )
ac977341
FB
237 rm -rf /tmp/$(FILE)
238
cf2818b0
ZK
239.PHONY: lib
240
57514323
ZK
241ifneq ($(wildcard .depend),)
242include .depend
243endif