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