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 | |
f3ec2d46 SG |
21 | ifeq ($(CONFIG_OS2),yes) |
22 | EXE=.exe | |
23 | PROG=ffmpeg$(EXE) | |
24 | else | |
25 | EXE= | |
8154d2e0 FB |
26 | PROG=ffmpeg ffplay |
27 | ifeq ($(CONFIG_FFSERVER),yes) | |
28 | PROG+=ffserver | |
29 | endif | |
daf8e955 | 30 | endif |
f3ec2d46 | 31 | endif |
85f07f22 | 32 | |
dfdfa47c FR |
33 | ifeq ($(CONFIG_AUDIO_BEOS),yes) |
34 | EXTRALIBS+=-lmedia -lbe | |
35 | endif | |
a1b63811 | 36 | |
0fd94442 | 37 | ifeq ($(BUILD_SHARED),yes) |
f3ec2d46 | 38 | DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF) |
0fd94442 | 39 | else |
f3ec2d46 | 40 | DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF) |
a6741398 J |
41 | ifeq ($(CONFIG_MP3LAME),yes) |
42 | EXTRALIBS+=-lmp3lame | |
43 | endif | |
81e0d0b4 MH |
44 | ifeq ($(CONFIG_VORBIS),yes) |
45 | EXTRALIBS+=-logg -lvorbis -lvorbisenc | |
46 | endif | |
0fd94442 NK |
47 | endif |
48 | ||
142fc6b9 PG |
49 | ifeq ($(BUILD_VHOOK),yes) |
50 | VHOOK=videohook | |
51 | INSTALLVHOOK=install-vhook | |
52 | CLEANVHOOK=clean-vhook | |
47930f09 | 53 | endif |
142fc6b9 | 54 | |
57514323 ZK |
55 | OBJS = ffmpeg.o ffserver.o |
56 | SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s) | |
57 | ||
142fc6b9 | 58 | all: lib $(PROG) $(VHOOK) |
85f07f22 FB |
59 | |
60 | lib: | |
2cc8ae96 | 61 | $(MAKE) -C libavcodec all |
abac6175 | 62 | $(MAKE) -C libavformat all |
85f07f22 | 63 | |
4b8b2edb | 64 | ffmpeg_g$(EXE): .depend ffmpeg.o $(DEP_LIBS) |
abac6175 | 65 | $(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libavformat \ |
a1b63811 | 66 | -lavformat -lavcodec $(EXTRALIBS) |
85f07f22 | 67 | |
37736979 | 68 | ffmpeg$(EXE): ffmpeg_g$(EXE) |
f3ec2d46 SG |
69 | cp -p $< $@ |
70 | $(STRIP) $@ | |
37736979 | 71 | |
a1b63811 | 72 | ffserver$(EXE): ffserver.o $(DEP_LIBS) |
a43bd1d7 | 73 | $(CC) $(LDFLAGS) $(FFSLDFLAGS) \ |
abac6175 | 74 | -o $@ ffserver.o -L./libavcodec -L./libavformat \ |
9c938e77 | 75 | -lavformat -lavcodec $(EXTRALIBS) |
85f07f22 | 76 | |
2744a37f FB |
77 | ffplay: ffmpeg$(EXE) |
78 | ln -sf $< $@ | |
79 | ||
85f07f22 | 80 | %.o: %.c |
daf8e955 | 81 | $(CC) $(CFLAGS) -c -o $@ $< |
85f07f22 | 82 | |
142fc6b9 PG |
83 | videohook: |
84 | $(MAKE) -C vhook all | |
85 | ||
86 | install: all $(INSTALLVHOOK) | |
0fd94442 | 87 | $(MAKE) -C libavcodec install |
c1325d18 | 88 | install -d $(prefix)/bin |
fbd8bb7e | 89 | install -c -s -m 755 $(PROG) $(prefix)/bin |
2744a37f | 90 | ln -sf ffmpeg $(prefix)/bin/ffplay |
85f07f22 | 91 | |
142fc6b9 PG |
92 | install-vhook: $(prefix)/lib/vhook |
93 | $(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook | |
94 | ||
95 | $(prefix)/lib/vhook: | |
4baca069 | 96 | install -d $@ |
142fc6b9 | 97 | |
37736979 FB |
98 | installlib: |
99 | $(MAKE) -C libavcodec installlib | |
abac6175 | 100 | $(MAKE) -C libavformat installlib |
37736979 | 101 | |
57514323 ZK |
102 | dep: depend |
103 | ||
4b8b2edb FB |
104 | depend: .depend |
105 | ||
106 | .depend: $(SRCS) | |
107 | $(CC) -MM $(CFLAGS) $^ 1>.depend | |
57514323 | 108 | |
142fc6b9 | 109 | clean: $(CLEANVHOOK) |
2cc8ae96 | 110 | $(MAKE) -C libavcodec clean |
abac6175 | 111 | $(MAKE) -C libavformat clean |
dd9ca370 | 112 | $(MAKE) -C tests clean |
77b71ddc | 113 | rm -f *.o *.d *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG) |
85f07f22 | 114 | |
142fc6b9 PG |
115 | clean-vhook: |
116 | $(MAKE) -C vhook clean | |
117 | ||
85f07f22 | 118 | distclean: clean |
c72c6d2d | 119 | $(MAKE) -C libavcodec distclean |
980fc7b8 | 120 | rm -f config.mak config.h |
85f07f22 FB |
121 | |
122 | TAGS: | |
abac6175 | 123 | etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch] |
57514323 | 124 | |
dd9ca370 FB |
125 | # regression tests |
126 | ||
4c41db9a | 127 | libavtest test mpeg4 mpeg: ffmpeg$(EXE) |
9c938e77 | 128 | $(MAKE) -C tests $@ |
dd9ca370 | 129 | |
ac977341 FB |
130 | # tar release (use 'make -k tar' on a checkouted tree) |
131 | FILE=ffmpeg-$(shell cat VERSION) | |
132 | ||
133 | tar: | |
134 | rm -rf /tmp/$(FILE) | |
135 | cp -r . /tmp/$(FILE) | |
136 | ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS ) | |
137 | rm -rf /tmp/$(FILE) | |
138 | ||
57514323 ZK |
139 | ifneq ($(wildcard .depend),) |
140 | include .depend | |
141 | endif |