help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Forcing Serial execution of specific Make targets


From: Yair Lenga
Subject: Forcing Serial execution of specific Make targets
Date: Thu, 05 Jul 2001 12:29:50 -0400

Hi,

We are trying to convert existing (and large) 'makefiles' to take advantage of 
new hardware with multiple CPUs. From the manual and man pages, I found our 
that we can activate parallel execution using the '-J' option, and disable it 
with '.NOTPARALLEL'. I was hoping that there are some suggestion on how to 
enable (or disable) the parallel build for specific targets.

For example, we have targets like:

release: pre-compile compile install     # Must be executed serially

and

OBJECTS = file1.o file2.o file3.o

program: $(OBJECTS)                            # can be parallelized
    $(CC) -o program $(OBJECTS)

One possibility is to modify the 'release' target is to expand the dependency 
(as below). I was hoping that there are easier solutions that will reduce the 
amount of rewrites for exisitng makefiles. A good solution will make it 
possible to mark specific targets as "parallel", i.e.:

.NOTPARALLEL: %
.PARALLEL: program

Expanded solution:
release: install

install: compile
    <do install>

compile: pre-compile
    <Do compilation>

Thanks
Yair Lenga





reply via email to

[Prev in Thread] Current Thread [Next in Thread]