* cleanup
[libav.git] / Makefile
1 # Main ffmpeg Makefile
2 # (c) 2000, 2001 Gerard Lantau
3 #
4 include config.mak
5
6 CFLAGS= $(OPTFLAGS) -Wall -g -I./libavcodec -I./libav
7 LDFLAGS= -g
8 ifeq ($(TARGET_GPROF),yes)
9 CFLAGS+=-p
10 LDFLAGS+=-p
11 endif
12
13 ifeq ($(CONFIG_WIN32),yes)
14 EXE=.exe
15 PROG=ffmpeg$(EXE)
16 else
17 EXT=
18 PROG=ffmpeg ffplay ffserver
19 endif
20
21 ifeq ($(BUILD_SHARED),yes)
22 FFMPEG_LIB=-Llibavcodec -lffmpeg
23 DEP_FFMPEG_LIB=
24 else
25 FFMPEG_LIB=libavcodec/libavcodec.a
26 DEP_FFMPEG_LIB=libavcodec/libavcodec.a
27 ifeq ($(CONFIG_MP3LAME),yes)
28 EXTRALIBS+=-lmp3lame
29 endif
30 endif
31
32 OBJS = ffmpeg.o ffserver.o
33 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
34
35 all: lib $(PROG)
36
37 lib:
38 $(MAKE) -C libavcodec all
39 $(MAKE) -C libav all
40
41 ffmpeg$(EXE): ffmpeg.o libav/libav.a $(DEP_FFMPEG_LIB)
42 $(CC) $(LDFLAGS) $(EXTRALIBS) -o $@ $^ $(FFMPEG_LIB)
43
44 ffserver$(EXE): ffserver.o libav/libav.a $(DEP_FFMPEG_LIB)
45 $(CC) $(LDFLAGS) $(EXTRALIBS) -o $@ $^ $(FFMPEG_LIB)
46
47 ffplay: ffmpeg$(EXE)
48 ln -sf $< $@
49
50 %.o: %.c
51 $(CC) $(CFLAGS) -c -o $@ $<
52
53 install: all
54 $(MAKE) -C libavcodec install
55 install -s -m 755 $(PROG) $(prefix)/bin
56 ln -sf ffmpeg $(prefix)/bin/ffplay
57
58 dep: depend
59
60 depend:
61 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
62
63 clean:
64 $(MAKE) -C libavcodec clean
65 $(MAKE) -C libav clean
66 rm -f *.o *~ .depend gmon.out TAGS $(PROG)
67
68 distclean: clean
69 $(MAKE) -C libavcodec distclean
70 rm -f config.mak config.h
71
72 TAGS:
73 etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
74
75 ifneq ($(wildcard .depend),)
76 include .depend
77 endif