1

We have unit tests in our project, and they run very slowly. The main reason for this, as far as I can tell is that each subdir runs serially. There is no reason for this and I'd like to modify things so each subdirectory is processed in parallel.

I found this question but it seems that the accepted answer is for how to specify this in your makefile, and not the makefile.am. I tried just adding the solution to my Makefile.am and it didn't seem to make a difference. Is this the correct way to do it at a Makefile.am level? If so, any advice for what I could be doing wrong? If not, please show me the path of truth :-)

Community
  • 1
  • 1
dbeer
  • 6,963
  • 3
  • 31
  • 47
  • is it possible to call `make -j4` instead of `make` from automake? – anishsane Dec 18 '12 at 08:58
  • 1
    Yes, automake generates a makefile that you use just like any other makefile. I'm asking how to specify that the subdirs can be processed serially, so that when I run make -j12 or whatever that it parallelizes the work on each subdirectory. – dbeer Dec 18 '12 at 17:55

1 Answers1

1

In answer to my question, things from Makefile.am are translated fairly directly to the Makefile, so the changes in the original question can be made in Makefile.am. The only part I'm not 100% confident on is whether or not SUBDIRS (as it has special meaning) can get mangled in the autotools process. At any rate, processing the SUBDIRS in parallel is perhaps not typically the answer.

I solved this was to use a separate target for the directories I wanted processed in parallel, and I bet that this is typically the correct answer. There may well be some way to get the SUBDIRs to be processed this way, but using a separate target was pretty easy to get working for me, and at least for what I was trying to do a separate target was more appropriate.

dbeer
  • 6,963
  • 3
  • 31
  • 47