suppressed packet size dependancy
[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 LDFLAGS= -g
11 ifeq ($(TARGET_GPROF),yes)
12 CFLAGS+=-p
13 LDFLAGS+=-p
14 endif
15
16 ifeq ($(CONFIG_WIN32),yes)
17 EXE=.exe
18 PROG=ffmpeg$(EXE)
19 else
20 EXT=
21 PROG=ffmpeg ffplay ffserver
22 endif
23
24
25 ifeq ($(BUILD_SHARED),yes)
26 DEP_LIBS=libavcodec/libavcodec.so libav/libavformat.a
27 else
28 DEP_LIBS=libavcodec/libavcodec.a libav/libavformat.a
29 ifeq ($(CONFIG_MP3LAME),yes)
30 EXTRALIBS+=-lmp3lame
31 endif
32 endif
33
34 OBJS = ffmpeg.o ffserver.o
35 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
36
37 all: lib $(PROG)
38
39 lib:
40 $(MAKE) -C libavcodec all
41 $(MAKE) -C libav all
42
43 ffmpeg$(EXE): ffmpeg.o $(DEP_LIBS)
44 $(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libav \
45 -lavformat -lavcodec $(EXTRALIBS)
46
47 ffserver$(EXE): ffserver.o $(DEP_LIBS)
48 $(CC) $(LDFLAGS) -o $@ ffserver.o -L./libavcodec -L./libav \
49 -lavformat -lavcodec $(EXTRALIBS)
50
51 ffplay: ffmpeg$(EXE)
52 ln -sf $< $@
53
54 %.o: %.c
55 $(CC) $(CFLAGS) -c -o $@ $<
56
57 install: all
58 $(MAKE) -C libavcodec install
59 install -s -m 755 $(PROG) $(prefix)/bin
60 ln -sf ffmpeg $(prefix)/bin/ffplay
61
62 dep: depend
63
64 depend:
65 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
66
67 clean:
68 $(MAKE) -C libavcodec clean
69 $(MAKE) -C libav clean
70 $(MAKE) -C tests clean
71 rm -f *.o *~ .depend gmon.out TAGS $(PROG)
72
73 distclean: clean
74 $(MAKE) -C libavcodec distclean
75 rm -f config.mak config.h
76
77 TAGS:
78 etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
79
80 # regression tests
81
82 libavtest test mpeg4 mpeg: ffmpeg$(EXE)
83 make -C tests $@
84
85 ifneq ($(wildcard .depend),)
86 include .depend
87 endif