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