* quiet missing EOF \n warning
[libav.git] / Makefile
CommitLineData
a1b63811 1#
85f07f22 2# Main ffmpeg Makefile
a1b63811 3# (c) 2000, 2001, 2002 Fabrice Bellard
85f07f22 4#
980fc7b8 5include config.mak
85f07f22 6
dd9ca370
FB
7VPATH=$(SRC_PATH)
8
abac6175 9CFLAGS= $(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 10LDFLAGS+= -g
37736979 11
980fc7b8 12ifeq ($(TARGET_GPROF),yes)
85f07f22
FB
13CFLAGS+=-p
14LDFLAGS+=-p
15endif
16
daf8e955
FB
17ifeq ($(CONFIG_WIN32),yes)
18EXE=.exe
19PROG=ffmpeg$(EXE)
20else
f3ec2d46
SG
21ifeq ($(CONFIG_OS2),yes)
22EXE=.exe
23PROG=ffmpeg$(EXE)
24else
25EXE=
8154d2e0
FB
26PROG=ffmpeg ffplay
27ifeq ($(CONFIG_FFSERVER),yes)
28PROG+=ffserver
29endif
daf8e955 30endif
f3ec2d46 31endif
85f07f22 32
dfdfa47c
FR
33ifeq ($(CONFIG_AUDIO_BEOS),yes)
34EXTRALIBS+=-lmedia -lbe
35endif
a1b63811 36
0fd94442 37ifeq ($(BUILD_SHARED),yes)
f3ec2d46 38DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
0fd94442 39else
f3ec2d46 40DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
a6741398
J
41ifeq ($(CONFIG_MP3LAME),yes)
42EXTRALIBS+=-lmp3lame
43endif
d1db8623
FR
44endif
45
81e0d0b4
MH
46ifeq ($(CONFIG_VORBIS),yes)
47EXTRALIBS+=-logg -lvorbis -lvorbisenc
48endif
0fd94442 49
142fc6b9
PG
50ifeq ($(BUILD_VHOOK),yes)
51VHOOK=videohook
52INSTALLVHOOK=install-vhook
53CLEANVHOOK=clean-vhook
47930f09 54endif
142fc6b9 55
6e023978
RS
56ifeq ($(TARGET_OS), SunOS)
57TEST=/usr/bin/test
58else
59TEST=test
60endif
61
57514323
ZK
62OBJS = ffmpeg.o ffserver.o
63SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
cf2818b0 64FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
57514323 65
142fc6b9 66all: lib $(PROG) $(VHOOK)
85f07f22
FB
67
68lib:
2cc8ae96 69 $(MAKE) -C libavcodec all
abac6175 70 $(MAKE) -C libavformat all
85f07f22 71
cf2818b0
ZK
72ffmpeg_g$(EXE): ffmpeg.o .libs
73 $(CC) $(LDFLAGS) -o $@ ffmpeg.o $(FFLIBS) $(EXTRALIBS)
85f07f22 74
37736979 75ffmpeg$(EXE): ffmpeg_g$(EXE)
f3ec2d46
SG
76 cp -p $< $@
77 $(STRIP) $@
37736979 78
cf2818b0
ZK
79ffserver$(EXE): ffserver.o .libs
80 $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
85f07f22 81
2744a37f
FB
82ffplay: ffmpeg$(EXE)
83 ln -sf $< $@
84
85f07f22 85%.o: %.c
daf8e955 86 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 87
be12b2a4 88videohook: .libs
142fc6b9
PG
89 $(MAKE) -C vhook all
90
91install: all $(INSTALLVHOOK)
0fd94442 92 $(MAKE) -C libavcodec install
c1325d18 93 install -d $(prefix)/bin
fbd8bb7e 94 install -c -s -m 755 $(PROG) $(prefix)/bin
2744a37f 95 ln -sf ffmpeg $(prefix)/bin/ffplay
85f07f22 96
142fc6b9
PG
97install-vhook: $(prefix)/lib/vhook
98 $(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
99
100$(prefix)/lib/vhook:
4baca069 101 install -d $@
142fc6b9 102
37736979
FB
103installlib:
104 $(MAKE) -C libavcodec installlib
abac6175 105 $(MAKE) -C libavformat installlib
37736979 106
57514323
ZK
107dep: depend
108
4b8b2edb 109depend: .depend
811b32ed
FB
110 make -C libavcodec depend
111 make -C libavformat depend
112ifeq ($(BUILD_VHOOK),yes)
113 make -C vhook depend
114endif
4b8b2edb
FB
115
116.depend: $(SRCS)
117 $(CC) -MM $(CFLAGS) $^ 1>.depend
57514323 118
cf2818b0 119.libs: lib
127d5c8d 120 @test -f .libs || touch .libs
6e023978 121 @for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
cf2818b0 122
142fc6b9 123clean: $(CLEANVHOOK)
2cc8ae96 124 $(MAKE) -C libavcodec clean
abac6175 125 $(MAKE) -C libavformat clean
dd9ca370 126 $(MAKE) -C tests clean
cf2818b0 127 rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
85f07f22 128
142fc6b9
PG
129clean-vhook:
130 $(MAKE) -C vhook clean
131
85f07f22 132distclean: clean
c72c6d2d 133 $(MAKE) -C libavcodec distclean
980fc7b8 134 rm -f config.mak config.h
85f07f22
FB
135
136TAGS:
abac6175 137 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 138
dd9ca370
FB
139# regression tests
140
4c41db9a 141libavtest test mpeg4 mpeg: ffmpeg$(EXE)
00df1301 142 $(MAKE) all -C tests $@
dd9ca370 143
ac977341
FB
144# tar release (use 'make -k tar' on a checkouted tree)
145FILE=ffmpeg-$(shell cat VERSION)
146
147tar:
148 rm -rf /tmp/$(FILE)
149 cp -r . /tmp/$(FILE)
150 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
151 rm -rf /tmp/$(FILE)
152
cf2818b0
ZK
153.PHONY: lib
154
57514323
ZK
155ifneq ($(wildcard .depend),)
156include .depend
157endif