10l in implicit_weight_table
[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
8b8e1c55 17MANPAGE=doc/ffmpeg.1
951bf3e6
FB
18PROG=ffmpeg$(EXESUF)
19PROGTEST=output_example$(EXESUF)
38100e8c 20QTFASTSTART=qt-faststart$(EXESUF)
01310af2
FB
21
22ifeq ($(CONFIG_FFSERVER),yes)
8b8e1c55 23MANPAGE+=doc/ffserver.1
951bf3e6 24PROG+=ffserver$(EXESUF)
01310af2
FB
25endif
26
27ifeq ($(CONFIG_FFPLAY),yes)
8b8e1c55 28MANPAGE+=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
f02be79d
RS
66ifeq ($(CONFIG_DC1394),yes)
67EXTRALIBS+=-ldc1394_control -lraw1394
68endif
69
142fc6b9
PG
70ifeq ($(BUILD_VHOOK),yes)
71VHOOK=videohook
72INSTALLVHOOK=install-vhook
73CLEANVHOOK=clean-vhook
47930f09 74endif
142fc6b9 75
6e023978
RS
76ifeq ($(TARGET_OS), SunOS)
77TEST=/usr/bin/test
78else
79TEST=test
80endif
81
146ea952
NB
82ifeq ($(BUILD_DOC),yes)
83DOC=documentation
84endif
85
426c31a1 86OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
57514323 87SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
cf2818b0 88FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
57514323 89
146ea952 90all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
85f07f22 91
951bf3e6 92lib:
2cc8ae96 93 $(MAKE) -C libavcodec all
abac6175 94 $(MAKE) -C libavformat all
85f07f22 95
951bf3e6 96ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
01310af2 97 $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
85f07f22 98
951bf3e6 99ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
f3ec2d46
SG
100 cp -p $< $@
101 $(STRIP) $@
37736979 102
951bf3e6 103ffserver$(EXESUF): ffserver.o .libs
cf2818b0 104 $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
85f07f22 105
951bf3e6 106ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
01310af2
FB
107 $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
108
951bf3e6 109ffplay$(EXESUF): ffplay_g$(EXESUF)
01310af2
FB
110 cp -p $< $@
111 $(STRIP) $@
112
951bf3e6 113output_example$(EXESUF): output_example.o .libs
8de65d4f
FB
114 $(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
115
38100e8c 116qt-faststart$(EXESUF): qt-faststart.c
426c31a1 117 $(CC) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
38100e8c 118
f7599d5f
AB
119cws2fws$(EXESUF): cws2fws.c
120 $(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
121
01310af2
FB
122ffplay.o: ffplay.c
123 $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
2744a37f 124
85f07f22 125%.o: %.c
daf8e955 126 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 127
be12b2a4 128videohook: .libs
142fc6b9
PG
129 $(MAKE) -C vhook all
130
146ea952
NB
131documentation:
132 $(MAKE) -C doc all
133
d35ff76b
FB
134.PHONY: install
135
23a65308 136install: all install-man $(INSTALLVHOOK)
0fd94442 137 $(MAKE) -C libavcodec install
6bc114b2 138 $(MAKE) -C libavformat install
951bf3e6 139 install -d "$(bindir)"
65d1bea2 140 install -c $(INSTALLSTRIP) -m 755 $(PROG) "$(bindir)"
85f07f22 141
d35ff76b
FB
142# create the window installer
143wininstaller: all install
144 makensis ffinstall.nsi
145
23a65308
FB
146# install man from source dir if available
147install-man:
951bf3e6 148ifneq ($(CONFIG_WIN32),yes)
8b8e1c55 149 if [ -f doc/ffmpeg.1 ] ; then \
aa99b8ff
MN
150 install -d "$(mandir)/man1" ; \
151 install -m 644 $(MANPAGE) "$(mandir)/man1" ; \
23a65308 152 fi
951bf3e6 153endif
23a65308 154
aa99b8ff
MN
155install-vhook:
156 $(MAKE) -C vhook install
142fc6b9 157
37736979
FB
158installlib:
159 $(MAKE) -C libavcodec installlib
abac6175 160 $(MAKE) -C libavformat installlib
37736979 161
57514323
ZK
162dep: depend
163
4b8b2edb 164depend: .depend
811b32ed
FB
165 make -C libavcodec depend
166 make -C libavformat depend
167ifeq ($(BUILD_VHOOK),yes)
168 make -C vhook depend
169endif
4b8b2edb
FB
170
171.depend: $(SRCS)
148beec7 172 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
57514323 173
cf2818b0 174.libs: lib
127d5c8d 175 @test -f .libs || touch .libs
6e023978 176 @for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
cf2818b0 177
bc634f6f 178clean: $(CLEANVHOOK)
2cc8ae96 179 $(MAKE) -C libavcodec clean
abac6175 180 $(MAKE) -C libavformat clean
dd9ca370 181 $(MAKE) -C tests clean
2c735779
ZK
182 rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXESUF) \
183 ffplay_g$(EXESUF) $(PROG) $(PROGTEST) $(QTFASTSTART)
85f07f22 184
142fc6b9
PG
185clean-vhook:
186 $(MAKE) -C vhook clean
187
f255e0ab 188# Note well: config.log is NOT removed.
85f07f22 189distclean: clean
c72c6d2d 190 $(MAKE) -C libavcodec distclean
980fc7b8 191 rm -f config.mak config.h
85f07f22
FB
192
193TAGS:
abac6175 194 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 195
dd9ca370
FB
196# regression tests
197
951bf3e6 198libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXESUF)
ec9fca31 199 $(MAKE) -C tests $@
dd9ca370 200
ac977341 201# tar release (use 'make -k tar' on a checkouted tree)
951bf3e6
FB
202FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " libavcodec/avcodec.h | \
203 cut -d "\"" -f 2 )
ac977341
FB
204
205tar:
206 rm -rf /tmp/$(FILE)
207 cp -r . /tmp/$(FILE)
208 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
209 rm -rf /tmp/$(FILE)
210
cf2818b0
ZK
211.PHONY: lib
212
57514323
ZK
213ifneq ($(wildcard .depend),)
214include .depend
215endif