Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 57 lines (43 sloc) 1.925 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
# The location of the mesh library
LIBMESH_DIR ?= ..

# Include the library options determined by configure. This gives
# us access to the $(METHOD) variable for building the examples.
include $(LIBMESH_DIR)/Make.common

makefilelist := $(wildcard */*ex?/Makefile */*ex??/Makefile)
dirlist := $(patsubst %/Makefile, %/, $(makefilelist))
exec_names := $(patsubst %/, %-$(METHOD), $(dirlist))

.PHONY: all clean clobber distclean examples link run .depend

# This "examples" target allows the examples to be compiled in parallel...
examples: $(exec_names)

# This "examples" target is not parallelizable by make...
# examples: all

all:
@for dir in $(dirlist); do $(MAKE) -C "$${dir}" $(MAKECMDGOALS)||exit 1; done

#
# Clean up the example programs
clean:
@for dir in $(dirlist); do $(MAKE) -C "$${dir}" $(MAKECMDGOALS)||exit 1; done

#
# Really clean up the example programs
clobber:
@for dir in $(dirlist); do $(MAKE) -C "$${dir}" $(MAKECMDGOALS)||exit 1; done

# Make the example program directories look
# like a clean distribution
distclean:
@for dir in $(dirlist); do $(MAKE) -C "$${dir}" $(MAKECMDGOALS)||exit 1; done

# Run the example programs to see if shared lib's get properly loaded.
# This target should actually be "serialized" in the sense of 'make', we don't
# want all the examples to try and run simultaneously!
run: $(wildcard examples/ex*/*.C)
@for dir in $(dirlist); do $(MAKE) -C "$${dir}" $(MAKECMDGOALS)||exit 1; done

#
# Rebuild the dependencies for the examples
.depend: $(wildcard examples/ex*/*.C)
@for dir in $(dirlist); do $(MAKE) -C "$${dir}" $(MAKECMDGOALS)||exit 1; done

echo:
# @echo "dirlist = $(dirlist)"
@echo "exec_names = $(exec_names)"

# Generic target for making an example executable. The "%" sign here is e.g.
# reduced_basis/reduced_basis_ex2. The patsubst call elides the $(METHOD) flag.
%-$(METHOD):
$(MAKE) -C $(patsubst %-$(METHOD), %, $@) $(MAKECMDGOALS)||exit 1
Something went wrong with that request. Please try again.