Makefile 3.25 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)/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
OBJS= utils.o cutils.o os_support.o allformats.o
12
PPOBJS=
Fabrice Bellard's avatar
Fabrice Bellard committed
13 14

# mux and demuxes
15
OBJS+=mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o img2.o raw.o rm.o \
16
      avienc.o avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.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 westwood.o segafilm.o idcin.o flic.o \
19
      sierravmd.o matroska.o sol.o electronicarts.o nsvdec.o asf.o asf-enc.o
Michael Niedermayer's avatar
Michael Niedermayer committed
20

21
AMROBJS=
22
ifeq ($(AMR_NB),yes)
23
AMROBJS= amr.o
24 25
endif
ifeq ($(AMR_NB_FIXED),yes)
26
AMROBJS= amr.o
27 28
endif
ifeq ($(AMR_WB),yes)
29
AMROBJS= amr.o
Zdenek Kabelac's avatar
Zdenek Kabelac committed
30
endif
31
OBJS+= $(AMROBJS)
Zdenek Kabelac's avatar
Zdenek Kabelac committed
32

Fabrice Bellard's avatar
Fabrice Bellard committed
33
# image formats
34
OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
Fabrice Bellard's avatar
Fabrice Bellard committed
35 36
# file I/O
OBJS+= avio.o aviobuf.o file.o 
Fabrice Bellard's avatar
Fabrice Bellard committed
37
OBJS+= framehook.o 
Fabrice Bellard's avatar
Fabrice Bellard committed
38

Fabrice Bellard's avatar
Fabrice Bellard committed
39 40
ifeq ($(CONFIG_VIDEO4LINUX),yes)
OBJS+= grab.o
Fabrice Bellard's avatar
Fabrice Bellard committed
41
endif
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
42

43 44 45 46
ifeq ($(CONFIG_DV1394),yes)
OBJS+= dv1394.o
endif

47 48 49 50
ifeq ($(CONFIG_DC1394),yes)
OBJS+= dc1394.o
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
51 52 53 54
ifeq ($(CONFIG_AUDIO_OSS),yes)
OBJS+= audio.o 
endif

55
ifeq ($(CONFIG_AUDIO_BEOS),yes)
56
PPOBJS+= beosaudio.o
57
EXTRALIBS+=-lbe -lmedia
58 59
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
60
ifeq ($(CONFIG_NETWORK),yes)
61
OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
62
# BeOS and Darwin network stuff
63
ifeq ($(NEED_INET_ATON),yes)
64 65
OBJS+= barpainet.o
endif
Fabrice Bellard's avatar
Fabrice Bellard committed
66 67
endif

Nilesh Bansal's avatar
Nilesh Bansal committed
68
ifeq ($(CONFIG_LIBOGG),yes)
69 70 71
OBJS+= ogg.o
endif

72 73 74 75
ifeq ($(TARGET_ARCH_SPARC64),yes)
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
endif

76
LIB= $(LIBPREF)avformat$(LIBSUF)
77 78
ifeq ($(BUILD_SHARED),yes)
SLIB= $(SLIBPREF)avformat$(SLIBSUF)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
79

80
AVCLIBS+=-lavcodec -L../libavcodec
81
ifeq ($(CONFIG_MP3LAME),yes)
82 83
AVCLIBS+=-lmp3lame
endif
84 85
endif

86
SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
87

88
all: $(LIB) $(SLIB)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
89

90
$(LIB): $(OBJS) $(PPOBJS)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
91
	rm -f $@
92
	$(AR) rc $@ $(OBJS) $(PPOBJS)
Michael Niedermayer's avatar
Michael Niedermayer committed
93
	$(RANLIB) $@
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
94

95
$(SLIB): $(OBJS)
Fabrice Bellard's avatar
Fabrice Bellard committed
96
ifeq ($(CONFIG_WIN32),yes)
97
	$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS) $(VPATH)/../libavcodec/avcodec.dll
98 99
	-lib /machine:i386 /def:$(@:.dll=.def)
else
100
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
101
endif
102

103
depend: $(SRCS)
104 105
	$(CC) -MM $(CFLAGS) $^ 1>.depend

106
ifeq ($(BUILD_SHARED),yes)
Fabrice Bellard's avatar
Fabrice Bellard committed
107 108
install: all install-headers
ifeq ($(CONFIG_WIN32),yes)
109
	install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
Fabrice Bellard's avatar
Fabrice Bellard committed
110
else
111
	install -d $(prefix)/lib
112
	install $(INSTALLSTRIP) -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so
113 114
	ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
	ldconfig || true
Fabrice Bellard's avatar
Fabrice Bellard committed
115 116 117
endif
else
install:
118 119
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
120
installlib: all install-headers
121
	install -m 644 $(LIB) "$(prefix)/lib"
Fabrice Bellard's avatar
Fabrice Bellard committed
122 123 124

install-headers:
	mkdir -p "$(prefix)/include/ffmpeg"
125 126 127
	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
128
                "$(prefix)/include/ffmpeg"
Fabrice Bellard's avatar
Fabrice Bellard committed
129

Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
130 131 132
%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $< 

133 134 135 136
# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
%.o: %.cpp
	g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< 

137
distclean clean: 
138
	rm -f *.o *.d .depend *~ *.a *.so $(LIB)
139 140 141 142 143 144 145

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