Commit | Line | Data |
---|---|---|
a1b63811 | 1 | # |
85f07f22 | 2 | # Main ffmpeg Makefile |
a1b63811 | 3 | # (c) 2000, 2001, 2002 Fabrice Bellard |
85f07f22 | 4 | # |
980fc7b8 | 5 | include config.mak |
85f07f22 | 6 | |
dd9ca370 FB |
7 | VPATH=$(SRC_PATH) |
8 | ||
abac6175 | 9 | CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE |
4baca069 | 10 | LDFLAGS+= -g |
37736979 | 11 | |
980fc7b8 | 12 | ifeq ($(TARGET_GPROF),yes) |
85f07f22 FB |
13 | CFLAGS+=-p |
14 | LDFLAGS+=-p | |
15 | endif | |
16 | ||
daf8e955 FB |
17 | ifeq ($(CONFIG_WIN32),yes) |
18 | EXE=.exe | |
19 | PROG=ffmpeg$(EXE) | |
20 | else | |
21 | EXT= | |
8154d2e0 FB |
22 | PROG=ffmpeg ffplay |
23 | ifeq ($(CONFIG_FFSERVER),yes) | |
24 | PROG+=ffserver | |
25 | endif | |
daf8e955 | 26 | endif |
85f07f22 | 27 | |
dfdfa47c FR |
28 | ifeq ($(CONFIG_AUDIO_BEOS),yes) |
29 | EXTRALIBS+=-lmedia -lbe | |
30 | endif | |
a1b63811 | 31 | |
0fd94442 | 32 | ifeq ($(BUILD_SHARED),yes) |
abac6175 | 33 | DEP_LIBS=libavcodec/libavcodec.so libavformat/libavformat.a |
0fd94442 | 34 | else |
abac6175 | 35 | DEP_LIBS=libavcodec/libavcodec.a libavformat/libavformat.a |
a6741398 J |
36 | ifeq ($(CONFIG_MP3LAME),yes) |
37 | EXTRALIBS+=-lmp3lame | |
38 | endif | |
81e0d0b4 MH |
39 | ifeq ($(CONFIG_VORBIS),yes) |
40 | EXTRALIBS+=-logg -lvorbis -lvorbisenc | |
41 | endif | |
0fd94442 NK |
42 | endif |
43 | ||
142fc6b9 PG |
44 | ifeq ($(BUILD_VHOOK),yes) |
45 | VHOOK=videohook | |
46 | INSTALLVHOOK=install-vhook | |
47 | CLEANVHOOK=clean-vhook | |
47930f09 | 48 | endif |
142fc6b9 | 49 | |
57514323 ZK |
50 | OBJS = ffmpeg.o ffserver.o |
51 | SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s) | |
52 | ||
142fc6b9 | 53 | all: lib $(PROG) $(VHOOK) |
85f07f22 FB |
54 | |
55 | lib: | |
2cc8ae96 | 56 | $(MAKE) -C libavcodec all |
abac6175 | 57 | $(MAKE) -C libavformat all |
85f07f22 | 58 | |
37736979 | 59 | ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS) |
abac6175 | 60 | $(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libavformat \ |
a1b63811 | 61 | -lavformat -lavcodec $(EXTRALIBS) |
85f07f22 | 62 | |
37736979 | 63 | ffmpeg$(EXE): ffmpeg_g$(EXE) |
fcd43156 | 64 | cp -p $< $@ ; $(STRIP) $@ |
37736979 | 65 | |
a1b63811 | 66 | ffserver$(EXE): ffserver.o $(DEP_LIBS) |
a43bd1d7 | 67 | $(CC) $(LDFLAGS) $(FFSLDFLAGS) \ |
abac6175 | 68 | -o $@ ffserver.o -L./libavcodec -L./libavformat \ |
9c938e77 | 69 | -lavformat -lavcodec $(EXTRALIBS) |
85f07f22 | 70 | |
2744a37f FB |
71 | ffplay: ffmpeg$(EXE) |
72 | ln -sf $< $@ | |
73 | ||
85f07f22 | 74 | %.o: %.c |
daf8e955 | 75 | $(CC) $(CFLAGS) -c -o $@ $< |
85f07f22 | 76 | |
142fc6b9 PG |
77 | videohook: |
78 | $(MAKE) -C vhook all | |
79 | ||
80 | install: all $(INSTALLVHOOK) | |
0fd94442 | 81 | $(MAKE) -C libavcodec install |
c1325d18 | 82 | install -d $(prefix)/bin |
980fc7b8 | 83 | install -s -m 755 $(PROG) $(prefix)/bin |
2744a37f | 84 | ln -sf ffmpeg $(prefix)/bin/ffplay |
85f07f22 | 85 | |
142fc6b9 PG |
86 | install-vhook: $(prefix)/lib/vhook |
87 | $(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook | |
88 | ||
89 | $(prefix)/lib/vhook: | |
4baca069 | 90 | install -d $@ |
142fc6b9 | 91 | |
37736979 FB |
92 | installlib: |
93 | $(MAKE) -C libavcodec installlib | |
abac6175 | 94 | $(MAKE) -C libavformat installlib |
37736979 | 95 | |
57514323 ZK |
96 | dep: depend |
97 | ||
98 | depend: | |
99 | $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend | |
100 | ||
142fc6b9 | 101 | clean: $(CLEANVHOOK) |
2cc8ae96 | 102 | $(MAKE) -C libavcodec clean |
abac6175 | 103 | $(MAKE) -C libavformat clean |
dd9ca370 | 104 | $(MAKE) -C tests clean |
37736979 | 105 | rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG) |
85f07f22 | 106 | |
142fc6b9 PG |
107 | clean-vhook: |
108 | $(MAKE) -C vhook clean | |
109 | ||
85f07f22 | 110 | distclean: clean |
c72c6d2d | 111 | $(MAKE) -C libavcodec distclean |
980fc7b8 | 112 | rm -f config.mak config.h |
85f07f22 FB |
113 | |
114 | TAGS: | |
abac6175 | 115 | etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch] |
57514323 | 116 | |
dd9ca370 FB |
117 | # regression tests |
118 | ||
4c41db9a | 119 | libavtest test mpeg4 mpeg: ffmpeg$(EXE) |
9c938e77 | 120 | $(MAKE) -C tests $@ |
dd9ca370 | 121 | |
57514323 ZK |
122 | ifneq ($(wildcard .depend),) |
123 | include .depend | |
124 | endif |