Makefile 3.78 KB
Newer Older
Fabrice Bellard's avatar
Fabrice Bellard committed
1 2
#
# libavformat Makefile
Fabrice Bellard's avatar
Fabrice Bellard committed
3
# (c) 2000-2003 Fabrice Bellard
Fabrice Bellard's avatar
Fabrice Bellard committed
4
#
5
include ../config.mak
Fabrice Bellard's avatar
Fabrice Bellard committed
6

Fabrice Bellard's avatar
Fabrice Bellard committed
7
VPATH=$(SRC_PATH)/libavformat
Fabrice Bellard's avatar
Fabrice Bellard committed
8

9
CFLAGS=$(OPTFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
10

11 12
#FIXME: This should be in configure/config.mak
ifeq ($(CONFIG_WIN32),yes)
13
    LDFLAGS=-Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a)
14 15
endif

16
OBJS= utils.o cutils.o os_support.o allformats.o
17
PPOBJS=
Fabrice Bellard's avatar
Fabrice Bellard committed
18

19
# demuxers
20
OBJS+=mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o img2.o raw.o rm.o \
21
      avienc.o avidec.o wav.o mmf.o swf.o au.o gif.o mov.o mpjpeg.o dv.o \
22
      yuv4mpeg.o 4xm.o flvdec.o psxstr.o idroq.o ipmovie.o \
23
      nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o flic.o \
24
      sierravmd.o matroska.o sol.o electronicarts.o nsvdec.o asf.o \
25
      ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o daud.o
26 27 28 29 30 31 32

# muxers
ifeq ($(CONFIG_MUXERS),yes)
OBJS+= flvenc.o movenc.o asf-enc.o
endif


33
AMROBJS=
34
ifeq ($(AMR_NB),yes)
35
AMROBJS= amr.o
36 37
endif
ifeq ($(AMR_NB_FIXED),yes)
38
AMROBJS= amr.o
39 40
endif
ifeq ($(AMR_WB),yes)
41
AMROBJS= amr.o
Zdenek Kabelac's avatar
Zdenek Kabelac committed
42
endif
43
OBJS+= $(AMROBJS)
Zdenek Kabelac's avatar
Zdenek Kabelac committed
44

Fabrice Bellard's avatar
Fabrice Bellard committed
45
# image formats
46
OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
47
OBJS+= framehook.o
Fabrice Bellard's avatar
Fabrice Bellard committed
48

Fabrice Bellard's avatar
Fabrice Bellard committed
49 50
ifeq ($(CONFIG_VIDEO4LINUX),yes)
OBJS+= grab.o
Fabrice Bellard's avatar
Fabrice Bellard committed
51
endif
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
52

53 54 55 56
ifeq ($(CONFIG_BKTR),yes)
OBJS+= grab_bktr.o
endif

57 58 59 60
ifeq ($(CONFIG_DV1394),yes)
OBJS+= dv1394.o
endif

61 62 63 64
ifeq ($(CONFIG_DC1394),yes)
OBJS+= dc1394.o
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
65
ifeq ($(CONFIG_AUDIO_OSS),yes)
66
OBJS+= audio.o
Fabrice Bellard's avatar
Fabrice Bellard committed
67 68
endif

69
EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
70

71
ifeq ($(CONFIG_AUDIO_BEOS),yes)
72
PPOBJS+= beosaudio.o
73 74
endif

75 76 77 78 79
# protocols I/O
OBJS+= avio.o aviobuf.o

ifeq ($(CONFIG_PROTOCOLS),yes)
OBJS+= file.o
Fabrice Bellard's avatar
Fabrice Bellard committed
80
ifeq ($(CONFIG_NETWORK),yes)
81
OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
82
# BeOS and Darwin network stuff
83
ifeq ($(NEED_INET_ATON),yes)
84 85
OBJS+= barpainet.o
endif
Fabrice Bellard's avatar
Fabrice Bellard committed
86
endif
87
endif
Fabrice Bellard's avatar
Fabrice Bellard committed
88

Nilesh Bansal's avatar
Nilesh Bansal committed
89
ifeq ($(CONFIG_LIBOGG),yes)
90 91 92
OBJS+= ogg.o
endif

93 94 95 96
ifeq ($(TARGET_ARCH_SPARC64),yes)
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
endif

97
NAME=avformat
98
ifeq ($(BUILD_SHARED),yes)
99 100
LIBVERSION=$(LAVFVERSION)
LIBMAJOR=$(LAVFMAJOR)
101
AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
102 103
endif

104
SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
105

106
all: $(LIB) $(SLIBNAME)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
107

108
$(LIB): $(OBJS) $(PPOBJS)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
109
	rm -f $@
110
	$(AR) rc $@ $(OBJS) $(PPOBJS)
Michael Niedermayer's avatar
Michael Niedermayer committed
111
	$(RANLIB) $@
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
112

113
$(SLIBNAME): $(OBJS)
114
	$(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
Fabrice Bellard's avatar
Fabrice Bellard committed
115
ifeq ($(CONFIG_WIN32),yes)
116 117
	-lib /machine:i386 /def:$(@:.dll=.def)
endif
118

119
depend: $(SRCS)
120 121
	$(CC) -MM $(CFLAGS) $^ 1>.depend

122
ifeq ($(BUILD_SHARED),yes)
Fabrice Bellard's avatar
Fabrice Bellard committed
123 124
install: all install-headers
ifeq ($(CONFIG_WIN32),yes)
125
	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
Fabrice Bellard's avatar
Fabrice Bellard committed
126
else
127
	install -d $(libdir)
128 129 130 131 132 133
	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
		$(libdir)/$(SLIBNAME_WITH_VERSION)
	ln -sf $(SLIBNAME_WITH_VERSION) \
		$(libdir)/$(SLIBNAME_WITH_MAJOR)
	ln -sf $(SLIBNAME_WITH_VERSION) \
		$(libdir)/$(SLIBNAME)
134
	$(LDCONFIG) || true
Fabrice Bellard's avatar
Fabrice Bellard committed
135 136 137
endif
else
install:
138 139
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
140
installlib: all install-headers
141
	install -m 644 $(LIB) "$(libdir)"
Fabrice Bellard's avatar
Fabrice Bellard committed
142 143 144

install-headers:
	mkdir -p "$(prefix)/include/ffmpeg"
145 146 147
	install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
                $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
                $(SRC_PATH)/libavformat/rtspcodes.h \
Fabrice Bellard's avatar
Fabrice Bellard committed
148
                "$(prefix)/include/ffmpeg"
149 150
	install -d "$(libdir)/pkgconfig"
	install -m 644 ../libavformat.pc "$(libdir)/pkgconfig"
Fabrice Bellard's avatar
Fabrice Bellard committed
151

Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
152
%.o: %.c
153
	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
154

155 156
# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
%.o: %.cpp
157
	g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
158

159
clean:
160 161
	rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \
	      *.lib *.def *.dll.a *.exp
162 163

distclean: clean
164
	rm -f .depend
165 166 167 168 169 170 171

#
# include dependency files if they exist
#
ifneq ($(wildcard .depend),)
include .depend
endif