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