Makefile 2.92 KB
Newer Older
Fabrice Bellard's avatar
Fabrice Bellard committed
1 2 3 4
#
# libavformat Makefile
# (c) 2000, 2001, 2002 Fabrice Bellard
#
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) -Wall -g -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

Fabrice Bellard's avatar
Fabrice Bellard committed
11
OBJS= utils.o cutils.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 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
Michael Niedermayer's avatar
Michael Niedermayer committed
18 19 20 21 22

ifeq ($(CONFIG_RISKY),yes)
OBJS+= asf.o
endif

Zdenek Kabelac's avatar
Zdenek Kabelac committed
23 24 25 26
ifeq ($(AMR_NB),yes)
OBJS+= amr.o
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
27
# image formats
Fabrice Bellard's avatar
Fabrice Bellard committed
28
OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o
Fabrice Bellard's avatar
Fabrice Bellard committed
29 30
# file I/O
OBJS+= avio.o aviobuf.o file.o 
Fabrice Bellard's avatar
Fabrice Bellard committed
31
OBJS+= framehook.o 
Fabrice Bellard's avatar
Fabrice Bellard committed
32

33 34 35 36
ifeq ($(BUILD_STRPTIME),yes)
OBJS+= strptime.o
endif

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

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

Fabrice Bellard's avatar
Fabrice Bellard committed
45 46 47 48
ifeq ($(CONFIG_AUDIO_OSS),yes)
OBJS+= audio.o 
endif

49
ifeq ($(CONFIG_AUDIO_BEOS),yes)
50
PPOBJS+= beosaudio.o
51 52 53
EXTRALIBS+=-lbe -lmedia
# this should be the default !
EXTRALIBS+=-lavcodec -L../libavcodec
54 55
endif

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

64 65 66 67
ifeq ($(CONFIG_VORBIS),yes)
OBJS+= ogg.o
endif

68
LIB= $(LIBPREF)avformat$(LIBSUF)
69 70 71
ifeq ($(BUILD_SHARED),yes)
SLIB= $(SLIBPREF)avformat$(SLIBSUF)
endif
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
72

73
SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
74

75
all: $(LIB) $(SLIB)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
76

77
$(LIB): $(OBJS) $(PPOBJS)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
78
	rm -f $@
79
	$(AR) rc $@ $(OBJS) $(PPOBJS)
Michael Niedermayer's avatar
Michael Niedermayer committed
80
	$(RANLIB) $@
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
81

82
$(SLIB): $(OBJS)
83
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(AMREXTRALIBS)
84

85
depend: $(SRCS)
86 87
	$(CC) -MM $(CFLAGS) $^ 1>.depend

88 89 90 91 92 93 94 95 96 97 98 99 100 101
install: all
ifeq ($(BUILD_SHARED),yes)
	install -d $(prefix)/lib
	install -s -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so
	ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
	ldconfig || true
	mkdir -p $(prefix)/include/ffmpeg
	install -m 644 $(VPATH)/avformat.h $(prefix)/include/ffmpeg/avformat.h
	install -m 644 $(VPATH)/avio.h $(prefix)/include/ffmpeg/avio.h
	install -m 644 $(VPATH)/rtp.h $(prefix)/include/ffmpeg/rtp.h
	install -m 644 $(VPATH)/rtsp.h $(prefix)/include/ffmpeg/rtsp.h
	install -m 644 $(VPATH)/rtspcodes.h $(prefix)/include/ffmpeg/rtspcodes.h
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
102 103 104
installlib: all
	install -m 644 $(LIB) $(prefix)/lib
	mkdir -p $(prefix)/include/ffmpeg
105 106 107
	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
108 109
                $(prefix)/include/ffmpeg

Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
110 111 112
%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $< 

113 114 115 116
# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
%.o: %.cpp
	g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< 

Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
117
clean: 
118 119 120 121 122 123 124 125
	rm -f *.o *.d .depend *~ *.a $(LIB)

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