Building ffmpeg with gcc-2.95.3 encountered a problem due to C99 initialization fix...
[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)
f3ec2d46 42DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
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
c1325d18 112 install -d $(prefix)/bin
fbd8bb7e 113 install -c -s -m 755 $(PROG) $(prefix)/bin
85f07f22 114
142fc6b9
PG
115install-vhook: $(prefix)/lib/vhook
116 $(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
117
118$(prefix)/lib/vhook:
4baca069 119 install -d $@
142fc6b9 120
37736979
FB
121installlib:
122 $(MAKE) -C libavcodec installlib
abac6175 123 $(MAKE) -C libavformat installlib
37736979 124
57514323
ZK
125dep: depend
126
4b8b2edb 127depend: .depend
811b32ed
FB
128 make -C libavcodec depend
129 make -C libavformat depend
130ifeq ($(BUILD_VHOOK),yes)
131 make -C vhook depend
132endif
4b8b2edb
FB
133
134.depend: $(SRCS)
135 $(CC) -MM $(CFLAGS) $^ 1>.depend
57514323 136
cf2818b0 137.libs: lib
127d5c8d 138 @test -f .libs || touch .libs
6e023978 139 @for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
cf2818b0 140
bc634f6f 141clean: $(CLEANVHOOK)
2cc8ae96 142 $(MAKE) -C libavcodec clean
abac6175 143 $(MAKE) -C libavformat clean
dd9ca370 144 $(MAKE) -C tests clean
01310af2 145 rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXE) ffplay_g$(EXE) $(PROG)
85f07f22 146
142fc6b9
PG
147clean-vhook:
148 $(MAKE) -C vhook clean
149
85f07f22 150distclean: clean
c72c6d2d 151 $(MAKE) -C libavcodec distclean
980fc7b8 152 rm -f config.mak config.h
85f07f22
FB
153
154TAGS:
abac6175 155 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 156
dd9ca370
FB
157# regression tests
158
4c41db9a 159libavtest test mpeg4 mpeg: ffmpeg$(EXE)
00df1301 160 $(MAKE) all -C tests $@
dd9ca370 161
ac977341
FB
162# tar release (use 'make -k tar' on a checkouted tree)
163FILE=ffmpeg-$(shell cat VERSION)
164
165tar:
166 rm -rf /tmp/$(FILE)
167 cp -r . /tmp/$(FILE)
168 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
169 rm -rf /tmp/$(FILE)
170
cf2818b0
ZK
171.PHONY: lib
172
57514323
ZK
173ifneq ($(wildcard .depend),)
174include .depend
175endif