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