new generic FFT/MDCT code for audio codecs
[libav.git] / Makefile
1 #
2 # Main ffmpeg Makefile
3 # (c) 2000, 2001, 2002 Fabrice Bellard
4 #
5 include config.mak
6
7 VPATH=$(SRC_PATH)
8
9 CFLAGS= $(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
10 ifeq ($(CONFIG_DARWIN),yes)
11 LDFLAGS+= -g -d
12 FFSLDFLAGS= -Wl,-bind_at_load
13 else
14 LDFLAGS+= -g -Wl,--warn-common
15 FFSLDFLAGS= -Wl,-E
16 endif
17
18 ifeq ($(TARGET_GPROF),yes)
19 CFLAGS+=-p
20 LDFLAGS+=-p
21 endif
22
23 ifeq ($(CONFIG_WIN32),yes)
24 EXE=.exe
25 PROG=ffmpeg$(EXE)
26 else
27 EXT=
28 PROG=ffmpeg ffplay ffserver
29 endif
30
31
32 ifeq ($(BUILD_SHARED),yes)
33 DEP_LIBS=libavcodec/libavcodec.so libav/libavformat.a
34 else
35 DEP_LIBS=libavcodec/libavcodec.a libav/libavformat.a
36 ifeq ($(CONFIG_MP3LAME),yes)
37 EXTRALIBS+=-lmp3lame
38 endif
39 ifeq ($(CONFIG_VORBIS),yes)
40 EXTRALIBS+=-logg -lvorbis -lvorbisenc
41 endif
42 endif
43
44 OBJS = ffmpeg.o ffserver.o
45 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
46
47 all: lib $(PROG)
48
49 lib:
50 $(MAKE) -C libavcodec all
51 $(MAKE) -C libav all
52
53 ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS)
54 $(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libav \
55 -lavformat -lavcodec $(EXTRALIBS)
56
57 ffmpeg$(EXE): ffmpeg_g$(EXE)
58 $(STRIP) -o $@ $<
59
60 ffserver$(EXE): ffserver.o $(DEP_LIBS)
61 $(CC) $(LDFLAGS) $(FFSLDFLAGS) \
62 -o $@ ffserver.o -L./libavcodec -L./libav \
63 -lavformat -lavcodec -ldl $(EXTRALIBS)
64
65 ffplay: ffmpeg$(EXE)
66 ln -sf $< $@
67
68 %.o: %.c
69 $(CC) $(CFLAGS) -c -o $@ $<
70
71 install: all
72 $(MAKE) -C libavcodec install
73 install -d $(prefix)/bin
74 install -s -m 755 $(PROG) $(prefix)/bin
75 ln -sf ffmpeg $(prefix)/bin/ffplay
76
77 installlib:
78 $(MAKE) -C libavcodec installlib
79 $(MAKE) -C libav installlib
80
81 dep: depend
82
83 depend:
84 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
85
86 clean:
87 $(MAKE) -C libavcodec clean
88 $(MAKE) -C libav clean
89 $(MAKE) -C tests clean
90 rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
91
92 distclean: clean
93 $(MAKE) -C libavcodec distclean
94 rm -f config.mak config.h
95
96 TAGS:
97 etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
98
99 # regression tests
100
101 libavtest test mpeg4 mpeg: ffmpeg$(EXE)
102 make -C tests $@
103
104 ifneq ($(wildcard .depend),)
105 include .depend
106 endif