-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
Description
Commit a01bf6b removed the core MMSP includes as dependencies from the example Makefiles. This was erroneous in most cases: as a result of this commit, running make will not rebuild the binaries when the MMSP includes change, only when the example code changes. Proper usage defines a core variable containing the external files necessary to build an up-to-date binary, and including those files on the dependency line.
To clarify, using one of the anisotropic vector-valued grain growth codes as an example:
Current Makefile
graingrowth: graingrowth.cpp
$(compiler) $(flags) $< -o $@ -lzFormer Makefile
core = $(incdir)/MMSP.hpp \
$(incdir)/MMSP.main.hpp \
$(incdir)/MMSP.utility.hpp \
$(incdir)/MMSP.grid.hpp \
$(incdir)/MMSP.vector.hpp
graingrowth: graingrowth.cpp anisotropy.hpp
$(compiler) $(flags) $< -I$(core) -o $@ -lzCorrect Makefile
core = $(incdir)/MMSP.hpp \
$(incdir)/MMSP.main.hpp \
$(incdir)/MMSP.utility.h \
$(incdir)/MMSP.utility.cpp \
$(incdir)/MMSP.grid.h \
$(incdir)/MMSP.grid.cpp \
$(incdir)/MMSP.vector.h \
$(incdir)/MMSP.vector.cpp
graingrowth: graingrowth.cpp graingrowth.hpp anisotropy.hpp $(core)
$(compiler) $(flags) $< -o $@ -lzProtip: $< denotes the first prerequisite, which in this example is graingrowth.cpp, not the whole slew of dependencies. The first item is critical, but order makes no difference for the remainder.
Reactions are currently unavailable