set keyframe flag at a more central place instead of in every demuxer for containers...
[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
cf9d24ad 9CFLAGS=$(OPTFLAGS) -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
4baca069 10LDFLAGS+= -g
37736979 11
980fc7b8 12ifeq ($(TARGET_GPROF),yes)
85f07f22
FB
13CFLAGS+=-p
14LDFLAGS+=-p
15endif
16
bbec50d7 17MANPAGE=$(SRC_PATH)/doc/ffmpeg.1
951bf3e6
FB
18PROG=ffmpeg$(EXESUF)
19PROGTEST=output_example$(EXESUF)
38100e8c 20QTFASTSTART=qt-faststart$(EXESUF)
01310af2
FB
21
22ifeq ($(CONFIG_FFSERVER),yes)
bbec50d7 23MANPAGE+=$(SRC_PATH)/doc/ffserver.1
951bf3e6 24PROG+=ffserver$(EXESUF)
01310af2
FB
25endif
26
27ifeq ($(CONFIG_FFPLAY),yes)
bbec50d7 28MANPAGE+=$(SRC_PATH)/doc/ffplay.1
951bf3e6 29PROG+=ffplay$(EXESUF)
426c31a1 30FFPLAY_O=ffplay.o
f3ec2d46 31endif
85f07f22 32
dfdfa47c
FR
33ifeq ($(CONFIG_AUDIO_BEOS),yes)
34EXTRALIBS+=-lmedia -lbe
35endif
a1b63811 36
0fd94442 37ifeq ($(BUILD_SHARED),yes)
6bc114b2 38DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
0fd94442 39else
f3ec2d46 40DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
a6741398
J
41ifeq ($(CONFIG_MP3LAME),yes)
42EXTRALIBS+=-lmp3lame
43endif
d1db8623
FR
44endif
45
81e0d0b4 46ifeq ($(CONFIG_VORBIS),yes)
2b50a5a8 47EXTRALIBS+=-lvorbis -lvorbisenc -logg
81e0d0b4 48endif
0fd94442 49
445ad18d
ZK
50ifeq ($(CONFIG_FAAD),yes)
51ifeq ($(CONFIG_FAADBIN),yes)
52# no libs needed
53else
54EXTRALIBS += -lfaad
55endif
56endif
57
29d48296
MN
58ifeq ($(CONFIG_FAAC),yes)
59EXTRALIBS+=-lfaac
60endif
61
1ddadfa9
AT
62ifeq ($(CONFIG_XVID),yes)
63EXTRALIBS+=-lxvidcore
64endif
65
142fc6b9
PG
66ifeq ($(BUILD_VHOOK),yes)
67VHOOK=videohook
68INSTALLVHOOK=install-vhook
69CLEANVHOOK=clean-vhook
47930f09 70endif
142fc6b9 71
6e023978
RS
72ifeq ($(TARGET_OS), SunOS)
73TEST=/usr/bin/test
74else
75TEST=test
76endif
77
146ea952
NB
78ifeq ($(BUILD_DOC),yes)
79DOC=documentation
80endif
81
426c31a1 82OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
57514323 83SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
cf2818b0 84FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
57514323 85
146ea952 86all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
85f07f22 87
951bf3e6 88lib:
2cc8ae96 89 $(MAKE) -C libavcodec all
abac6175 90 $(MAKE) -C libavformat all
85f07f22 91
951bf3e6 92ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
01310af2 93 $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
85f07f22 94
951bf3e6 95ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
f3ec2d46
SG
96 cp -p $< $@
97 $(STRIP) $@
37736979 98
951bf3e6 99ffserver$(EXESUF): ffserver.o .libs
cf2818b0 100 $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
85f07f22 101
951bf3e6 102ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
01310af2
FB
103 $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
104
951bf3e6 105ffplay$(EXESUF): ffplay_g$(EXESUF)
01310af2
FB
106 cp -p $< $@
107 $(STRIP) $@
108
951bf3e6 109output_example$(EXESUF): output_example.o .libs
8de65d4f
FB
110 $(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
111
38100e8c 112qt-faststart$(EXESUF): qt-faststart.c
426c31a1 113 $(CC) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
38100e8c 114
f7599d5f
AB
115cws2fws$(EXESUF): cws2fws.c
116 $(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
117
01310af2
FB
118ffplay.o: ffplay.c
119 $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
2744a37f 120
85f07f22 121%.o: %.c
daf8e955 122 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 123
be12b2a4 124videohook: .libs
142fc6b9
PG
125 $(MAKE) -C vhook all
126
146ea952
NB
127documentation:
128 $(MAKE) -C doc all
129
d35ff76b
FB
130.PHONY: install
131
23a65308 132install: all install-man $(INSTALLVHOOK)
0fd94442 133 $(MAKE) -C libavcodec install
6bc114b2 134 $(MAKE) -C libavformat install
951bf3e6 135 install -d "$(bindir)"
65d1bea2 136 install -c $(INSTALLSTRIP) -m 755 $(PROG) "$(bindir)"
85f07f22 137
d35ff76b
FB
138# create the window installer
139wininstaller: all install
140 makensis ffinstall.nsi
141
23a65308
FB
142# install man from source dir if available
143install-man:
951bf3e6 144ifneq ($(CONFIG_WIN32),yes)
23a65308 145 if [ -f $(SRC_PATH)/doc/ffmpeg.1 ] ; then \
aa99b8ff
MN
146 install -d "$(mandir)/man1" ; \
147 install -m 644 $(MANPAGE) "$(mandir)/man1" ; \
23a65308 148 fi
951bf3e6 149endif
23a65308 150
aa99b8ff
MN
151install-vhook:
152 $(MAKE) -C vhook install
142fc6b9 153
37736979
FB
154installlib:
155 $(MAKE) -C libavcodec installlib
abac6175 156 $(MAKE) -C libavformat installlib
37736979 157
57514323
ZK
158dep: depend
159
4b8b2edb 160depend: .depend
811b32ed
FB
161 make -C libavcodec depend
162 make -C libavformat depend
163ifeq ($(BUILD_VHOOK),yes)
164 make -C vhook depend
165endif
4b8b2edb
FB
166
167.depend: $(SRCS)
148beec7 168 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
57514323 169
cf2818b0 170.libs: lib
127d5c8d 171 @test -f .libs || touch .libs
6e023978 172 @for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
cf2818b0 173
bc634f6f 174clean: $(CLEANVHOOK)
2cc8ae96 175 $(MAKE) -C libavcodec clean
abac6175 176 $(MAKE) -C libavformat clean
dd9ca370 177 $(MAKE) -C tests clean
2c735779
ZK
178 rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXESUF) \
179 ffplay_g$(EXESUF) $(PROG) $(PROGTEST) $(QTFASTSTART)
85f07f22 180
142fc6b9
PG
181clean-vhook:
182 $(MAKE) -C vhook clean
183
f255e0ab 184# Note well: config.log is NOT removed.
85f07f22 185distclean: clean
c72c6d2d 186 $(MAKE) -C libavcodec distclean
980fc7b8 187 rm -f config.mak config.h
85f07f22
FB
188
189TAGS:
abac6175 190 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 191
dd9ca370
FB
192# regression tests
193
951bf3e6 194libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXESUF)
ec9fca31 195 $(MAKE) -C tests $@
dd9ca370 196
ac977341 197# tar release (use 'make -k tar' on a checkouted tree)
951bf3e6
FB
198FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " libavcodec/avcodec.h | \
199 cut -d "\"" -f 2 )
ac977341
FB
200
201tar:
202 rm -rf /tmp/$(FILE)
203 cp -r . /tmp/$(FILE)
204 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
205 rm -rf /tmp/$(FILE)
206
cf2818b0
ZK
207.PHONY: lib
208
57514323
ZK
209ifneq ($(wildcard .depend),)
210include .depend
211endif