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