lrintf detection (based upon a patch by Fran├žois Revol <revol at free dot fr>)
[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
eddbd7e5 9CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libav -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
90cee0c3
MN
10ifeq ($(CONFIG_DARWIN),yes)
11LDFLAGS+= -g -d
a43bd1d7 12FFSLDFLAGS= -Wl,-bind_at_load
90cee0c3 13else
37736979 14LDFLAGS+= -g -Wl,--warn-common
a43bd1d7 15FFSLDFLAGS= -Wl,-E
90cee0c3 16endif
37736979 17
980fc7b8 18ifeq ($(TARGET_GPROF),yes)
85f07f22
FB
19CFLAGS+=-p
20LDFLAGS+=-p
21endif
22
daf8e955
FB
23ifeq ($(CONFIG_WIN32),yes)
24EXE=.exe
25PROG=ffmpeg$(EXE)
26else
27EXT=
2744a37f 28PROG=ffmpeg ffplay ffserver
daf8e955 29endif
85f07f22 30
a1b63811 31
0fd94442 32ifeq ($(BUILD_SHARED),yes)
a1b63811 33DEP_LIBS=libavcodec/libavcodec.so libav/libavformat.a
0fd94442 34else
a1b63811 35DEP_LIBS=libavcodec/libavcodec.a libav/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
57514323
ZK
44OBJS = ffmpeg.o ffserver.o
45SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
46
85f07f22
FB
47all: lib $(PROG)
48
49lib:
2cc8ae96
FB
50 $(MAKE) -C libavcodec all
51 $(MAKE) -C libav all
85f07f22 52
37736979 53ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS)
a1b63811
FB
54 $(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libav \
55 -lavformat -lavcodec $(EXTRALIBS)
85f07f22 56
37736979 57ffmpeg$(EXE): ffmpeg_g$(EXE)
fcd43156 58 cp -p $< $@ ; $(STRIP) $@
37736979 59
a1b63811 60ffserver$(EXE): ffserver.o $(DEP_LIBS)
a43bd1d7
HT
61 $(CC) $(LDFLAGS) $(FFSLDFLAGS) \
62 -o $@ ffserver.o -L./libavcodec -L./libav \
37736979 63 -lavformat -lavcodec -ldl $(EXTRALIBS)
85f07f22 64
2744a37f
FB
65ffplay: ffmpeg$(EXE)
66 ln -sf $< $@
67
85f07f22 68%.o: %.c
daf8e955 69 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22
FB
70
71install: all
0fd94442 72 $(MAKE) -C libavcodec install
c1325d18 73 install -d $(prefix)/bin
980fc7b8 74 install -s -m 755 $(PROG) $(prefix)/bin
2744a37f 75 ln -sf ffmpeg $(prefix)/bin/ffplay
85f07f22 76
37736979
FB
77installlib:
78 $(MAKE) -C libavcodec installlib
79 $(MAKE) -C libav installlib
80
57514323
ZK
81dep: depend
82
83depend:
84 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
85
85f07f22 86clean:
2cc8ae96
FB
87 $(MAKE) -C libavcodec clean
88 $(MAKE) -C libav clean
dd9ca370 89 $(MAKE) -C tests clean
37736979 90 rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
85f07f22
FB
91
92distclean: clean
c72c6d2d 93 $(MAKE) -C libavcodec distclean
980fc7b8 94 rm -f config.mak config.h
85f07f22
FB
95
96TAGS:
97 etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
57514323 98
dd9ca370
FB
99# regression tests
100
4c41db9a 101libavtest test mpeg4 mpeg: ffmpeg$(EXE)
dd9ca370
FB
102 make -C tests $@
103
57514323
ZK
104ifneq ($(wildcard .depend),)
105include .depend
106endif