Makefile 3.54 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 \
Aurelien Jacobs's avatar
Aurelien Jacobs committed
25
      ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o daud.o aiff.o \
26
      voc.o tta.o mm.o
27 28 29

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


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

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

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

Luca Abeni's avatar
Luca Abeni committed
54 55 56 57
ifeq ($(CONFIG_VIDEO4LINUX2),yes)
OBJS+= v4l2.o
endif

58 59 60 61
ifeq ($(CONFIG_BKTR),yes)
OBJS+= grab_bktr.o
endif

62 63 64 65
ifeq ($(CONFIG_DV1394),yes)
OBJS+= dv1394.o
endif

66 67 68 69
ifeq ($(CONFIG_DC1394),yes)
OBJS+= dc1394.o
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
70
ifeq ($(CONFIG_AUDIO_OSS),yes)
71
OBJS+= audio.o
Fabrice Bellard's avatar
Fabrice Bellard committed
72 73
endif

74
EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
75

76
ifeq ($(CONFIG_AUDIO_BEOS),yes)
77
PPOBJS+= beosaudio.o
78 79
endif

80 81 82 83 84
# protocols I/O
OBJS+= avio.o aviobuf.o

ifeq ($(CONFIG_PROTOCOLS),yes)
OBJS+= file.o
Fabrice Bellard's avatar
Fabrice Bellard committed
85
ifeq ($(CONFIG_NETWORK),yes)
86
OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
87
# BeOS and Darwin network stuff
88
ifeq ($(NEED_INET_ATON),yes)
89 90
OBJS+= barpainet.o
endif
Fabrice Bellard's avatar
Fabrice Bellard committed
91
endif
92
endif
Fabrice Bellard's avatar
Fabrice Bellard committed
93

Nilesh Bansal's avatar
Nilesh Bansal committed
94
ifeq ($(CONFIG_LIBOGG),yes)
95 96 97
OBJS+= ogg.o
endif

98 99 100 101
ifeq ($(TARGET_ARCH_SPARC64),yes)
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
endif

102
NAME=avformat
103
ifeq ($(BUILD_SHARED),yes)
104 105
LIBVERSION=$(LAVFVERSION)
LIBMAJOR=$(LAVFMAJOR)
106
AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
107 108
endif

109
SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
110

111
all: $(LIB) $(SLIBNAME)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
112

113
$(LIB): $(OBJS) $(PPOBJS)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
114
	rm -f $@
115
	$(AR) rc $@ $(OBJS) $(PPOBJS)
Michael Niedermayer's avatar
Michael Niedermayer committed
116
	$(RANLIB) $@
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
117

118
$(SLIBNAME): $(OBJS)
119
	$(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
Fabrice Bellard's avatar
Fabrice Bellard committed
120
ifeq ($(CONFIG_WIN32),yes)
121 122
	-lib /machine:i386 /def:$(@:.dll=.def)
endif
123

124
depend: $(SRCS)
125 126
	$(CC) -MM $(CFLAGS) $^ 1>.depend

127 128

install-lib-shared: $(SLIBNAME)
Fabrice Bellard's avatar
Fabrice Bellard committed
129
ifeq ($(CONFIG_WIN32),yes)
130
	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
Fabrice Bellard's avatar
Fabrice Bellard committed
131
else
132 133 134 135 136 137
	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)
138 139
endif

140
install-lib-static: $(LIB)
141
	install -m 644 $(LIB) "$(libdir)"
Fabrice Bellard's avatar
Fabrice Bellard committed
142 143

install-headers:
Diego Biurrun's avatar
Diego Biurrun committed
144
	install -m 644 avformat.h avio.h rtp.h rtsp.h rtspcodes.h "$(incdir)"
Diego Biurrun's avatar
Diego Biurrun committed
145
	install -m 644 $(SRC_PATH)/libavformat.pc "$(libdir)/pkgconfig"
Fabrice Bellard's avatar
Fabrice Bellard committed
146

Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
147
%.o: %.c
148
	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
149

150 151
# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
%.o: %.cpp
152
	g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
153

154
clean:
155 156
	rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \
	      *.lib *.def *.dll.a *.exp
157 158

distclean: clean
159
	rm -f .depend
160 161 162 163 164 165 166

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