SDL probe - ffplay build option
[libav.git] / Makefile
CommitLineData
a1b63811 1#
85f07f22 2# Main ffmpeg Makefile
a1b63811 3# (c) 2000, 2001, 2002 Fabrice Bellard
85f07f22 4#
980fc7b8 5include config.mak
85f07f22 6
dd9ca370
FB
7VPATH=$(SRC_PATH)
8
abac6175 9CFLAGS= $(OPTFLAGS) -Wall -g -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
daf8e955
FB
17ifeq ($(CONFIG_WIN32),yes)
18EXE=.exe
19PROG=ffmpeg$(EXE)
20else
f3ec2d46
SG
21ifeq ($(CONFIG_OS2),yes)
22EXE=.exe
23PROG=ffmpeg$(EXE)
24else
25EXE=
8154d2e0
FB
26PROG=ffmpeg ffplay
27ifeq ($(CONFIG_FFSERVER),yes)
28PROG+=ffserver
29endif
daf8e955 30endif
f3ec2d46 31endif
85f07f22 32
dfdfa47c
FR
33ifeq ($(CONFIG_AUDIO_BEOS),yes)
34EXTRALIBS+=-lmedia -lbe
35endif
a1b63811 36
0fd94442 37ifeq ($(BUILD_SHARED),yes)
f3ec2d46 38DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
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
81e0d0b4
MH
46ifeq ($(CONFIG_VORBIS),yes)
47EXTRALIBS+=-logg -lvorbis -lvorbisenc
48endif
0fd94442 49
445ad18d
ZK
50ifeq ($(CONFIG_FAAD),yes)
51ifeq ($(CONFIG_FAADBIN),yes)
52# no libs needed
53else
54EXTRALIBS += -lfaad
55endif
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
57514323
ZK
70OBJS = ffmpeg.o ffserver.o
71SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
cf2818b0 72FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
57514323 73
142fc6b9 74all: lib $(PROG) $(VHOOK)
85f07f22 75
891f64b3 76lib: $(AMRLIBS)
2cc8ae96 77 $(MAKE) -C libavcodec all
abac6175 78 $(MAKE) -C libavformat all
85f07f22 79
891f64b3 80
cf2818b0
ZK
81ffmpeg_g$(EXE): ffmpeg.o .libs
82 $(CC) $(LDFLAGS) -o $@ ffmpeg.o $(FFLIBS) $(EXTRALIBS)
85f07f22 83
37736979 84ffmpeg$(EXE): ffmpeg_g$(EXE)
f3ec2d46
SG
85 cp -p $< $@
86 $(STRIP) $@
37736979 87
cf2818b0
ZK
88ffserver$(EXE): ffserver.o .libs
89 $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
85f07f22 90
2744a37f
FB
91ffplay: ffmpeg$(EXE)
92 ln -sf $< $@
93
85f07f22 94%.o: %.c
daf8e955 95 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 96
be12b2a4 97videohook: .libs
142fc6b9
PG
98 $(MAKE) -C vhook all
99
100install: all $(INSTALLVHOOK)
0fd94442 101 $(MAKE) -C libavcodec install
c1325d18 102 install -d $(prefix)/bin
fbd8bb7e 103 install -c -s -m 755 $(PROG) $(prefix)/bin
2744a37f 104 ln -sf ffmpeg $(prefix)/bin/ffplay
85f07f22 105
142fc6b9
PG
106install-vhook: $(prefix)/lib/vhook
107 $(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
108
109$(prefix)/lib/vhook:
4baca069 110 install -d $@
142fc6b9 111
37736979
FB
112installlib:
113 $(MAKE) -C libavcodec installlib
abac6175 114 $(MAKE) -C libavformat installlib
37736979 115
57514323
ZK
116dep: depend
117
4b8b2edb 118depend: .depend
811b32ed
FB
119 make -C libavcodec depend
120 make -C libavformat depend
121ifeq ($(BUILD_VHOOK),yes)
122 make -C vhook depend
123endif
4b8b2edb
FB
124
125.depend: $(SRCS)
126 $(CC) -MM $(CFLAGS) $^ 1>.depend
57514323 127
cf2818b0 128.libs: lib
127d5c8d 129 @test -f .libs || touch .libs
6e023978 130 @for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
cf2818b0 131
bc634f6f 132clean: $(CLEANVHOOK)
2cc8ae96 133 $(MAKE) -C libavcodec clean
abac6175 134 $(MAKE) -C libavformat clean
dd9ca370 135 $(MAKE) -C tests clean
cf2818b0 136 rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
85f07f22 137
142fc6b9
PG
138clean-vhook:
139 $(MAKE) -C vhook clean
140
85f07f22 141distclean: clean
c72c6d2d 142 $(MAKE) -C libavcodec distclean
980fc7b8 143 rm -f config.mak config.h
85f07f22
FB
144
145TAGS:
abac6175 146 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 147
dd9ca370
FB
148# regression tests
149
4c41db9a 150libavtest test mpeg4 mpeg: ffmpeg$(EXE)
00df1301 151 $(MAKE) all -C tests $@
dd9ca370 152
ac977341
FB
153# tar release (use 'make -k tar' on a checkouted tree)
154FILE=ffmpeg-$(shell cat VERSION)
155
156tar:
157 rm -rf /tmp/$(FILE)
158 cp -r . /tmp/$(FILE)
159 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
160 rm -rf /tmp/$(FILE)
161
cf2818b0
ZK
162.PHONY: lib
163
57514323
ZK
164ifneq ($(wildcard .depend),)
165include .depend
166endif