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