[Top][All Lists]

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

Problem using parallel build

From: Johan Borkhuis
Subject: Problem using parallel build
Date: Wed, 17 Nov 2010 15:31:25 +0100 (CET)
User-agent: SquirrelMail/1.4.8-4.fc5


I am trying to create a project containing 3 directories. These
directories generate one archive and two applications. The archive should
be built when using make all, make static or when the archive does not
exist; the other should be built when using make all or make directory.

I use the following makefile:

all: static lib test

exe: $(TARGET_LIB)
        $(MAKE) -C $(TARGET_EXE_DIR)


test: $(TARGET_LIB)
        $(MAKE) -C $(TARGET_TEST_DIR)

This works for a non-parallel build. When using -j2 and
$(TARGET_STATIC_LIB) does not exist the static / $(TARGET_STATIC_LIB) rule
is executed twice.
When the $(TARGET_STATIC_LIB) exists and I try to build the exe or test
only this rule is executed (which is correct).

When I change the dependency of the exe and test rule to static the
archive is only build once, but now the static rule is also executed each
time I want to build exe or test (which I want to avoid, as this is an
long build).

Is it possible to create a Makefile that can do this?

Kind regards,
    Johan Borkhuis

reply via email to

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