From f9015069d086b143c960ea9ccd96ff0237add1fe Mon Sep 17 00:00:00 2001 From: hartmann Date: Thu, 29 Apr 2004 14:00:58 +0000 Subject: [PATCH] Put the _contents_ of several petsc archives into one instead of collecting several archives into another one. git-svn-id: https://svn.dealii.org/trunk@9119 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lib/Makefile | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/deal.II/lib/Makefile b/deal.II/lib/Makefile index 13898420bf..97de411420 100644 --- a/deal.II/lib/Makefile +++ b/deal.II/lib/Makefile @@ -65,14 +65,31 @@ endif @echo "======================optimized========= Linking library: libpetsc$(lib-suffix)" @$(CXX) -shared -o libpetsc$(lib-suffix) \ -Wl,-rpath,$(lib-contrib-petsc-path.o) $(xlib.o) - else - external-links-petsc: +else + + # As I don't know how to merge archives, here a workaround: First extract all + # the archives into a newly created directory. Then put all the files into a + # single new archive. Do the same for debug and optimized mode. + external-links-petsc: @echo Setting up libraries for PETSc - @echo "======================debug============= Linking library: libpetsc.g$(lib-suffix)" - @$(AR) ru libpetsc.g$(lib-suffix) $(xlib.g) - @echo "======================optimized========= Linking library: libpetsc$(lib-suffix)" - @$(AR) ru libpetsc$(lib-suffix) $(xlib.o) - endif + @echo "======================debug============= Linking library: libpetsc.g.a" + @mkdir ar_tmp; cd ar_tmp; \ + for arfile in $(xlib.g) ; do \ + $(AR) x $$arfile; \ + done + @$(AR) ru libpetsc.g.a ar_tmp/* + @rm -r ar_tmp + @$(RANLIB) libpetsc.g.a + @echo "======================optimized========= Linking library: libpetsc.a" + @mkdir ar_tmp; cd ar_tmp; \ + for arfile in $(xlib.o) ; do \ + $(AR) x $$arfile; \ + done + @$(AR) ru libpetsc.a ar_tmp/* + @rm -r ar_tmp + @$(RANLIB) libpetsc.a +endif + else external-links-petsc: -- 2.39.5