From b56abbb2707a3465580714f40218697f7ed0dd1c Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sat, 18 Apr 2020 17:58:41 +0200 Subject: [PATCH] Improve structure of Makefiles --- Makefile | 20 ++++++++++---------- base/Makefile | 24 ++++++++++++------------ base/comm/Makefile | 2 +- base/serial/Makefile | 8 ++++---- prec/Makefile | 2 +- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 829d4fc1..41caa3cd 100644 --- a/Makefile +++ b/Makefile @@ -15,15 +15,15 @@ libd: (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: - cd base && $(MAKE) lib + $(MAKE) -C base lib precd: - cd prec && $(MAKE) lib + $(MAKE) -C prec lib kryld: - cd krylov && $(MAKE) lib + $(MAKE) -C krylov lib utild: - cd util&& $(MAKE) lib + $(MAKE) -C util lib cbindd: - cd cbind&& $(MAKE) lib + $(MAKE) -C cbind lib install: all mkdir -p $(INSTALL_INCLUDEDIR) &&\ @@ -42,11 +42,11 @@ install: all /bin/cp -fr test/pargen test/fileread test/kernel $(INSTALL_SAMPLESDIR) && \ mkdir -p $(INSTALL_SAMPLESDIR)/cbind && /bin/cp -fr cbind/test/pargen/* $(INSTALL_SAMPLESDIR)/cbind clean: - cd base && $(MAKE) clean - cd prec && $(MAKE) clean - cd krylov && $(MAKE) clean - cd util && $(MAKE) clean - cd cbind && $(MAKE) clean + $(MAKE) -C base clean + $(MAKE) -C prec clean + $(MAKE) -C krylov clean + $(MAKE) -C util clean + $(MAKE) -C cbind clean check: all make check -C test/serial diff --git a/base/Makefile b/base/Makefile index 3304176c..039a5963 100644 --- a/base/Makefile +++ b/base/Makefile @@ -13,25 +13,25 @@ lib: mods sr cm in pb tl sr cm in pb tl: mods mods: - cd modules && $(MAKE) lib LIBNAME=$(BASELIBNAME) F90="$(MPF90)" F90COPT="$(F90COPT) $(MPI_OPT)" + $(MAKE) -C modules lib LIBNAME=$(BASELIBNAME) F90="$(MPF90)" F90COPT="$(F90COPT) $(MPI_OPT)" sr: - cd serial && $(MAKE) lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C serial lib LIBNAME=$(BASELIBNAME) cm: - cd comm && $(MAKE) lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C comm lib LIBNAME=$(BASELIBNAME) in: - cd internals && $(MAKE) lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C internals lib LIBNAME=$(BASELIBNAME) pb: - cd psblas && $(MAKE) lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C psblas lib LIBNAME=$(BASELIBNAME) tl: - cd tools && $(MAKE) lib LIBNAME=$(BASELIBNAME) + $(MAKE) -C tools lib LIBNAME=$(BASELIBNAME) clean: - (cd modules; $(MAKE) clean) - (cd comm; $(MAKE) clean) - (cd internals; $(MAKE) clean) - (cd tools; $(MAKE) clean) - (cd serial; $(MAKE) clean) - (cd psblas; $(MAKE) clean) + ($(MAKE) -C modules clean) + ($(MAKE) -C comm clean) + ($(MAKE) -C internals clean) + ($(MAKE) -C tools clean) + ($(MAKE) -C serial clean) + ($(MAKE) -C psblas clean) veryclean: clean /bin/rm -f $(HERE)/$(LIBNAME) $(LIBMOD) *$(.mod) diff --git a/base/comm/Makefile b/base/comm/Makefile index f27d38cf..950a95a0 100644 --- a/base/comm/Makefile +++ b/base/comm/Makefile @@ -32,7 +32,7 @@ lib: interns mpfobjs $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) interns: - cd internals && $(MAKE) lib + $(MAKE) -C internals lib mpfobjs: $(MAKE) $(MPFOBJS) FC="$(MPFC)" diff --git a/base/serial/Makefile b/base/serial/Makefile index 1ce9156b..5bff0b64 100644 --- a/base/serial/Makefile +++ b/base/serial/Makefile @@ -29,12 +29,12 @@ lib: impld sortd lib1 $(FOBJS) lib1: $(FOBJS) impld: - cd impl && $(MAKE) lib + $(MAKE) -C impl lib sortd: - cd sort && $(MAKE) lib + $(MAKE) -C sort lib clean: /bin/rm -f $(FOBJS) *$(.mod) - (cd impl; $(MAKE) clean) - (cd sort; $(MAKE) clean) + ($(MAKE) -C impl clean) + ($(MAKE) -C sort clean) veryclean: clean diff --git a/prec/Makefile b/prec/Makefile index 0b9079c5..5b9551f2 100644 --- a/prec/Makefile +++ b/prec/Makefile @@ -27,7 +27,7 @@ lib: $(OBJS) impld /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) impld: $(OBJS) - cd impl && $(MAKE) + $(MAKE) -C impl $(OBJS): $(MODDIR)/$(BASEMODNAME)$(.mod)