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