Stand With Ukraine

Sunday, February 10, 2013

make is a very useful tool

I try to use Makefile in my small C or Fortran projects (for java projects I like to use maven with its pom.xml). And the more I get to know it the more I like it. This post shows an example of a Makefile created for a small project that I am trying to maintain and improve. The example demonstrates how to use if, how to compile sources from different directories and gather obtained object files to a common directory, how to avoid caveats using the wildcard function, how to get file name using notdir function. Of course all of this can be found using Google search, StackOverflow and GNU manual, those are my actual sources while creating this make file. Enjoy, and, please, comment if you see ways of improvement.