summaryrefslogtreecommitdiff
path: root/Makefile
blob: b78c92be0d6eef8e1c4aa92d97a28622766d32e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Main ffmpeg Makefile
# (c) 2000, 2001 Gerard Lantau
#
include config.mak

CFLAGS= $(OPTFLAGS) -Wall -g -I./libavcodec -I./libav 
LDFLAGS= -g
ifeq ($(TARGET_GPROF),yes)
CFLAGS+=-p
LDFLAGS+=-p
endif

ifeq ($(CONFIG_WIN32),yes)
EXE=.exe
PROG=ffmpeg$(EXE)
else
EXT=
PROG=ffmpeg ffplay ffserver
endif

ifeq ($(BUILD_SHARED),yes)
FFMPEG_LIB=-Llibavcodec -lffmpeg
DEP_FFMPEG_LIB=
else
FFMPEG_LIB=libavcodec/libavcodec.a
DEP_FFMPEG_LIB=libavcodec/libavcodec.a
ifeq ($(CONFIG_MP3LAME),yes)
EXTRALIBS+=-lmp3lame
endif
endif

all: lib $(PROG)

lib:
	$(MAKE) -C libavcodec all
	$(MAKE) -C libav all

ffmpeg$(EXE): ffmpeg.o libav/libav.a $(DEP_FFMPEG_LIB)
	$(CC) $(LDFLAGS) $(EXTRALIBS) -o $@ $^ $(FFMPEG_LIB)

ffserver$(EXE): ffserver.o libav/libav.a $(DEP_FFMPEG_LIB)
	$(CC) $(LDFLAGS) $(EXTRALIBS) -o $@ $^ $(FFMPEG_LIB)

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

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

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

clean: 
	$(MAKE) -C libavcodec clean
	$(MAKE) -C libav clean
	rm -f *.o *~ gmon.out TAGS $(PROG) 

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

TAGS:
	etags *.[ch] libav/*.[ch] libavcodec/*.[ch]