See also: makedepend -Y *.c gcc -M file.c Since gcc -M lists math.h I might be able to use it to automatically add -lm ? e.g.: gcc -M matrixmath.c|&fgrep -q /usr/include/math.h && echo \-lm (from xutils-dev: xutils-dev provides a set of utility programs shipped with the X Window System that do not require the X libraries; many of these programs are useful even on a system that does not have any X clients or X servers installed. The programs in this package include: - imake, a C preprocessor interface to the make utility; - lndir, a tool that creates a shadow directory of symbolic links to another directory tree; - makedepend, a tool to create dependencies in makefiles; - makeg, a tool for making debuggable executables. ) formatting programs (like cb, indent, clang-format) in /home/gtoal/src/compilers101/* astyle crokus indent cb c-format