Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 37736979

History | View | Annotate | Download (1.84 KB)

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 -Wl,--warn-common
11

    
12
ifeq ($(TARGET_GPROF),yes)
13
CFLAGS+=-p
14
LDFLAGS+=-p
15
endif
16

    
17
ifeq ($(CONFIG_WIN32),yes)
18
EXE=.exe
19
PROG=ffmpeg$(EXE)
20
else
21
EXT=
22
PROG=ffmpeg ffplay ffserver
23
endif
24

    
25

    
26
ifeq ($(BUILD_SHARED),yes)
27
DEP_LIBS=libavcodec/libavcodec.so libav/libavformat.a
28
else
29
DEP_LIBS=libavcodec/libavcodec.a libav/libavformat.a
30
ifeq ($(CONFIG_MP3LAME),yes)
31
EXTRALIBS+=-lmp3lame
32
endif
33
endif
34

    
35
OBJS = ffmpeg.o ffserver.o
36
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
37

    
38
all: lib $(PROG)
39

    
40
lib:
41
	$(MAKE) -C libavcodec all
42
	$(MAKE) -C libav all
43

    
44
ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS)
45
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libav \
46
              -lavformat -lavcodec $(EXTRALIBS)
47

    
48
ffmpeg$(EXE): ffmpeg_g$(EXE)
49
	$(STRIP) -o $@ $<
50

    
51
ffserver$(EXE): ffserver.o $(DEP_LIBS)
52
	$(CC) $(LDFLAGS) -Wl,-E -o $@ ffserver.o -L./libavcodec -L./libav \
53
              -lavformat -lavcodec -ldl $(EXTRALIBS) 
54

    
55
ffplay: ffmpeg$(EXE)
56
	ln -sf $< $@
57

    
58
%.o: %.c
59
	$(CC) $(CFLAGS) -c -o $@ $< 
60

    
61
install: all
62
	$(MAKE) -C libavcodec install
63
	install -s -m 755 $(PROG) $(prefix)/bin
64
	ln -sf ffmpeg $(prefix)/bin/ffplay 
65

    
66
installlib:
67
	$(MAKE) -C libavcodec installlib
68
	$(MAKE) -C libav installlib
69

    
70
dep:	depend
71

    
72
depend:
73
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
74

    
75
clean: 
76
	$(MAKE) -C libavcodec clean
77
	$(MAKE) -C libav clean
78
	$(MAKE) -C tests clean
79
	rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG) 
80

    
81
distclean: clean
82
	$(MAKE) -C libavcodec distclean
83
	rm -f config.mak config.h
84

    
85
TAGS:
86
	etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
87

    
88
# regression tests
89

    
90
libavtest test mpeg4 mpeg: ffmpeg$(EXE)
91
	make -C tests $@
92

    
93
ifneq ($(wildcard .depend),)
94
include .depend
95
endif