Shared objects support
Originally committed as revision 194 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
9927c7ee0d
commit
0fd944424b
15
Makefile
15
Makefile
@ -18,17 +18,23 @@ EXT=
|
|||||||
PROG=ffmpeg ffplay ffserver
|
PROG=ffmpeg ffplay ffserver
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BUILD_SHARED),yes)
|
||||||
|
FFMPEG_LIB=-Llibavcodec -lffmpeg
|
||||||
|
else
|
||||||
|
FFMPEG_LIB=libavcodec/libavcodec.a
|
||||||
|
endif
|
||||||
|
|
||||||
all: lib $(PROG)
|
all: lib $(PROG)
|
||||||
|
|
||||||
lib:
|
lib:
|
||||||
$(MAKE) -C libavcodec all
|
$(MAKE) -C libavcodec all
|
||||||
$(MAKE) -C libav all
|
$(MAKE) -C libav all
|
||||||
|
|
||||||
ffmpeg$(EXE): ffmpeg.o libav/libav.a libavcodec/libavcodec.a
|
ffmpeg$(EXE): ffmpeg.o libav/libav.a
|
||||||
$(CC) $(LDFLAGS) -o $@ $^ -lm
|
$(CC) $(LDFLAGS) -lm -o $@ $^ $(FFMPEG_LIB)
|
||||||
|
|
||||||
ffserver$(EXE): ffserver.o libav/libav.a libavcodec/libavcodec.a
|
ffserver$(EXE): ffserver.o libav/libav.a
|
||||||
$(CC) $(LDFLAGS) -o $@ $^ -lm
|
$(CC) $(LDFLAGS) -lm -o $@ $^ $(FFMPEG_LIB)
|
||||||
|
|
||||||
ffplay: ffmpeg$(EXE)
|
ffplay: ffmpeg$(EXE)
|
||||||
ln -sf $< $@
|
ln -sf $< $@
|
||||||
@ -37,6 +43,7 @@ ffplay: ffmpeg$(EXE)
|
|||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
|
$(MAKE) -C libavcodec install
|
||||||
install -s -m 755 $(PROG) $(prefix)/bin
|
install -s -m 755 $(PROG) $(prefix)/bin
|
||||||
ln -sf ffmpeg $(prefix)/bin/ffplay
|
ln -sf ffmpeg $(prefix)/bin/ffplay
|
||||||
|
|
||||||
|
@ -39,15 +39,22 @@ endif
|
|||||||
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
|
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
|
||||||
|
|
||||||
LIB= libavcodec.a
|
LIB= libavcodec.a
|
||||||
|
ifeq ($(BUILD_SHARED),yes)
|
||||||
|
SLIB= libffmpeg-$(VERSION).so
|
||||||
|
endif
|
||||||
TESTS= imgresample-test dct-test motion-test
|
TESTS= imgresample-test dct-test motion-test
|
||||||
|
|
||||||
all: $(LIB)
|
all: $(LIB) $(SLIB)
|
||||||
tests: apiexample cpuid_test $(TESTS)
|
tests: apiexample cpuid_test $(TESTS)
|
||||||
|
|
||||||
$(LIB): $(OBJS) $(ASM_OBJS)
|
$(LIB): $(OBJS) $(ASM_OBJS)
|
||||||
rm -f $@
|
rm -f $@
|
||||||
$(AR) rcs $@ $(OBJS) $(ASM_OBJS)
|
$(AR) rcs $@ $(OBJS) $(ASM_OBJS)
|
||||||
|
|
||||||
|
$(SLIB): $(OBJS) $(ASM_OBJS)
|
||||||
|
rm -f $@
|
||||||
|
$(CC) -shared -o $@ $(OBJS) $(ASM_OBJS)
|
||||||
|
ln -sf $@ libffmpeg.so
|
||||||
dsputil.o: dsputil.c dsputil.h
|
dsputil.o: dsputil.c dsputil.h
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
@ -63,7 +70,7 @@ depend:
|
|||||||
$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
|
$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *~ *.a i386/*.o i386/*~ \
|
rm -f *.o *~ $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
|
||||||
armv4l/*.o armv4l/*~ \
|
armv4l/*.o armv4l/*~ \
|
||||||
mlib/*.o mlib/*~ \
|
mlib/*.o mlib/*~ \
|
||||||
libac3/*.o libac3/*~ \
|
libac3/*.o libac3/*~ \
|
||||||
@ -92,6 +99,13 @@ dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
|
|||||||
motion-test: motion_test.o $(LIB)
|
motion-test: motion_test.o $(LIB)
|
||||||
$(CC) -o $@ $^
|
$(CC) -o $@ $^
|
||||||
|
|
||||||
|
install: all
|
||||||
|
# install -s -m 644 $(LIB) $(prefix)/lib
|
||||||
|
ifeq ($(BUILD_SHARED),yes)
|
||||||
|
install -s -m 755 $(SLIB) $(prefix)/lib
|
||||||
|
ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
|
||||||
|
ldconfig
|
||||||
|
endif
|
||||||
#
|
#
|
||||||
# include dependency files if they exist
|
# include dependency files if they exist
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user