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 | |
daf8e955 | 19 | else |
f3ec2d46 SG |
20 | ifeq ($(CONFIG_OS2),yes) |
21 | EXE=.exe | |
f3ec2d46 SG |
22 | else |
23 | EXE= | |
8154d2e0 | 24 | endif |
daf8e955 | 25 | endif |
01310af2 FB |
26 | |
27 | PROG=ffmpeg$(EXE) | |
8de65d4f | 28 | PROGTEST=output_example$(EXE) |
01310af2 FB |
29 | |
30 | ifeq ($(CONFIG_FFSERVER),yes) | |
31 | PROG+=ffserver$(EXE) | |
32 | endif | |
33 | ||
34 | ifeq ($(CONFIG_FFPLAY),yes) | |
35 | PROG+=ffplay$(EXE) | |
f3ec2d46 | 36 | endif |
85f07f22 | 37 | |
dfdfa47c FR |
38 | ifeq ($(CONFIG_AUDIO_BEOS),yes) |
39 | EXTRALIBS+=-lmedia -lbe | |
40 | endif | |
a1b63811 | 41 | |
0fd94442 | 42 | ifeq ($(BUILD_SHARED),yes) |
6bc114b2 | 43 | DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF) |
0fd94442 | 44 | else |
f3ec2d46 | 45 | DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF) |
a6741398 J |
46 | ifeq ($(CONFIG_MP3LAME),yes) |
47 | EXTRALIBS+=-lmp3lame | |
48 | endif | |
d1db8623 FR |
49 | endif |
50 | ||
81e0d0b4 MH |
51 | ifeq ($(CONFIG_VORBIS),yes) |
52 | EXTRALIBS+=-logg -lvorbis -lvorbisenc | |
53 | endif | |
0fd94442 | 54 | |
445ad18d ZK |
55 | ifeq ($(CONFIG_FAAD),yes) |
56 | ifeq ($(CONFIG_FAADBIN),yes) | |
57 | # no libs needed | |
58 | else | |
59 | EXTRALIBS += -lfaad | |
60 | endif | |
61 | endif | |
62 | ||
142fc6b9 PG |
63 | ifeq ($(BUILD_VHOOK),yes) |
64 | VHOOK=videohook | |
65 | INSTALLVHOOK=install-vhook | |
66 | CLEANVHOOK=clean-vhook | |
47930f09 | 67 | endif |
142fc6b9 | 68 | |
6e023978 RS |
69 | ifeq ($(TARGET_OS), SunOS) |
70 | TEST=/usr/bin/test | |
71 | else | |
72 | TEST=test | |
73 | endif | |
74 | ||
01310af2 | 75 | OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o |
57514323 | 76 | SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s) |
cf2818b0 | 77 | FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec |
57514323 | 78 | |
8de65d4f | 79 | all: lib $(PROG) $(PROGTEST) $(VHOOK) |
85f07f22 | 80 | |
891f64b3 | 81 | lib: $(AMRLIBS) |
2cc8ae96 | 82 | $(MAKE) -C libavcodec all |
abac6175 | 83 | $(MAKE) -C libavformat all |
85f07f22 | 84 | |
01310af2 FB |
85 | ffmpeg_g$(EXE): ffmpeg.o cmdutils.o .libs |
86 | $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS) | |
85f07f22 | 87 | |
37736979 | 88 | ffmpeg$(EXE): ffmpeg_g$(EXE) |
f3ec2d46 SG |
89 | cp -p $< $@ |
90 | $(STRIP) $@ | |
37736979 | 91 | |
cf2818b0 ZK |
92 | ffserver$(EXE): ffserver.o .libs |
93 | $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS) | |
85f07f22 | 94 | |
01310af2 FB |
95 | ffplay_g$(EXE): ffplay.o cmdutils.o .libs |
96 | $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS) | |
97 | ||
98 | ffplay$(EXE): ffplay_g$(EXE) | |
99 | cp -p $< $@ | |
100 | $(STRIP) $@ | |
101 | ||
8de65d4f FB |
102 | output_example$(EXE): output_example.o .libs |
103 | $(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS) | |
104 | ||
01310af2 FB |
105 | ffplay.o: ffplay.c |
106 | $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $< | |
2744a37f | 107 | |
85f07f22 | 108 | %.o: %.c |
daf8e955 | 109 | $(CC) $(CFLAGS) -c -o $@ $< |
85f07f22 | 110 | |
be12b2a4 | 111 | videohook: .libs |
142fc6b9 PG |
112 | $(MAKE) -C vhook all |
113 | ||
23a65308 | 114 | install: all install-man $(INSTALLVHOOK) |
0fd94442 | 115 | $(MAKE) -C libavcodec install |
6bc114b2 | 116 | $(MAKE) -C libavformat install |
c1325d18 | 117 | install -d $(prefix)/bin |
fbd8bb7e | 118 | install -c -s -m 755 $(PROG) $(prefix)/bin |
85f07f22 | 119 | |
23a65308 FB |
120 | # install man from source dir if available |
121 | install-man: | |
122 | if [ -f $(SRC_PATH)/doc/ffmpeg.1 ] ; then \ | |
123 | install -d $(mandir)/man1 ; \ | |
124 | install -m 644 $(SRC_PATH)/doc/ffmpeg.1 $(SRC_PATH)/doc/ffplay.1 \ | |
125 | $(SRC_PATH)/doc/ffserver.1 $(mandir)/man1 ; \ | |
126 | fi | |
127 | ||
142fc6b9 PG |
128 | install-vhook: $(prefix)/lib/vhook |
129 | $(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook | |
130 | ||
131 | $(prefix)/lib/vhook: | |
4baca069 | 132 | install -d $@ |
142fc6b9 | 133 | |
37736979 FB |
134 | installlib: |
135 | $(MAKE) -C libavcodec installlib | |
abac6175 | 136 | $(MAKE) -C libavformat installlib |
37736979 | 137 | |
57514323 ZK |
138 | dep: depend |
139 | ||
4b8b2edb | 140 | depend: .depend |
811b32ed FB |
141 | make -C libavcodec depend |
142 | make -C libavformat depend | |
143 | ifeq ($(BUILD_VHOOK),yes) | |
144 | make -C vhook depend | |
145 | endif | |
4b8b2edb FB |
146 | |
147 | .depend: $(SRCS) | |
148 | $(CC) -MM $(CFLAGS) $^ 1>.depend | |
57514323 | 149 | |
cf2818b0 | 150 | .libs: lib |
127d5c8d | 151 | @test -f .libs || touch .libs |
6e023978 | 152 | @for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done |
cf2818b0 | 153 | |
bc634f6f | 154 | clean: $(CLEANVHOOK) |
2cc8ae96 | 155 | $(MAKE) -C libavcodec clean |
abac6175 | 156 | $(MAKE) -C libavformat clean |
dd9ca370 | 157 | $(MAKE) -C tests clean |
01310af2 | 158 | rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXE) ffplay_g$(EXE) $(PROG) |
85f07f22 | 159 | |
142fc6b9 PG |
160 | clean-vhook: |
161 | $(MAKE) -C vhook clean | |
162 | ||
85f07f22 | 163 | distclean: clean |
c72c6d2d | 164 | $(MAKE) -C libavcodec distclean |
980fc7b8 | 165 | rm -f config.mak config.h |
85f07f22 FB |
166 | |
167 | TAGS: | |
abac6175 | 168 | etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch] |
57514323 | 169 | |
dd9ca370 FB |
170 | # regression tests |
171 | ||
ec9fca31 FB |
172 | libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXE) |
173 | $(MAKE) -C tests $@ | |
dd9ca370 | 174 | |
ac977341 FB |
175 | # tar release (use 'make -k tar' on a checkouted tree) |
176 | FILE=ffmpeg-$(shell cat VERSION) | |
177 | ||
178 | tar: | |
179 | rm -rf /tmp/$(FILE) | |
180 | cp -r . /tmp/$(FILE) | |
181 | ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS ) | |
182 | rm -rf /tmp/$(FILE) | |
183 | ||
cf2818b0 ZK |
184 | .PHONY: lib |
185 | ||
57514323 ZK |
186 | ifneq ($(wildcard .depend),) |
187 | include .depend | |
188 | endif |