Separate library install into static and shared installation.
authorDiego Biurrun <diego@biurrun.de>
Sat, 11 Feb 2006 18:50:45 +0000 (18:50 +0000)
committerDiego Biurrun <diego@biurrun.de>
Sat, 11 Feb 2006 18:50:45 +0000 (18:50 +0000)
Originally committed as revision 4983 to svn://svn.ffmpeg.org/ffmpeg/trunk

Makefile
configure
libavcodec/Makefile
libavcodec/libpostproc/Makefile
libavformat/Makefile
libavutil/Makefile

index 6b4cab0..e91763b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -108,10 +108,7 @@ documentation:
 
 .PHONY: install
 
-install: all install-progs install-headers install-man $(INSTALLVHOOK)
-       $(MAKE) -C libavutil install
-       $(MAKE) -C libavcodec install
-       $(MAKE) -C libavformat install
+install: install-progs install-libs install-headers install-man $(INSTALLVHOOK)
 
 install-progs: $(PROG)
        install -d "$(bindir)"
@@ -133,10 +130,19 @@ endif
 install-vhook:
        $(MAKE) -C vhook install
 
-installlib:
-       $(MAKE) -C libavutil installlib
-       $(MAKE) -C libavcodec installlib
-       $(MAKE) -C libavformat installlib
+install-libs:
+       install -d $(libdir)
+ifeq ($(BUILD_SHARED),yes)
+       $(MAKE) -C libavutil   install-lib-shared
+       $(MAKE) -C libavcodec  install-lib-shared
+       $(MAKE) -C libavformat install-lib-shared
+       $(LDCONFIG) || true
+endif
+ifeq ($(BUILD_STATIC),yes)
+       $(MAKE) -C libavutil   install-lib-static
+       $(MAKE) -C libavcodec  install-lib-static
+       $(MAKE) -C libavformat install-lib-static
+endif
 
 install-headers:
        $(MAKE) -C libavutil   install-headers
index 275c312..efb8337 100755 (executable)
--- a/configure
+++ b/configure
@@ -1415,6 +1415,7 @@ echo "LDCONFIG=$LDCONFIG" >> config.mak
 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
 echo "SHFLAGS=$SHFLAGS" >> config.mak
 echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
+echo "BUILD_STATIC=$lstatic" >> config.mak
 echo "BUILDSUF=$BUILDSUF" >> config.mak
 echo "LIBPREF=$LIBPREF" >> config.mak
 echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
index 428e293..777d94c 100644 (file)
@@ -502,28 +502,23 @@ motion-test: motion_test.o $(LIB)
 fft-test: fft-test.o $(LIB)
        $(CC) -o $@ $^ $(LIBAVUTIL) -lm
 
-ifeq ($(BUILD_SHARED),yes)
-install: all
+
+install-lib-shared: $(SLIBNAME)
 ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
-       install -d $(libdir)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
                $(libdir)/$(SLIBNAME_WITH_VERSION)
        ln -sf $(SLIBNAME_WITH_VERSION) \
                $(libdir)/$(SLIBNAME_WITH_MAJOR)
        ln -sf $(SLIBNAME_WITH_VERSION) \
                $(libdir)/$(SLIBNAME)
-       $(LDCONFIG) || true
 endif
 ifeq ($(CONFIG_PP),yes)
        $(MAKE) -C libpostproc $@
 endif
-else
-install:
-endif
 
-installlib: all
+install-lib-static: $(LIB)
        install -m 644 $(LIB) "$(libdir)"
 ifeq ($(CONFIG_PP),yes)
        $(MAKE) -C libpostproc $@
index 8f32bb6..2f7ec1a 100644 (file)
@@ -48,23 +48,20 @@ $(LIB): $(OBJS)
        $(AR) rc $@ $(OBJS)
        $(RANLIB) $@
 
-install: all
-ifeq ($(BUILD_SHARED),yes)
+
+install-lib-shared: $(SLIBNAME)
 ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
-       install -d $(libdir)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
                $(libdir)/$(SLIBNAME_WITH_VERSION)
        ln -sf $(SLIBNAME_WITH_VERSION) \
                $(libdir)/$(SLIBNAME_WITH_MAJOR)
        ln -sf $(SLIBNAME_WITH_VERSION) \
                $(libdir)/$(SLIBNAME)
-       $(LDCONFIG) || true
-endif
 endif
 
-installlib: all
+install-lib-static: $(LIB)
        install -m 644 $(LIB) "$(libdir)"
 
 install-headers:
index 6f4f680..a33143d 100644 (file)
@@ -124,25 +124,20 @@ endif
 depend: $(SRCS)
        $(CC) -MM $(CFLAGS) $^ 1>.depend
 
-ifeq ($(BUILD_SHARED),yes)
-install: all
+
+install-lib-shared: $(SLIBNAME)
 ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
-       install -d $(libdir)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
                $(libdir)/$(SLIBNAME_WITH_VERSION)
        ln -sf $(SLIBNAME_WITH_VERSION) \
                $(libdir)/$(SLIBNAME_WITH_MAJOR)
        ln -sf $(SLIBNAME_WITH_VERSION) \
                $(libdir)/$(SLIBNAME)
-       $(LDCONFIG) || true
-endif
-else
-install:
 endif
 
-installlib: all
+install-lib-static: $(LIB)
        install -m 644 $(LIB) "$(libdir)"
 
 install-headers:
index a27ed55..2a75cb3 100644 (file)
@@ -60,25 +60,19 @@ distclean: clean
        rm -f .depend
 
 
-ifeq ($(BUILD_SHARED),yes)
-install: all
+install-lib-shared: $(SLIBNAME)
 ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
-       install -d $(libdir)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
                $(libdir)/$(SLIBNAME_WITH_VERSION)
        ln -sf $(SLIBNAME_WITH_VERSION) \
                $(libdir)/$(SLIBNAME_WITH_MAJOR)
        ln -sf $(SLIBNAME_WITH_VERSION) \
                $(libdir)/$(SLIBNAME)
-       $(LDCONFIG) || true
-endif
-else
-install:
 endif
 
-installlib: all
+install-lib-static: $(LIB)
        install -m 644 $(LIB) "$(libdir)"
 
 install-headers: