Makefile 3.7 KB
Newer Older
1 2
#
# libavformat Makefile
3
# (c) 2000-2003 Fabrice Bellard
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
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 mmf.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 \
20
      ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o daud.o
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

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
# file I/O
36 37
OBJS+= avio.o aviobuf.o file.o
OBJS+= framehook.o
Fabrice Bellard's avatar
Fabrice Bellard committed
38

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

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

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

51 52 53 54
ifeq ($(CONFIG_DC1394),yes)
OBJS+= dc1394.o
endif

55
ifeq ($(CONFIG_AUDIO_OSS),yes)
56
OBJS+= audio.o
57 58
endif

59
EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
60

61
ifeq ($(CONFIG_AUDIO_BEOS),yes)
62
PPOBJS+= beosaudio.o
63 64
endif

65
ifeq ($(CONFIG_NETWORK),yes)
66
OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o
67
# BeOS and Darwin network stuff
68
ifeq ($(NEED_INET_ATON),yes)
69 70
OBJS+= barpainet.o
endif
Fabrice Bellard's avatar
Fabrice Bellard committed
71 72
endif

73
ifeq ($(CONFIG_LIBOGG),yes)
74 75 76
OBJS+= ogg.o
endif

77 78 79 80
ifeq ($(TARGET_ARCH_SPARC64),yes)
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
endif

81
LIB= $(LIBPREF)avformat$(LIBSUF)
82
ifeq ($(BUILD_SHARED),yes)
83
LIBVERSION=$(LAVFMAJOR)
84 85 86 87 88
SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF)
AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
ifeq ($(CONFIG_DARWIN),yes)
SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
endif
89 90
endif

91
SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
92

93
all: $(LIB) $(SLIBNAME)
Fabrice Bellard's avatar
Fabrice Bellard committed
94

95
$(LIB): $(OBJS) $(PPOBJS)
Fabrice Bellard's avatar
Fabrice Bellard committed
96
	rm -f $@
97
	$(AR) rc $@ $(OBJS) $(PPOBJS)
Michael Niedermayer's avatar
Michael Niedermayer committed
98
	$(RANLIB) $@
Fabrice Bellard's avatar
Fabrice Bellard committed
99

100
$(SLIBNAME): $(OBJS)
101
ifeq ($(CONFIG_WIN32),yes)
102
	$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
103 104
	-lib /machine:i386 /def:$(@:.dll=.def)
else
105
	$(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
106
endif
107

108
depend: $(SRCS)
109 110
	$(CC) -MM $(CFLAGS) $^ 1>.depend

111
ifeq ($(BUILD_SHARED),yes)
112 113
install: all install-headers
ifeq ($(CONFIG_WIN32),yes)
114
	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
115
else
116
	install -d $(libdir)
117 118
	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/$(SLIBPREF)avformat-$(VERSION)$(SLIBSUF)
	ln -sf $(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
119
	$(LDCONFIG) || true
120 121 122
endif
else
install:
123 124
endif

125
installlib: all install-headers
126
	install -m 644 $(LIB) "$(libdir)"
127 128 129

install-headers:
	mkdir -p "$(prefix)/include/ffmpeg"
130 131 132
	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 \
133
                "$(prefix)/include/ffmpeg"
134 135
	install -d "$(libdir)/pkgconfig"
	install -m 644 ../libavformat.pc "$(libdir)/pkgconfig"
136

Fabrice Bellard's avatar
Fabrice Bellard committed
137
%.o: %.c
138
	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
Fabrice Bellard's avatar
Fabrice Bellard committed
139

140 141
# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
%.o: %.cpp
142
	g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
143

144
distclean clean:
145
	rm -f *.o *.d .depend *~ *.a *$(SLIBSUF) $(LIB)
146 147 148 149 150 151 152

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