srcdir = .
HYPRE_DIRS =\ utilities\ struct_matrix_vector\ struct_linear_solvers\ test
all:
@ \
for i in ${HYPRE_DIRS}; \ do \
if [
echo "Making $$i ..."; \ (cd $$i; make); \
echo ""; \ fi; \
done
clean:
@ \
for i in ${HYPRE_DIRS}; \ do \
if [
echo "Cleaning $$i ..."; \ (cd $$i; make clean); \
fi; \ done
veryclean: @ \
for i in ${HYPRE_DIRS}; \ do \
if [
echo
fi; \ done
3.9.1.1 Example Procedure 1Go through the directories serially and have the make procedure within each directory be parallel.
For the purpose of this exercise we are only parallelizing the “make all” component. The “clean” and “veryclean” components can be parallelized in a similar fashion.
Modified makefile:
all:
@ \
for i ${HYPRE_DIRS}; \ do \
if [
echo "Making $$i ..."; \
echo $(PREFIX) $(MAKE) $(MAKE_J)
fi; \ done