Fix Makefiles for parallel builds

fixmatch
Salvatore Filippone 3 years ago
parent e46f22a37c
commit c7edaaa7c5

@ -1,10 +1,13 @@
include Make.inc include Make.inc
all: library all: objs lib
library: libdir amgp cbnd objs: amgp cbnd
#cbnd
lib: libdir objs
cd amgprec && $(MAKE) lib
cd cbind && $(MAKE) lib
libdir: libdir:
(if test ! -d lib ; then mkdir lib; fi) (if test ! -d lib ; then mkdir lib; fi)
@ -14,9 +17,9 @@ libdir:
amgp: amgp:
$(MAKE) -C amgprec all cd amgprec && $(MAKE) objs
cbnd: amgp cbnd: amgp
$(MAKE) -C cbind all cd cbind && $(MAKE) objs
install: all install: all
mkdir -p $(INSTALL_LIBDIR) &&\ mkdir -p $(INSTALL_LIBDIR) &&\
$(INSTALL_DATA) lib/*.a $(INSTALL_LIBDIR) $(INSTALL_DATA) lib/*.a $(INSTALL_LIBDIR)
@ -41,14 +44,14 @@ cleanlib:
(cd modules; /bin/rm -f *.a *$(.mod) *$(.fh)) (cd modules; /bin/rm -f *.a *$(.mod) *$(.fh))
veryclean: cleanlib veryclean: cleanlib
(cd amgprec; make veryclean) (cd amgprec && $(MAKE) veryclean)
(cd samples/simple/fileread; make clean) (cd samples/simple/fileread && $(MAKE) clean)
(cd samples/simple/pdegen; make clean) (cd samples/simple/pdegen && $(MAKE) clean)
(cd samples/advanced/fileread; make clean) (cd samples/advanced/fileread && $(MAKE) clean)
(cd samples/advanced/pdegen; make clean) (cd samples/advanced/pdegen && $(MAKE) clean)
check: all check: all
make check -C samples/advanced/pdegen make check -C samples/advanced/pdegen
clean: clean:
(cd amgprec; make clean) (cd amgprec && $(MAKE) clean)

@ -62,12 +62,15 @@ OBJS=$(MODOBJS)
LOCAL_MODS=$(MODOBJS:.o=$(.mod)) LOCAL_MODS=$(MODOBJS:.o=$(.mod))
LIBNAME=libamg_prec.a LIBNAME=libamg_prec.a
all: lib impld all: objs impld
impld: $(OBJS) objs: $(OBJS)
$(MAKE) -C impl
impld: objs
cd impl && $(MAKE)
lib: $(OBJS) impld lib: $(OBJS) impld
cd impl && $(MAKE) lib
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
/bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR)
@ -218,4 +221,4 @@ clean: implclean
/bin/rm -f $(OBJS) $(LOCAL_MODS) *$(.mod) /bin/rm -f $(OBJS) $(LOCAL_MODS) *$(.mod)
implclean: implclean:
$(MAKE) -C impl clean cd impl && $(MAKE) clean

@ -67,22 +67,25 @@ OBJS=$(F90OBJS) $(COBJS) $(MPCOBJS)
LIBNAME=libamg_prec.a LIBNAME=libamg_prec.a
objs: $(OBJS) aggrd levd smoothd solvd
lib: $(OBJS) aggrd levd smoothd solvd lib: $(OBJS) aggrd levd smoothd solvd
cd aggregator && $(MAKE) lib
cd level && $(MAKE) lib
cd smoother && $(MAKE) lib
cd solver && $(MAKE) lib
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
aggrd: aggrd:
$(MAKE) -C aggregator cd aggregator && $(MAKE) objs
levd: levd:
$(MAKE) -C level cd level && $(MAKE) objs
smoothd: smoothd:
$(MAKE) -C smoother cd smoother && $(MAKE) objs
solvd: solvd:
$(MAKE) -C solver cd solver && $(MAKE) objs
mpobjs:
(make $(MPFOBJS) FC="$(MPFC)" FCOPT="$(FCOPT)")
(make $(MPCOBJS) CC="$(MPCC)" CCOPT="$(CCOPT)")
veryclean: clean veryclean: clean
/bin/rm -f $(LIBNAME) /bin/rm -f $(LIBNAME)
@ -91,10 +94,10 @@ clean: solvclean smoothclean levclean aggrclean
/bin/rm -f $(OBJS) $(LOCAL_MODS) /bin/rm -f $(OBJS) $(LOCAL_MODS)
aggrclean: aggrclean:
$(MAKE) -C aggregator clean cd aggregator && $(MAKE) clean
levclean: levclean:
$(MAKE) -C level clean cd level && $(MAKE) clean
smoothclean: smoothclean:
$(MAKE) -C smoother clean cd smoother && $(MAKE) clean
solvclean: solvclean:
$(MAKE) -C solver clean cd solver && $(MAKE) clean

@ -68,7 +68,9 @@ OBJS = $(FOBJS) $(MPCOBJS)
LIBNAME=libamg_prec.a LIBNAME=libamg_prec.a
lib: $(OBJS) objs: $(OBJS)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)

@ -72,14 +72,11 @@ amg_z_base_onelev_map_prol.o
LIBNAME=libamg_prec.a LIBNAME=libamg_prec.a
lib: $(OBJS) objs: $(OBJS)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
mpobjs:
(make $(MPFOBJS) FC="$(MPFC)" FCOPT="$(FCOPT)")
(make $(MPCOBJS) CC="$(MPCC)" CCOPT="$(CCOPT)")
veryclean: clean veryclean: clean
/bin/rm -f $(LIBNAME) /bin/rm -f $(LIBNAME)

@ -190,14 +190,12 @@ amg_z_l1_jac_smoother_clone.o \
LIBNAME=libamg_prec.a LIBNAME=libamg_prec.a
lib: $(OBJS) objs: $(OBJS)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
mpobjs:
(make $(MPFOBJS) FC="$(MPFC)" FCOPT="$(FCOPT)")
(make $(MPCOBJS) CC="$(MPCC)" CCOPT="$(CCOPT)")
veryclean: clean veryclean: clean
/bin/rm -f $(LIBNAME) /bin/rm -f $(LIBNAME)

@ -294,14 +294,12 @@ amg_z_krm_solver_impl.o
LIBNAME=libamg_prec.a LIBNAME=libamg_prec.a
lib: $(OBJS) objs: $(OBJS)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
mpobjs:
(make $(MPFOBJS) FC="$(MPFC)" FCOPT="$(FCOPT)")
(make $(MPCOBJS) CC="$(MPCC)" CCOPT="$(CCOPT)")
veryclean: clean veryclean: clean
/bin/rm -f $(LIBNAME) /bin/rm -f $(LIBNAME)

@ -8,19 +8,19 @@ MODDIR=../modules/
LIBNAME=$(CBINDLIBNAME) LIBNAME=$(CBINDLIBNAME)
LIBNAME=libamg_cbind.a LIBNAME=libamg_cbind.a
all: lib objs: amgprecd
lib: amgprecd lib: objs
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
/bin/cp -p $(CPUPDFLAG) *.h $(INCDIR) /bin/cp -p $(CPUPDFLAG) *.h $(INCDIR)
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
amgprecd: amgprecd:
$(MAKE) -C amgprec lib LIBNAME=$(LIBNAME) cd amgprec && $(MAKE) objs LIBNAME=$(LIBNAME)
clean: clean:
$(MAKE) -C amgprec clean cd amgprec &&$(MAKE) clean
veryclean: clean veryclean: clean

@ -18,8 +18,9 @@ LIBMOD=amg_prec_cbind_mod$(.mod) amg_dprec_cbind_mod$(.mod) amg_zprec_cbind_mod$
LOCAL_MODS=$(LIBMOD) LOCAL_MODS=$(LIBMOD)
#LIBNAME=$(CPRECLIBNAME) #LIBNAME=$(CPRECLIBNAME)
objs: $(OBJS)
lib: $(OBJS) $(CMOD) lib: objs $(CMOD)
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
/bin/cp -p $(HERE)/$(LIBNAME) $(DEST) /bin/cp -p $(HERE)/$(LIBNAME) $(DEST)

Loading…
Cancel
Save