PowerPC warnings & optimisations patch by (Dan Christiansen <danchr at daimi dot...
[libav.git] / libavformat / Makefile
1 #
2 # libavformat Makefile
3 # (c) 2000-2003 Fabrice Bellard
4 #
5 include ../config.mak
6
7 VPATH=$(SRC_PATH)/libavformat
8
9 CFLAGS= -Wall $(OPTFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
10
11 OBJS= utils.o cutils.o os_support.o allformats.o
12 PPOBJS=
13
14 # mux and demuxes
15 OBJS+=mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o raw.o rm.o \
16 avienc.o avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.o dvcore.o dv.o \
17 yuv4mpeg.o 4xm.o flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o \
18 nut.o wc3movie.o mp3.o
19
20 ifeq ($(CONFIG_RISKY),yes)
21 OBJS+= asf.o
22 endif
23
24 ifeq ($(AMR_NB),yes) | ifeq ($(AMR_NB_FIXED),yes) | ifeq ($(AMR_WB),yes)
25 OBJS+= amr.o
26 endif
27
28 # image formats
29 OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o
30 # file I/O
31 OBJS+= avio.o aviobuf.o file.o
32 OBJS+= framehook.o
33
34 ifeq ($(CONFIG_VIDEO4LINUX),yes)
35 OBJS+= grab.o
36 endif
37
38 ifeq ($(CONFIG_DV1394),yes)
39 OBJS+= dv1394.o
40 endif
41
42 ifeq ($(CONFIG_AUDIO_OSS),yes)
43 OBJS+= audio.o
44 endif
45
46 ifeq ($(CONFIG_AUDIO_BEOS),yes)
47 PPOBJS+= beosaudio.o
48 EXTRALIBS+=-lbe -lmedia
49 # this should be the default !
50 EXTRALIBS+=-lavcodec -L../libavcodec
51 endif
52
53 ifeq ($(CONFIG_NETWORK),yes)
54 OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
55 # BeOS and Darwin network stuff
56 ifeq ($(NEED_INET_ATON),yes)
57 OBJS+= barpainet.o
58 endif
59 endif
60
61 ifeq ($(CONFIG_VORBIS),yes)
62 OBJS+= ogg.o
63 endif
64
65 LIB= $(LIBPREF)avformat$(LIBSUF)
66 ifeq ($(BUILD_SHARED),yes)
67 SLIB= $(SLIBPREF)avformat$(SLIBSUF)
68 endif
69
70 SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
71
72 all: $(LIB) $(SLIB)
73
74 $(LIB): $(OBJS) $(PPOBJS)
75 rm -f $@
76 $(AR) rc $@ $(OBJS) $(PPOBJS)
77 $(RANLIB) $@
78
79 $(SLIB): $(OBJS)
80 ifeq ($(CONFIG_WIN32),yes)
81 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(VPATH)/../libavcodec/avcodec.dll
82 -lib /machine:i386 /def:$(@:.dll=.def)
83 else
84 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS)
85 endif
86
87 depend: $(SRCS)
88 $(CC) -MM $(CFLAGS) $^ 1>.depend
89
90 ifeq ($(BUILD_SHARED),yes)
91 install: all install-headers
92 ifeq ($(CONFIG_WIN32),yes)
93 install -s -m 755 $(SLIB) "$(prefix)"
94 else
95 install -d $(prefix)/lib
96 install -s -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so
97 ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
98 ldconfig || true
99 endif
100 else
101 install:
102 endif
103
104 installlib: all install-headers
105 install -m 644 $(LIB) $(prefix)/lib
106
107 install-headers:
108 mkdir -p "$(prefix)/include/ffmpeg"
109 install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
110 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
111 $(SRC_PATH)/libavformat/rtspcodes.h \
112 "$(prefix)/include/ffmpeg"
113
114 %.o: %.c
115 $(CC) $(CFLAGS) -c -o $@ $<
116
117 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
118 %.o: %.cpp
119 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
120
121 clean:
122 rm -f *.o *.d .depend *~ *.a $(LIB)
123
124 #
125 # include dependency files if they exist
126 #
127 ifneq ($(wildcard .depend),)
128 include .depend
129 endif