title: Execute a Makefile in parallel except for some rules
body: <p>I have a complex makefile with a lot of recipes. I would like run them with no parallel execution except for the generation of my objects files. I noticed that the .NOTPARALLEL target cannot take any prerequisites otherwise it would have been much easier to solve my issue. </p>
  
  <p>My first guess was to use a nonexistent target named ".PARALLEL" with which I would have mentioned the objects files as dependancies like this: </p>
  
  <pre><code>SRC=$(wildcard *.c)
  OBJ=$(SRC:.c=.o)           
  
  .PARALLEL: $(OBJ)
  
  %.o: %.c
      gcc –c –o$@ $&lt; -M
  
  a.out: $(OBJ)
      gcc –o$@ $^
  </code></pre>
  
  <p>A more functional solution I have found is to use an intermediate target. However, since MyObjects has no dependancies, make will always call MyObjects and recreate a.out. </p>
  
  <pre><code>%.o: %.c
      $(CC) –c –o$@ $&lt; -M
  
  MyObjects: 
      $(MAKE) -j $(OBJ)
  
  a.out: MyObjects
      $(CC) –o$@ $(OBJ)
  </code></pre>
  
  <p>To avoid this I've found nothing better than using dummy files. I wrote this example to illustrate it: </p>
  
  <pre><code>NAMES = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
  
  SRC = $(addsuffix .c, $(NAMES))
  OBJ = $(patsubst %.c,%.o,$(SRC))
  DUM = $(addsuffix .dummy,$(OBJ))
  
  all: a.out
  
  $(SRC):%.c: 
      touch $@
  
  $(OBJ):%.o: %.c
      cp $&lt; $@
      touch $(addsuffix .dummy, $@)
  
  $(DUM):
      $(MAKE) -j8 $(OBJ)
  
  a.out: $(DUM) $(OBJ)
      zip $@ $(OBJ)    
  
  clean: 
      -rm *.o
      -rm *.out
      -rm *.c 
      -rm *.dummy 
  </code></pre>
  
  <p>I'm sure this is not the best solution I can get. I would be glad to get some help. </p>
  
  <p>P.S. MadScientist, thank you for your advices. </p>