GNU Astronomy Utilities



11.2 Makefile functions of Gnuastro

All Gnuastro Make functions start with the ast- prefix (similar to the programs on the command-line, but with a dash). After you have loaded Gnuastro’s shared library for Makefiles within your Makefile, you can call these functions just like any Make function. For instructions on how to load Gnuastro’s Make functions, see Loading the Gnuastro Make functions.

There are two types of Make functions in Gnuastro’s Make extensions: 1) Basic operations on text which is more general than astronomy or Gnuastro, see Text functions for Makefiles). 2) Operations that are directly related to astronomy (mostly FITS files) and Gnuastro, see Astronomy functions for Makefiles).

Difference between ‘=’ or ‘:=’ for variable definition When you define a variable with ‘=’, its value is expanded only when used, not when defined. However, when you use ‘:=’, it is immediately expanded when defined. Therefore the location of a ‘:=’ variable in the Makefile matters: if used before its definition, it will be empty! Those defined by ‘=’ can be used even before they are defined! On the other hand, if your variable invokes functions (like foreach or wildcard), it is better to use ‘:=’. Otherwise, each time the value is used, the function will be expanded (possibly may times) and this will reduce the speed of your pipeline. For more, see the The two flavors of variables in the GNU Make manual.