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