Makefile 3.19 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

37 38 39 40
ifeq ($(BUILD_LOCALTIME_R),yes)
OBJS+= localtime_r.o
endif

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

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

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

53
ifeq ($(CONFIG_AUDIO_BEOS),yes)
54
PPOBJS+= beosaudio.o
55 56 57
EXTRALIBS+=-lbe -lmedia
# this should be the default !
EXTRALIBS+=-lavcodec -L../libavcodec
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

68 69 70 71
ifeq ($(CONFIG_VORBIS),yes)
OBJS+= ogg.o
endif

72
LIB= $(LIBPREF)avformat$(LIBSUF)
73 74 75
ifeq ($(BUILD_SHARED),yes)
SLIB= $(SLIBPREF)avformat$(SLIBSUF)
endif
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
76

77
SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
78

79
all: $(LIB) $(SLIB)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
80

81
$(LIB): $(OBJS) $(PPOBJS)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
82
	rm -f $@
83
	$(AR) rc $@ $(OBJS) $(PPOBJS)
Michael Niedermayer's avatar
Michael Niedermayer committed
84
	$(RANLIB) $@
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
85

86
$(SLIB): $(OBJS)
87 88 89 90 91 92
ifeq ($(TARGET_MINGW32),yes)
	$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(VPATH)/../libavcodec/avcodec.dll
	-lib /machine:i386 /def:$(@:.dll=.def)
else
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(AMREXTRALIBS) 
endif
93

94
depend: $(SRCS)
95 96
	$(CC) -MM $(CFLAGS) $^ 1>.depend

97 98 99 100 101 102 103 104 105 106 107 108 109 110
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
111 112 113
installlib: all
	install -m 644 $(LIB) $(prefix)/lib
	mkdir -p $(prefix)/include/ffmpeg
114 115 116
	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
117 118
                $(prefix)/include/ffmpeg

Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
119 120 121
%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $< 

122 123 124 125
# 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
126
clean: 
127 128 129 130 131 132 133 134
	rm -f *.o *.d .depend *~ *.a $(LIB)

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