Makefile 1.14 KB
Newer Older
Fabrice Bellard's avatar
Fabrice Bellard committed
1 2 3
# Main ffmpeg Makefile
# (c) 2000, 2001 Gerard Lantau
#
4
include config.mak
Fabrice Bellard's avatar
Fabrice Bellard committed
5

6 7
CFLAGS= $(OPTFLAGS) -Wall -g -I./libavcodec -I./libav 
LDFLAGS= -g
8
ifeq ($(TARGET_GPROF),yes)
Fabrice Bellard's avatar
Fabrice Bellard committed
9 10 11 12
CFLAGS+=-p
LDFLAGS+=-p
endif

13 14 15 16 17
ifeq ($(CONFIG_WIN32),yes)
EXE=.exe
PROG=ffmpeg$(EXE)
else
EXT=
18
PROG=ffmpeg ffplay ffserver
19
endif
Fabrice Bellard's avatar
Fabrice Bellard committed
20

Nick Kurshev's avatar
Nick Kurshev committed
21 22
ifeq ($(BUILD_SHARED),yes)
FFMPEG_LIB=-Llibavcodec -lffmpeg
23
DEP_FFMPEG_LIB=
Nick Kurshev's avatar
Nick Kurshev committed
24 25
else
FFMPEG_LIB=libavcodec/libavcodec.a
26
DEP_FFMPEG_LIB=libavcodec/libavcodec.a
Nick Kurshev's avatar
Nick Kurshev committed
27 28
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
29 30 31
all: lib $(PROG)

lib:
Fabrice Bellard's avatar
Fabrice Bellard committed
32 33
	$(MAKE) -C libavcodec all
	$(MAKE) -C libav all
Fabrice Bellard's avatar
Fabrice Bellard committed
34

35
ffmpeg$(EXE): ffmpeg.o libav/libav.a $(DEP_FFMPEG_LIB)
Nick Kurshev's avatar
Nick Kurshev committed
36
	$(CC) $(LDFLAGS) -lm -o $@ $^ $(FFMPEG_LIB)
Fabrice Bellard's avatar
Fabrice Bellard committed
37

38
ffserver$(EXE): ffserver.o libav/libav.a $(DEP_FFMPEG_LIB)
Nick Kurshev's avatar
Nick Kurshev committed
39
	$(CC) $(LDFLAGS) -lm -o $@ $^ $(FFMPEG_LIB)
Fabrice Bellard's avatar
Fabrice Bellard committed
40

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

Fabrice Bellard's avatar
Fabrice Bellard committed
44
%.o: %.c
45
	$(CC) $(CFLAGS) -c -o $@ $< 
Fabrice Bellard's avatar
Fabrice Bellard committed
46 47

install: all
Nick Kurshev's avatar
Nick Kurshev committed
48
	$(MAKE) -C libavcodec install
49
	install -s -m 755 $(PROG) $(prefix)/bin
50
	ln -sf ffmpeg $(prefix)/bin/ffplay 
Fabrice Bellard's avatar
Fabrice Bellard committed
51 52

clean: 
Fabrice Bellard's avatar
Fabrice Bellard committed
53 54
	$(MAKE) -C libavcodec clean
	$(MAKE) -C libav clean
Fabrice Bellard's avatar
Fabrice Bellard committed
55 56 57
	rm -f *.o *~ gmon.out TAGS $(PROG) 

distclean: clean
Fabrice Bellard's avatar
Fabrice Bellard committed
58
	$(MAKE) -C libavcodec distclean
59
	rm -f config.mak config.h
Fabrice Bellard's avatar
Fabrice Bellard committed
60 61 62

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