diff --git a/Make.inc.in b/Make.inc.in index 39cc4a0d..d1f110cd 100755 --- a/Make.inc.in +++ b/Make.inc.in @@ -49,6 +49,9 @@ INSTALL_LIBDIR=@INSTALL_LIBDIR@ INSTALL_INCLUDEDIR=@INSTALL_INCLUDEDIR@ INSTALL_DOCSDIR=@INSTALL_DOCSDIR@ +# the following is the flag for /bin/cp which shall copy the file only for updating (timestamp based)--on GNU Linux, '-u' +CPUPDFLAG= + LIBDIR=@LIBDIR@ RSB_LIBS=@RSB_LIBS@ BASELIBNAME=@BASELIBNAME@ diff --git a/base/Makefile b/base/Makefile index 484c89e2..639035b9 100644 --- a/base/Makefile +++ b/base/Makefile @@ -4,9 +4,13 @@ HERE=. LIBDIR=../lib LIBNAME=$(BASELIBNAME) LIBMOD=psb_base_mod$(.mod) -lib: mods sr cm in pb tl - /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(LIBMOD) *$(.mod) $(LIBDIR) +lib: $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(LIBMOD) mods sr cm in pb tl + +$(LIBDIR)/$(LIBNAME): $(HERE)/$(LIBNAME) + /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) + +$(LIBDIR)/$(LIBMOD): + /bin/cp -p $(CPUPDFLAG) $(LIBMOD) *$(.mod) $(LIBDIR) sr cm in pb tl: mods diff --git a/base/comm/Makefile b/base/comm/Makefile index fe2a96ec..95edf220 100644 --- a/base/comm/Makefile +++ b/base/comm/Makefile @@ -13,7 +13,9 @@ LIBDIR=.. MODDIR=../modules FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). -lib: mpfobjs $(OBJS) +lib: mpfobjs $(OBJS) $(LIBDIR)/$(LIBNAME) + +$(LIBDIR)/$(LIBNAME): $(MPFOBJS) $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/internals/Makefile b/base/internals/Makefile index a1554429..5f1d5dc7 100644 --- a/base/internals/Makefile +++ b/base/internals/Makefile @@ -22,9 +22,11 @@ MODDIR=../modules FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). CINCLUDES=-I. -lib: mpfobjs $(FOBJS) $(FOBJS2) $(COBJS) $(MPFOBJS2) - $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) \ - $(COBJS) +lib: mpfobjs $(FOBJS) $(FOBJS2) $(COBJS) $(MPFOBJS2) $(LIBDIR)/$(LIBNAME) + + +$(LIBDIR)/$(LIBNAME): $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) + $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) $(COBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) $(FOBJS) $(FBOJS2): $(MODDIR)/psi_mod$(.mod) diff --git a/base/modules/Makefile b/base/modules/Makefile index c5dae3ac..d5ad4304 100644 --- a/base/modules/Makefile +++ b/base/modules/Makefile @@ -32,12 +32,13 @@ CINCLUDES=-I. FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). $(FIFLAG). -lib: penvmod $(UTIL_MODS) $(OBJS) - $(AR) $(LIBDIR)/$(LIBNAME) $(MODULES) $(OBJS) $(MPFOBJS) - $(RANLIB) $(LIBDIR)/$(LIBNAME) +lib: penvmod $(UTIL_MODS) $(OBJS) $(LIBDIR)/$(LIBNAME) /bin/cp -p $(CPUPDFLAG) $(LIBMOD) $(LIBDIR) /bin/cp -p $(CPUPDFLAG) *$(.mod) $(LIBDIR) +$(LIBDIR)/$(LIBNAME): $(MODULES) $(OBJS) $(MPFOBJS) + $(AR) $(LIBDIR)/$(LIBNAME) $(MODULES) $(OBJS) $(MPFOBJS) + $(RANLIB) $(LIBDIR)/$(LIBNAME) psi_comm_buffers_mod.o: psb_const_mod.o psi_penv_mod.o: psi_comm_buffers_mod.o psb_const_mod.o psb_realloc_mod.o diff --git a/base/psblas/Makefile b/base/psblas/Makefile index fbb06a8b..a6c419ca 100644 --- a/base/psblas/Makefile +++ b/base/psblas/Makefile @@ -17,7 +17,9 @@ MODDIR=../modules FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). -lib: $(OBJS) +lib: $(LIBDIR)/$(LIBNAME) + +$(LIBDIR)/$(LIBNAME): $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/serial/Makefile b/base/serial/Makefile index 684d7baa..2fa7224c 100644 --- a/base/serial/Makefile +++ b/base/serial/Makefile @@ -12,7 +12,9 @@ LIBDIR=.. MODDIR=../modules FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). -lib: auxd f77d impld lib1 +lib: auxd f77d impld lib1 $(LIBDIR)/$(LIBNAME) + +$(LIBDIR)/$(LIBNAME): $(FOBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(FOBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/serial/aux/Makefile b/base/serial/aux/Makefile index 05f83793..c8880a9e 100644 --- a/base/serial/aux/Makefile +++ b/base/serial/aux/Makefile @@ -31,9 +31,12 @@ FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG)$(SPARKERDIR) $(FMFLAG default: lib -lib: $(OBJS) +lib: $(LIBDIR)/$(LIBNAME) + +$(LIBDIR)/$(LIBNAME): $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) + zlsr.o zlsrx.o: zlcmp_mod.o zalsr.o zalsrx.o: zalcmp_mod.o zasr.o zasrx.o: zacmp_mod.o diff --git a/base/serial/f77/Makefile b/base/serial/f77/Makefile index 52a024a3..68312db2 100644 --- a/base/serial/f77/Makefile +++ b/base/serial/f77/Makefile @@ -26,7 +26,9 @@ LIBFILE=$(LIBDIR)/$(LIBNAME) default: lib -lib: $(OBJS) +lib: $(LIBDIR)/$(LIBNAME) + +$(LIBDIR)/$(LIBNAME): $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/serial/impl/Makefile b/base/serial/impl/Makefile index 9e1e2260..cde0dfbc 100644 --- a/base/serial/impl/Makefile +++ b/base/serial/impl/Makefile @@ -28,7 +28,9 @@ LIBFILE=$(LIBDIR)/$(LIBNAME) default: lib -lib: $(OBJS) +lib: $(LIBDIR)/$(LIBNAME) + +$(LIBDIR)/$(LIBNAME): $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/base/tools/Makefile b/base/tools/Makefile index 2af4b6b6..298fc67f 100644 --- a/base/tools/Makefile +++ b/base/tools/Makefile @@ -27,7 +27,9 @@ LIBDIR=.. MODDIR=../modules FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). $(FIFLAG)$(MODDIR) -lib: mpfobjs $(FOBJS) +lib: mpfobjs $(FOBJS) $(LIBDIR)/$(LIBNAME) + +$(LIBDIR)/$(LIBNAME): $(MPFOBJS) $(FOBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(FOBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) diff --git a/krylov/Makefile b/krylov/Makefile index b1a82f81..78b1e054 100644 --- a/krylov/Makefile +++ b/krylov/Makefile @@ -24,11 +24,17 @@ LIBNAME=$(METHDLIBNAME) FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). -lib: $(OBJS) +lib: $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(LIBMOD) + +$(LIBDIR)/$(LIBNAME): $(HERE)/$(LIBNAME) + /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) + +$(LIBDIR)/$(LIBMOD): + /bin/cp -p $(CPUPDFLAG) $(LIBMOD) $(LIBDIR) + +$(HERE)/$(LIBNAME): $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) - /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(LIBMOD) $(LIBDIR) psb_s_inner_krylov_mod.o psb_c_inner_krylov_mod.o psb_d_inner_krylov_mod.o psb_z_inner_krylov_mod.o: psb_base_inner_krylov_mod.o psb_inner_krylov_mod.o: psb_s_inner_krylov_mod.o psb_c_inner_krylov_mod.o psb_d_inner_krylov_mod.o psb_z_inner_krylov_mod.o diff --git a/opt/Makefile b/opt/Makefile index e84f46c0..3aaba616 100644 --- a/opt/Makefile +++ b/opt/Makefile @@ -22,12 +22,13 @@ OBJS=psb_d_ell_impl.o psb_d_ell_mat_mod.o rsb_mod.o psb_d_rsb_mat_mod.o LIBNAME=libpsb_opt.a -lib: $(LIBNAME) +lib: $(HERE)/$(LIBNAME) + /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) + /bin/cp -p $(CPUPDFLAG) $(LIBMOD) $(LIBDIR) + +$(HERE)/$(LIBNAME): $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) - /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(LIBMOD) $(LIBDIR) - libpsb_opt.a: $(OBJS) ar cur libpsb_opt.a $(OBJS) diff --git a/prec/Makefile b/prec/Makefile index fd35d982..72a7c3c3 100644 --- a/prec/Makefile +++ b/prec/Makefile @@ -27,11 +27,19 @@ COBJS= FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). OBJS=$(F90OBJS) $(COBJS) $(MPFOBJS) $(MODOBJS) -lib: $(OBJS) +lib: $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(LIBMOD) + +$(HERE)/$(LIBNAME): $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) - /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(LIBMOD) $(LOCAL_MODS) $(LIBDIR) + +$(LIBDIR)/$(LIBNAME): $(HERE)/$(LIBNAME) + /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) + +$(LIBDIR)/$(LIBMOD): + /bin/cp -p $(CPUPDFLAG) $(LIBMOD) $(LOCAL_MODS) $(LIBDIR) + + $(OBJS): $(LIBDIR)/psb_base_mod$(.mod) diff --git a/test/serial/Makefile b/test/serial/Makefile index af34b563..964b3726 100644 --- a/test/serial/Makefile +++ b/test/serial/Makefile @@ -22,14 +22,17 @@ RSB_EXTRA=-lgomp all: d_coo_matgen d_matgen d_coo_matgen: d_coo_matgen.o $(F90LINK) $(LINKOPT) d_coo_matgen.o -o d_coo_matgen $(PSBLAS_LIB) $(LDLIBS) - /bin/mv d_coo_matgen $(EXEDIR) + /bin/cp -p $(CPUPDFLAG) d_coo_matgen $(EXEDIR) + #/bin/mv d_coo_matgen $(EXEDIR) + psb_d_cxx_impl.o d_matgen.o: psb_d_cxx_mat_mod.o psb_d_cyy_impl.o d_matgen.o: psb_d_cyy_mat_mod.o d_matgen.o: psb_d_czz_mat_mod.o d_matgen: d_matgen.o psb_d_cxx_mat_mod.o psb_d_cxx_impl.o psb_d_cyy_mat_mod.o psb_d_cyy_impl.o psb_d_czz_mat_mod.o $(F90LINK) $(LINKOPT) d_matgen.o psb_d_cxx_mat_mod.o psb_d_cxx_impl.o psb_d_cyy_mat_mod.o\ psb_d_cyy_impl.o psb_d_czz_mat_mod.o -o d_matgen $(PSBLAS_LIB) $(LDLIBS) $(RSB_EXTRA) - /bin/mv d_matgen $(EXEDIR) + /bin/cp -p $(CPUPDFLAG) d_matgen $(EXEDIR) +# /bin/mv d_matgen $(EXEDIR) check: all cd runs && echo 5 | ./d_matgen diff --git a/util/Makefile b/util/Makefile index 1d3227f5..de4f9a15 100644 --- a/util/Makefile +++ b/util/Makefile @@ -16,11 +16,17 @@ LIBNAME=$(UTILLIBNAME) FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). -lib: $(OBJS) +lib: $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(LIBMOD) + +$(LIBDIR)/$(LIBNAME): $(HERE)/$(LIBNAME) + /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) + +$(LIBDIR)/$(LIBMOD): + /bin/cp -p $(CPUPDFLAG) $(LIBMOD) $(LOCAL_MODS) $(LIBDIR) + +$(HERE)/$(LIBNAME): $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) - /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(LIBMOD) $(LOCAL_MODS) $(LIBDIR) psb_util_mod.o: $(BASEOBJS)