* skiping unwanted packets when it's possible
[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
37736979
FB
10LDFLAGS+= -g -Wl,--warn-common
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=
2744a37f 22PROG=ffmpeg ffplay ffserver
daf8e955 23endif
85f07f22 24
a1b63811 25
0fd94442 26ifeq ($(BUILD_SHARED),yes)
a1b63811 27DEP_LIBS=libavcodec/libavcodec.so libav/libavformat.a
0fd94442 28else
a1b63811 29DEP_LIBS=libavcodec/libavcodec.a libav/libavformat.a
a6741398
J
30ifeq ($(CONFIG_MP3LAME),yes)
31EXTRALIBS+=-lmp3lame
32endif
0fd94442
NK
33endif
34
57514323
ZK
35OBJS = ffmpeg.o ffserver.o
36SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
37
85f07f22
FB
38all: lib $(PROG)
39
40lib:
2cc8ae96
FB
41 $(MAKE) -C libavcodec all
42 $(MAKE) -C libav all
85f07f22 43
37736979 44ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS)
a1b63811
FB
45 $(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libav \
46 -lavformat -lavcodec $(EXTRALIBS)
85f07f22 47
37736979
FB
48ffmpeg$(EXE): ffmpeg_g$(EXE)
49 $(STRIP) -o $@ $<
50
a1b63811 51ffserver$(EXE): ffserver.o $(DEP_LIBS)
37736979
FB
52 $(CC) $(LDFLAGS) -Wl,-E -o $@ ffserver.o -L./libavcodec -L./libav \
53 -lavformat -lavcodec -ldl $(EXTRALIBS)
85f07f22 54
2744a37f
FB
55ffplay: ffmpeg$(EXE)
56 ln -sf $< $@
57
85f07f22 58%.o: %.c
daf8e955 59 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22
FB
60
61install: all
0fd94442 62 $(MAKE) -C libavcodec install
980fc7b8 63 install -s -m 755 $(PROG) $(prefix)/bin
2744a37f 64 ln -sf ffmpeg $(prefix)/bin/ffplay
85f07f22 65
37736979
FB
66installlib:
67 $(MAKE) -C libavcodec installlib
68 $(MAKE) -C libav installlib
69
57514323
ZK
70dep: depend
71
72depend:
73 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
74
85f07f22 75clean:
2cc8ae96
FB
76 $(MAKE) -C libavcodec clean
77 $(MAKE) -C libav clean
dd9ca370 78 $(MAKE) -C tests clean
37736979 79 rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
85f07f22
FB
80
81distclean: clean
c72c6d2d 82 $(MAKE) -C libavcodec distclean
980fc7b8 83 rm -f config.mak config.h
85f07f22
FB
84
85TAGS:
86 etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
57514323 87
dd9ca370
FB
88# regression tests
89
4c41db9a 90libavtest test mpeg4 mpeg: ffmpeg$(EXE)
dd9ca370
FB
91 make -C tests $@
92
57514323
ZK
93ifneq ($(wildcard .depend),)
94include .depend
95endif