12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- ######################################################################
- #
- # Based on the Makefile template from libMesh
- LIBMESH_DIR ?= /etc/libmesh
- # include the library options determined by configure
- include Make.common
- target := getpot_parse-$(METHOD)
- ###############################################################################
- # File management. This is where the source, header, and object files are
- # defined
- #
- # source files
- srcfiles := $(wildcard src/*.cpp)
- #
- # object files
- objects := $(patsubst src/%.cpp, build/%.$(obj-suffix), $(srcfiles))
- target_dir := bin
- inputs_dir := data
- REL_TARGET := $(target_dir)/$(target)
- BIN_RUN := OMPI_MCA_opal_warn_on_missing_libcuda=0 $(abspath $(REL_TARGET))
- BIN_OPTS := -igtp $(abspath $(getpot_fname)) $(output_mesh_fname)
- ###############################################################################
- .PHONY: clean_outputs clean_compile clean
- ###############################################################################
- # Target:
- #
- all:: $(notdir $(target))
- # Production rules: how to make the target - depends on library configuration
- $(REL_TARGET): $(objects)
- @echo "Linking "$@"..."
- @$(libmesh_LIBTOOL) \
- --tag=CXX $(LIBTOOLFLAGS) \
- --mode=link \
- $(libmesh_CXX) $(libmesh_CXXFLAGS) $(objects) \
- -o $@ \
- $(libmesh_LIBS) $(libmesh_LDFLAGS) $(EXTERNAL_FLAGS)
- # Useful rules.
- clean_outputs:
- @echo "Deleting old output and runtime files"
- @rm -f out*.m job_output.txt \
- output.txt* *.gmv.* *.plt.* out*.xdr* \
- out*.xda* PI* complete
- clean_compile:
- @echo "Deleting compiled libraries and objects"
- @rm -fr $(objects) build/*.o *.$(obj-suffix) *.lo .libs
- clean: clean_compile clean_outputs
- @echo "Deleting $(REL_TARGET)"
- @rm -f $(REL_TARGET) py2libmesh.tar.gz
- echo:
- @echo srcfiles = $(srcfiles)
- @echo objects = $(objects)
- @echo target = $(REL_TARGET)
- .PHONY: backup
- backup:
- tar czf py2libmesh.tar.gz $(wildcard data/*.msh) $(wildcard data/*.gtpt) $(wildcard include/*.h) $(srcfiles) Makefile Make.common
- run complete: $(wildcard *.in)
- @$(MAKE) $(REL_TARGET)
- @echo "***************************************************************"
- @echo "* Running App " $(notdir $(target))
- @echo "***************************************************************"
- @echo " "
- ifndef getpot_fname
- @echo "This Makefile only runs with an input filename (GetPot)"
- @echo "example: make run getpot_fname=data/inputs.gtpt"
- endif
- ifdef getpot_fname
- cd $(abspath $(inputs_dir)); \
- ${BIN_RUN} $(BIN_OPTS) 2>&1 | \
- tee output.txt && bzip2 -f output.txt
- endif
- @echo " "
- @echo "***************************************************************"
- @echo "* Done Running App " $(notdir $(target))
- @echo "***************************************************************"
- ###############################################################################
|