Makefile 2.89 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 -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 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 \
18
      nut.o wc3movie.o mp3.o
Michael Niedermayer's avatar
Michael Niedermayer committed
19 20 21 22 23

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

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

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

Fabrice Bellard's avatar
Fabrice Bellard committed
34 35
ifeq ($(CONFIG_VIDEO4LINUX),yes)
OBJS+= grab.o
Fabrice Bellard's avatar
Fabrice Bellard committed
36
endif
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
37

38 39 40 41
ifeq ($(CONFIG_DV1394),yes)
OBJS+= dv1394.o
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
42 43 44 45
ifeq ($(CONFIG_AUDIO_OSS),yes)
OBJS+= audio.o 
endif

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

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

61 62 63 64
ifeq ($(CONFIG_VORBIS),yes)
OBJS+= ogg.o
endif

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

70
SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
71

72
all: $(LIB) $(SLIB)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
73

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

79
$(SLIB): $(OBJS)
Fabrice Bellard's avatar
Fabrice Bellard committed
80
ifeq ($(CONFIG_WIN32),yes)
81 82 83 84 85
	$(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
86

87
depend: $(SRCS)
88 89
	$(CC) -MM $(CFLAGS) $^ 1>.depend

90
ifeq ($(BUILD_SHARED),yes)
Fabrice Bellard's avatar
Fabrice Bellard committed
91 92 93 94
install: all install-headers
ifeq ($(CONFIG_WIN32),yes)
	install -s -m 755 $(SLIB) "$(prefix)"
else
95 96 97 98
	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
Fabrice Bellard's avatar
Fabrice Bellard committed
99 100 101
endif
else
install:
102 103
endif

Fabrice Bellard's avatar
Fabrice Bellard committed
104
installlib: all install-headers
Fabrice Bellard's avatar
Fabrice Bellard committed
105
	install -m 644 $(LIB) $(prefix)/lib
Fabrice Bellard's avatar
Fabrice Bellard committed
106 107 108

install-headers:
	mkdir -p "$(prefix)/include/ffmpeg"
109 110 111
	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
112
                "$(prefix)/include/ffmpeg"
Fabrice Bellard's avatar
Fabrice Bellard committed
113

Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
114 115 116
%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $< 

117 118 119 120
# 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
121
clean: 
122 123 124 125 126 127 128 129
	rm -f *.o *.d .depend *~ *.a $(LIB)

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