message: The common lib gets built for the meshing miniapps.
diff: @@ -31,22 +31,30 @@ else
  MINIAPPS = $(PAR_MINIAPPS) $(SEQ_MINIAPPS)
  endif
  -MFEM_LIBS += -L$(MFEM_DIR)/miniapps/common -lmfem-common -Wl,-rpath,$(abspath\
  - $(MFEM_DIR)/miniapps/common)
  +COMMON_LIB = -L$(MFEM_BUILD_DIR)/miniapps/common -lmfem-common
  +
  +# If MFEM_SHARED is set, add the ../common rpath
  +COMMON_LIB += $(if $(MFEM_SHARED:YES=),,\
  + $(if $(MFEM_USE_CUDA:YES=),$(CXX_XLINKER),$(CUDA_XLINKER))-rpath,$(abspath\
  + $(MFEM_BUILD_DIR)/miniapps/common))
  .SUFFIXES:
  .SUFFIXES: .o .cpp .mk
  -.PHONY: all clean clean-build clean-exec
  +.PHONY: all lib-common clean clean-build clean-exec
  # Remove built-in rule
  %: %.cpp
  # Replace the default implicit rule for *.cpp files
  -%: $(SRC)%.cpp $(MFEM_LIB_FILE) $(CONFIG_MK)
  - $(MFEM_CXX) $(MFEM_FLAGS) $< -o $@ $(MFEM_LIBS)
  +%: $(SRC)%.cpp $(MFEM_LIB_FILE) $(CONFIG_MK) | lib-common
  + $(MFEM_CXX) $(MFEM_FLAGS) $< -o $@ $(COMMON_LIB) $(MFEM_LIBS)
  all: $(MINIAPPS)
  +# Rule for building lib-common
  +lib-common:
  + $(MAKE) -C $(MFEM_BUILD_DIR)/miniapps/common
  +
  # Rules to copy the *.mesh files - needed for running the sample runs when
  # building out-of-source:
  ifneq ($(SRC),)
  