dct cleanup
[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
0fd94442
NK
39endif
40
57514323
ZK
41OBJS = ffmpeg.o ffserver.o
42SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
43
85f07f22
FB
44all: lib $(PROG)
45
46lib:
2cc8ae96
FB
47 $(MAKE) -C libavcodec all
48 $(MAKE) -C libav all
85f07f22 49
37736979 50ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS)
a1b63811
FB
51 $(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libav \
52 -lavformat -lavcodec $(EXTRALIBS)
85f07f22 53
37736979
FB
54ffmpeg$(EXE): ffmpeg_g$(EXE)
55 $(STRIP) -o $@ $<
56
a1b63811 57ffserver$(EXE): ffserver.o $(DEP_LIBS)
a43bd1d7
HT
58 $(CC) $(LDFLAGS) $(FFSLDFLAGS) \
59 -o $@ ffserver.o -L./libavcodec -L./libav \
37736979 60 -lavformat -lavcodec -ldl $(EXTRALIBS)
85f07f22 61
2744a37f
FB
62ffplay: ffmpeg$(EXE)
63 ln -sf $< $@
64
85f07f22 65%.o: %.c
daf8e955 66 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22
FB
67
68install: all
0fd94442 69 $(MAKE) -C libavcodec install
c1325d18 70 install -d $(prefix)/bin
980fc7b8 71 install -s -m 755 $(PROG) $(prefix)/bin
2744a37f 72 ln -sf ffmpeg $(prefix)/bin/ffplay
85f07f22 73
37736979
FB
74installlib:
75 $(MAKE) -C libavcodec installlib
76 $(MAKE) -C libav installlib
77
57514323
ZK
78dep: depend
79
80depend:
81 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
82
85f07f22 83clean:
2cc8ae96
FB
84 $(MAKE) -C libavcodec clean
85 $(MAKE) -C libav clean
dd9ca370 86 $(MAKE) -C tests clean
37736979 87 rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
85f07f22
FB
88
89distclean: clean
c72c6d2d 90 $(MAKE) -C libavcodec distclean
980fc7b8 91 rm -f config.mak config.h
85f07f22
FB
92
93TAGS:
94 etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
57514323 95
dd9ca370
FB
96# regression tests
97
4c41db9a 98libavtest test mpeg4 mpeg: ffmpeg$(EXE)
dd9ca370
FB
99 make -C tests $@
100
57514323
ZK
101ifneq ($(wildcard .depend),)
102include .depend
103endif