At present, it is required that a C or C++ "main" function be used, rather than a Fortran "program" statement. Consistent with this is the fact that the standard Makefile only supports linking using a supported C or C++ compiler. This is controlled with two families of macros. The first family controls tasks which are linked with C:
Note that there are no macros associated with C++ in this group. This is because if C++ code is mixed with C, it is required that the task be linked with a supported C++ compiler. Tasks linked with the C++ compiler are controlled with a second family of macros:
For C and Fortran source files, it is a very widespread convention to use .c and .f as the suffix, respectively. For C++ a number of different conventions are in use, which is why there are a number of macros whose names are distinguished by the suffix of the source files each macro includes.
If the HD_CTASK macro is defined, the HD_CTASK_SRC_c macro must contain at least one source file. If the HD_CXXTASK macro is defined, at least one of the HD_CXXTASK_SRC* macros which contain C or C++ source files must contain at least one source file.
When one or both of these macro families are properly defined, the standard Makefile will build the task(s) as part of the default target. First, all the source files in all the macros will be compiled, using the flags specified in the relevant HD_*FLAGS macro. Then the resulting object files will be linked to the libraries specified in the relevant HD_*LIBS macro.