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