diff --git a/Makefile b/Makefile index b28ae207..a0f5ec3e 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,38 @@ include Make.inc -all: libd based precd kryld utild cbindd +all: dirs based precd kryld utild cbindd libd @echo "=====================================" @echo "PSBLAS libraries Compilation Successful." -based: libd +dirs: + (if test ! -d lib ; then mkdir lib; fi) + (if test ! -d include ; then mkdir include; fi; $(INSTALL_DATA) Make.inc include/Make.inc.psblas) + (if test ! -d modules ; then mkdir modules; fi;) + precd: based utild: based kryld: precd -cbindd: precd kryld utild +cbindd: based precd kryld utild -libd: - (if test ! -d lib ; then mkdir lib; fi) - (if test ! -d include ; then mkdir include; fi; $(INSTALL_DATA) Make.inc include/Make.inc.psblas) - (if test ! -d modules ; then mkdir modules; fi;) -based: +libd: based precd kryld utild cbindd $(MAKE) -C base lib -precd: $(MAKE) -C prec lib -kryld: $(MAKE) -C krylov lib -utild: $(MAKE) -C util lib + $(MAKE) -C cbind lib + +based: + $(MAKE) -C base objs +precd: + $(MAKE) -C prec objs +kryld: + $(MAKE) -C krylov objs +utild: + $(MAKE) -C util objs cbindd: - $(MAKE) -C cbind lib + $(MAKE) -C cbind objs + install: all mkdir -p $(INSTALL_INCLUDEDIR) &&\ diff --git a/base/Makefile b/base/Makefile index 039a5963..246f0074 100644 --- a/base/Makefile +++ b/base/Makefile @@ -6,24 +6,31 @@ INCDIR=../include MODDIR=../modules LIBNAME=$(BASELIBNAME) -lib: mods sr cm in pb tl +objs: mods sr cm in pb tl + +lib: objs + $(MAKE) -C modules lib LIBNAME=$(BASELIBNAME) F90="$(MPF90)" F90COPT="$(F90COPT) $(MPI_OPT)" + $(MAKE) -C serial lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C comm lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C internals lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C psblas lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C tools lib LIBNAME=$(BASELIBNAME) /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) sr cm in pb tl: mods mods: - $(MAKE) -C modules lib LIBNAME=$(BASELIBNAME) F90="$(MPF90)" F90COPT="$(F90COPT) $(MPI_OPT)" + $(MAKE) -C modules objs LIBNAME=$(BASELIBNAME) F90="$(MPF90)" F90COPT="$(F90COPT) $(MPI_OPT)" sr: - $(MAKE) -C serial lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C serial objs LIBNAME=$(BASELIBNAME) cm: - $(MAKE) -C comm lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C comm objs LIBNAME=$(BASELIBNAME) in: - $(MAKE) -C internals lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C internals objs LIBNAME=$(BASELIBNAME) pb: - $(MAKE) -C psblas lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C psblas objs LIBNAME=$(BASELIBNAME) tl: - $(MAKE) -C tools lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C tools objs LIBNAME=$(BASELIBNAME) clean: ($(MAKE) -C modules clean) diff --git a/base/comm/Makefile b/base/comm/Makefile index 950a95a0..dfa1bed8 100644 --- a/base/comm/Makefile +++ b/base/comm/Makefile @@ -27,12 +27,15 @@ INCDIR=.. MODDIR=../modules FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) -lib: interns mpfobjs $(OBJS) +objs: interns mpfobjs $(OBJS) + +lib: objs + $(MAKE) -C internals lib LIBNAME=$(LIBNAME) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) interns: - $(MAKE) -C internals lib + $(MAKE) -C internals objs mpfobjs: $(MAKE) $(MPFOBJS) FC="$(MPFC)" diff --git a/base/comm/internals/Makefile b/base/comm/internals/Makefile index 45a7ad46..695f2065 100644 --- a/base/comm/internals/Makefile +++ b/base/comm/internals/Makefile @@ -31,7 +31,8 @@ MODDIR=../../modules FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) CINCLUDES=-I. -lib: mpfobjs $(FOBJS) $(MPFOBJS) +objs: mpfobjs $(FOBJS) $(MPFOBJS) +lib: objs $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) $(COBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/internals/Makefile b/base/internals/Makefile index 73fcfca4..1bb3f105 100644 --- a/base/internals/Makefile +++ b/base/internals/Makefile @@ -16,7 +16,8 @@ MODDIR=../modules FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) CINCLUDES=-I. -lib: mpfobjs $(FOBJS) $(FOBJS2) $(COBJS) $(MPFOBJS2) $(MPFOBJS) +objs: mpfobjs $(FOBJS) $(FOBJS2) $(COBJS) $(MPFOBJS2) $(MPFOBJS) +lib: objs $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) $(COBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/modules/Makefile b/base/modules/Makefile index cfc3c9a4..399add1f 100644 --- a/base/modules/Makefile +++ b/base/modules/Makefile @@ -108,15 +108,18 @@ UTIL_MODS = desc/psb_desc_const_mod.o desc/psb_indx_map_mod.o\ MODULES=$(BASIC_MODS) $(SERIAL_MODS) $(UTIL_MODS) OBJS = error.o psb_base_mod.o $(EXTRA_COBJS) cutil.o -LIBDIR=.. +MODDIR=../../modules +LIBDIR=../ CINCLUDES=-I. FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). $(FIFLAG). -lib: $(LIBDIR)/$(LIBNAME) - /bin/cp -p $(CPUPDFLAG) *$(.mod) $(LIBDIR) +objs: $(MODULES) $(OBJS) $(MPFOBJS) + /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) -$(LIBDIR)/$(LIBNAME): $(MODULES) $(OBJS) $(MPFOBJS) +lib: objs $(LIBDIR)/$(LIBNAME) + +$(LIBDIR)/$(LIBNAME): objs $(AR) $(LIBDIR)/$(LIBNAME) $(MODULES) $(OBJS) $(MPFOBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/psblas/Makefile b/base/psblas/Makefile index a16ab35c..7d03f1f0 100644 --- a/base/psblas/Makefile +++ b/base/psblas/Makefile @@ -24,7 +24,9 @@ MODDIR=../modules FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) -lib: $(OBJS) +objs: $(OBJS) + +lib: objs $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/serial/Makefile b/base/serial/Makefile index 0f17a0a4..ec0e2c82 100644 --- a/base/serial/Makefile +++ b/base/serial/Makefile @@ -20,18 +20,19 @@ INCDIR=.. MODDIR=../modules FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) -lib: impld sortd lib1 $(FOBJS) + +objs: impld sortd $(FOBJS) +lib: objs + $(MAKE) -C impl lib + $(MAKE) -C sort lib $(AR) $(LIBDIR)/$(LIBNAME) $(FOBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) -#cood csrd jadd - -lib1: $(FOBJS) impld: - $(MAKE) -C impl lib + $(MAKE) -C impl objs sortd: - $(MAKE) -C sort lib + $(MAKE) -C sort objs clean: /bin/rm -f $(FOBJS) *$(.mod) ($(MAKE) -C impl clean) diff --git a/base/serial/impl/Makefile b/base/serial/impl/Makefile index 97662ba6..00088741 100644 --- a/base/serial/impl/Makefile +++ b/base/serial/impl/Makefile @@ -36,9 +36,9 @@ LIBFILE=$(LIBDIR)/$(LIBNAME) # -default: lib +objs: $(OBJS) -lib: $(OBJS) +lib: objs $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/serial/sort/Makefile b/base/serial/sort/Makefile index c381e3f5..2ef6420a 100644 --- a/base/serial/sort/Makefile +++ b/base/serial/sort/Makefile @@ -27,9 +27,9 @@ LIBFILE=$(LIBDIR)/$(LIBNAME) # -default: lib +objs: $(OBJS) -lib: $(OBJS) +lib: objs $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/tools/Makefile b/base/tools/Makefile index 968aec18..771e85fc 100644 --- a/base/tools/Makefile +++ b/base/tools/Makefile @@ -40,7 +40,9 @@ INCDIR=.. MODDIR=../modules FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) $(FIFLAG)$(MODDIR) -lib: mpfobjs $(FOBJS) +objs: mpfobjs $(FOBJS) + +lib: objs $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(FOBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/cbind/Makefile b/cbind/Makefile index 2abb6cfe..acc82fa9 100644 --- a/cbind/Makefile +++ b/cbind/Makefile @@ -6,20 +6,25 @@ INCDIR=../include MODDIR=../modules/ LIBNAME=$(CBINDLIBNAME) -lib: based precd krylovd utild - /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) +objs: based precd krylovd utild /bin/cp -p $(CPUPDFLAG) *.h $(INCDIR) /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) +lib: objs + cd base && $(MAKE) lib LIBNAME=$(LIBNAME) + cd prec && $(MAKE) lib LIBNAME=$(LIBNAME) + cd krylov && $(MAKE) lib LIBNAME=$(LIBNAME) + cd util && $(MAKE) lib LIBNAME=$(LIBNAME) + /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) based: - cd base && $(MAKE) lib LIBNAME=$(LIBNAME) + cd base && $(MAKE) objs LIBNAME=$(LIBNAME) precd: based - cd prec && $(MAKE) lib LIBNAME=$(LIBNAME) + cd prec && $(MAKE) objs LIBNAME=$(LIBNAME) krylovd: based precd - cd krylov && $(MAKE) lib LIBNAME=$(LIBNAME) + cd krylov && $(MAKE) objs LIBNAME=$(LIBNAME) utild: based - cd util && $(MAKE) lib LIBNAME=$(LIBNAME) + cd util && $(MAKE) objs LIBNAME=$(LIBNAME) clean: cd base && $(MAKE) clean diff --git a/cbind/base/Makefile b/cbind/base/Makefile index e66da0c4..2b744829 100644 --- a/cbind/base/Makefile +++ b/cbind/base/Makefile @@ -27,10 +27,11 @@ OBJS=$(FOBJS) $(COBJS) LIBNAME=$(CBINDLIBNAME) -lib: $(OBJS) $(CMOD) +objs: $(OBJS) $(CMOD) + /bin/cp -p *$(.mod) $(CMOD) $(HERE) +lib: objs $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) - /bin/cp -p *$(.mod) $(CMOD) $(HERE) $(COBJS): $(CMOD) diff --git a/cbind/krylov/Makefile b/cbind/krylov/Makefile index 2706271a..041e23d4 100644 --- a/cbind/krylov/Makefile +++ b/cbind/krylov/Makefile @@ -16,11 +16,12 @@ CMOD=psb_krylov_cbind.h LIBNAME=$(CKRYLOVLIBNAME) -lib: $(OBJS) $(CMOD) +objs: $(OBJS) $(CMOD) + /bin/cp -p *$(.mod) $(CMOD) $(HERE) +lib: objs $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p *$(.mod) $(CMOD) $(HERE) psb_skrylov_cbind_mod.o psb_dkrylov_cbind_mod.o psb_ckrylov_cbind_mod.o psb_zkrylov_cbind_mod.o: psb_base_krylov_cbind_mod.o veryclean: clean diff --git a/cbind/prec/Makefile b/cbind/prec/Makefile index 8dee57e8..c6f53bf8 100644 --- a/cbind/prec/Makefile +++ b/cbind/prec/Makefile @@ -18,11 +18,12 @@ CMOD=psb_prec_cbind.h psb_c_sprec.h psb_c_dprec.h psb_c_cprec.h psb_c_zprec.h LIBNAME=$(CPRECLIBNAME) -lib: $(OBJS) $(CMOD) +objs: $(OBJS) $(CMOD) + /bin/cp -p *$(.mod) $(CMOD) $(HERE) +lib: objs $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p *$(.mod) $(CMOD) $(HERE) psb_prec_cbind_mod.o: psb_sprec_cbind_mod.o psb_dprec_cbind_mod.o psb_cprec_cbind_mod.o psb_zprec_cbind_mod.o veryclean: clean diff --git a/cbind/util/Makefile b/cbind/util/Makefile index d37cb680..62733d4a 100644 --- a/cbind/util/Makefile +++ b/cbind/util/Makefile @@ -18,11 +18,12 @@ CMOD=psb_util_cbind.h psb_c_cutil.h psb_c_zutil.h psb_c_dutil.h psb_c_sutil.h LIBNAME=$(CUTILLIBNAME) -lib: $(OBJS) $(CMOD) +objs: $(OBJS) $(CMOD) + /bin/cp -p *$(.mod) $(CMOD) $(HERE) +lib: objs $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p *$(.mod) $(CMOD) $(HERE) psb_util_cbind_mod.o: psb_c_util_cbind_mod.o psb_d_util_cbind_mod.o psb_s_util_cbind_mod.o psb_z_util_cbind_mod.o veryclean: clean diff --git a/krylov/Makefile b/krylov/Makefile index ab9a3933..f71dbb1a 100644 --- a/krylov/Makefile +++ b/krylov/Makefile @@ -26,11 +26,13 @@ LIBNAME=$(METHDLIBNAME) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) -lib: $(OBJS) +objs: $(OBJS) + /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) + +lib: objs $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) psb_s_krylov_conv_mod.o psb_c_krylov_conv_mod.o psb_d_krylov_conv_mod.o psb_z_krylov_conv_mod.o: psb_base_krylov_conv_mod.o diff --git a/prec/Makefile b/prec/Makefile index 55a81cd5..5d7523f4 100644 --- a/prec/Makefile +++ b/prec/Makefile @@ -28,14 +28,16 @@ COBJS= FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) OBJS=$(F90OBJS) $(COBJS) $(MPFOBJS) $(MODOBJS) -lib: $(OBJS) impld +objs: $(OBJS) impld + /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) +lib: objs + $(MAKE) -C impl lib $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) impld: $(OBJS) - $(MAKE) -C impl + $(MAKE) -C impl objs $(OBJS): $(MODDIR)/$(BASEMODNAME)$(.mod) diff --git a/prec/impl/Makefile b/prec/impl/Makefile index 19a200bb..bc5ef2e1 100644 --- a/prec/impl/Makefile +++ b/prec/impl/Makefile @@ -42,7 +42,8 @@ LIBNAME=$(PRECLIBNAME) COBJS= FINCLUDES=$(FMFLAG).. $(FMFLAG)$(MODDIR) -lib: $(OBJS) +objs: $(OBJS) +lib: objs $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) diff --git a/util/Makefile b/util/Makefile index 4f4a134a..3f087cbd 100644 --- a/util/Makefile +++ b/util/Makefile @@ -29,11 +29,12 @@ LIBNAME=$(UTILLIBNAME) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) +objs: $(OBJS) + /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) lib: $(HERE)/$(LIBNAME) /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) -$(HERE)/$(LIBNAME): $(OBJS) +$(HERE)/$(LIBNAME): objs $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME)