gmc1
[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
21EXT=
8154d2e0
FB
22PROG=ffmpeg ffplay
23ifeq ($(CONFIG_FFSERVER),yes)
24PROG+=ffserver
25endif
daf8e955 26endif
85f07f22 27
dfdfa47c
FR
28ifeq ($(CONFIG_AUDIO_BEOS),yes)
29EXTRALIBS+=-lmedia -lbe
30endif
a1b63811 31
0fd94442 32ifeq ($(BUILD_SHARED),yes)
abac6175 33DEP_LIBS=libavcodec/libavcodec.so libavformat/libavformat.a
0fd94442 34else
abac6175 35DEP_LIBS=libavcodec/libavcodec.a libavformat/libavformat.a
a6741398
J
36ifeq ($(CONFIG_MP3LAME),yes)
37EXTRALIBS+=-lmp3lame
38endif
81e0d0b4
MH
39ifeq ($(CONFIG_VORBIS),yes)
40EXTRALIBS+=-logg -lvorbis -lvorbisenc
41endif
0fd94442
NK
42endif
43
142fc6b9
PG
44ifeq ($(BUILD_VHOOK),yes)
45VHOOK=videohook
46INSTALLVHOOK=install-vhook
47CLEANVHOOK=clean-vhook
47930f09 48endif
142fc6b9 49
57514323
ZK
50OBJS = ffmpeg.o ffserver.o
51SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
52
142fc6b9 53all: lib $(PROG) $(VHOOK)
85f07f22
FB
54
55lib:
2cc8ae96 56 $(MAKE) -C libavcodec all
abac6175 57 $(MAKE) -C libavformat all
85f07f22 58
37736979 59ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS)
abac6175 60 $(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libavformat \
a1b63811 61 -lavformat -lavcodec $(EXTRALIBS)
85f07f22 62
37736979 63ffmpeg$(EXE): ffmpeg_g$(EXE)
fcd43156 64 cp -p $< $@ ; $(STRIP) $@
37736979 65
a1b63811 66ffserver$(EXE): ffserver.o $(DEP_LIBS)
a43bd1d7 67 $(CC) $(LDFLAGS) $(FFSLDFLAGS) \
abac6175 68 -o $@ ffserver.o -L./libavcodec -L./libavformat \
9c938e77 69 -lavformat -lavcodec $(EXTRALIBS)
85f07f22 70
2744a37f
FB
71ffplay: ffmpeg$(EXE)
72 ln -sf $< $@
73
85f07f22 74%.o: %.c
daf8e955 75 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 76
142fc6b9
PG
77videohook:
78 $(MAKE) -C vhook all
79
80install: all $(INSTALLVHOOK)
0fd94442 81 $(MAKE) -C libavcodec install
c1325d18 82 install -d $(prefix)/bin
fbd8bb7e 83 install -c -s -m 755 $(PROG) $(prefix)/bin
2744a37f 84 ln -sf ffmpeg $(prefix)/bin/ffplay
85f07f22 85
142fc6b9
PG
86install-vhook: $(prefix)/lib/vhook
87 $(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
88
89$(prefix)/lib/vhook:
4baca069 90 install -d $@
142fc6b9 91
37736979
FB
92installlib:
93 $(MAKE) -C libavcodec installlib
abac6175 94 $(MAKE) -C libavformat installlib
37736979 95
57514323
ZK
96dep: depend
97
98depend:
99 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
100
142fc6b9 101clean: $(CLEANVHOOK)
2cc8ae96 102 $(MAKE) -C libavcodec clean
abac6175 103 $(MAKE) -C libavformat clean
dd9ca370 104 $(MAKE) -C tests clean
37736979 105 rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
85f07f22 106
142fc6b9
PG
107clean-vhook:
108 $(MAKE) -C vhook clean
109
85f07f22 110distclean: clean
c72c6d2d 111 $(MAKE) -C libavcodec distclean
980fc7b8 112 rm -f config.mak config.h
85f07f22
FB
113
114TAGS:
abac6175 115 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 116
dd9ca370
FB
117# regression tests
118
4c41db9a 119libavtest test mpeg4 mpeg: ffmpeg$(EXE)
9c938e77 120 $(MAKE) -C tests $@
dd9ca370 121
ac977341
FB
122# tar release (use 'make -k tar' on a checkouted tree)
123FILE=ffmpeg-$(shell cat VERSION)
124
125tar:
126 rm -rf /tmp/$(FILE)
127 cp -r . /tmp/$(FILE)
128 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
129 rm -rf /tmp/$(FILE)
130
57514323
ZK
131ifneq ($(wildcard .depend),)
132include .depend
133endif