By default, Automake generates `Makefiles' that work depth-first in postfix order: the subdirectories are built before the current directory. However, it is possible to change this ordering. You can do this by putting `.' into `SUBDIRS'. For instance, putting `.' first will cause a prefix ordering of directories.
SUBDIRS = lib src . test
will cause `lib/' to be built before `src/', then the current directory will be built, finally the `test/' directory will be built. It is customary to arrange test directories to be built after everything else since they are meant to test what has been constructed. http://www.gnu.org/software/automake/manual/html_node/Top-level.html