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