Makefile 3.16 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
Michael Niedermayer's avatar
Michael Niedermayer committed
20 21 22

ifeq ($(CONFIG_RISKY),yes)
OBJS+= asf.o
23
OBJS+= asf-enc.o
Michael Niedermayer's avatar
Michael Niedermayer committed
24 25
endif

26 27 28 29 30 31 32
ifeq ($(AMR_NB),yes)
OBJS+= amr.o
endif
ifeq ($(AMR_NB_FIXED),yes)
OBJS+= amr.o
endif
ifeq ($(AMR_WB),yes)
Zdenek Kabelac's avatar
Zdenek Kabelac committed
33 34 35
OBJS+= amr.o
endif

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

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

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

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

54
ifeq ($(CONFIG_AUDIO_BEOS),yes)
55
PPOBJS+= beosaudio.o
56 57 58
EXTRALIBS+=-lbe -lmedia
# this should be the default !
EXTRALIBS+=-lavcodec -L../libavcodec
59 60
endif

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

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

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

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

82
SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
83

84
all: $(LIB) $(SLIB)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
85

86
$(LIB): $(OBJS) $(PPOBJS)
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
87
	rm -f $@
88
	$(AR) rc $@ $(OBJS) $(PPOBJS)
Michael Niedermayer's avatar
Michael Niedermayer committed
89
	$(RANLIB) $@
Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
90

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

99
depend: $(SRCS)
100 101
	$(CC) -MM $(CFLAGS) $^ 1>.depend

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

Fabrice Bellard's avatar
Fabrice Bellard committed
116
installlib: all install-headers
Fabrice Bellard's avatar
Fabrice Bellard committed
117
	install -m 644 $(LIB) $(prefix)/lib
Fabrice Bellard's avatar
Fabrice Bellard committed
118 119 120

install-headers:
	mkdir -p "$(prefix)/include/ffmpeg"
121 122 123
	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
124
                "$(prefix)/include/ffmpeg"
Fabrice Bellard's avatar
Fabrice Bellard committed
125

Fabrice Bellard's avatar
merge  
Fabrice Bellard committed
126 127 128
%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $< 

129 130 131 132
# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
%.o: %.cpp
	g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< 

133
distclean clean: 
134
	rm -f *.o *.d .depend *~ *.a *.so $(LIB)
135 136 137 138 139 140 141

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