Mercurial > libavformat.hg
comparison Makefile @ 859:889aa3ced0f3 libavformat
support for building dynamic libraries on Mac OS X
based on a patch by Lina Pezzella <J4rg0n -- at -- gentoo -- dot -- org>
author | diego |
---|---|
date | Mon, 26 Sep 2005 10:05:13 +0000 |
parents | f5a33919749a |
children | 9a18db8b5ae2 |
comparison
equal
deleted
inserted
replaced
858:66cc656ea404 | 859:889aa3ced0f3 |
---|---|
79 CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc | 79 CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc |
80 endif | 80 endif |
81 | 81 |
82 LIB= $(LIBPREF)avformat$(LIBSUF) | 82 LIB= $(LIBPREF)avformat$(LIBSUF) |
83 ifeq ($(BUILD_SHARED),yes) | 83 ifeq ($(BUILD_SHARED),yes) |
84 SLIB= $(SLIBPREF)avformat$(SLIBSUF) | 84 SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF) |
85 | 85 AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil |
86 AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec | 86 ifeq ($(CONFIG_DARWIN),yes) |
87 SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION) | |
88 endif | |
87 ifeq ($(CONFIG_MP3LAME),yes) | 89 ifeq ($(CONFIG_MP3LAME),yes) |
88 AVCLIBS+=-lmp3lame | 90 AVCLIBS+=-lmp3lame |
89 endif | 91 endif |
90 endif | 92 endif |
91 | 93 |
92 SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp) | 94 SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp) |
93 | 95 |
94 all: $(LIB) $(SLIB) | 96 all: $(LIB) $(SLIBNAME) |
95 | 97 |
96 $(LIB): $(OBJS) $(PPOBJS) | 98 $(LIB): $(OBJS) $(PPOBJS) |
97 rm -f $@ | 99 rm -f $@ |
98 $(AR) rc $@ $(OBJS) $(PPOBJS) | 100 $(AR) rc $@ $(OBJS) $(PPOBJS) |
99 $(RANLIB) $@ | 101 $(RANLIB) $@ |
100 | 102 |
101 $(SLIB): $(OBJS) | 103 $(SLIBNAME): $(OBJS) |
102 ifeq ($(CONFIG_WIN32),yes) | 104 ifeq ($(CONFIG_WIN32),yes) |
103 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS) | 105 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS) |
104 -lib /machine:i386 /def:$(@:.dll=.def) | 106 -lib /machine:i386 /def:$(@:.dll=.def) |
105 else | 107 else |
106 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS) | 108 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS) |
110 $(CC) -MM $(CFLAGS) $^ 1>.depend | 112 $(CC) -MM $(CFLAGS) $^ 1>.depend |
111 | 113 |
112 ifeq ($(BUILD_SHARED),yes) | 114 ifeq ($(BUILD_SHARED),yes) |
113 install: all install-headers | 115 install: all install-headers |
114 ifeq ($(CONFIG_WIN32),yes) | 116 ifeq ($(CONFIG_WIN32),yes) |
115 install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)" | 117 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)" |
116 else | 118 else |
117 install -d $(libdir) | 119 install -d $(libdir) |
118 install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavformat-$(VERSION).so | 120 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/$(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) |
119 ln -sf libavformat-$(VERSION).so $(libdir)/libavformat.so | 121 ln -sf $(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME) |
120 $(LDCONFIG) || true | 122 $(LDCONFIG) || true |
121 endif | 123 endif |
122 else | 124 else |
123 install: | 125 install: |
124 endif | 126 endif |
141 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings | 143 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings |
142 %.o: %.cpp | 144 %.o: %.cpp |
143 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< | 145 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< |
144 | 146 |
145 distclean clean: | 147 distclean clean: |
146 rm -f *.o *.d .depend *~ *.a *.so $(LIB) | 148 rm -f *.o *.d .depend *~ *.a *$(SLIBSUF) $(LIB) |
147 | 149 |
148 # | 150 # |
149 # include dependency files if they exist | 151 # include dependency files if they exist |
150 # | 152 # |
151 ifneq ($(wildcard .depend),) | 153 ifneq ($(wildcard .depend),) |