help-make
[Top][All Lists]
Advanced

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

How to have one command make several intermediate files?


From: Lindner, Mike
Subject: How to have one command make several intermediate files?
Date: Wed, 8 Aug 2001 16:26:48 -0400

I have a program that generates several source code files, that are
subsequently compiled. If I run "make" all works well, and the code
generator is run once. If, however, I run "make -jX", the code generator
runs "X" times. By way of example, consider the following Makefile:

        INTS = b c

        a: $(INTS)
                cat $(INTS) > a

        $(INTS):
                echo b > b
                echo c > c

        clean:
                rm -f $(INTS)

        clobber: clean
                rm -f a

make runs:

        echo b > b
        echo c > c
        cat b c > a

but make -j2 runs:

        echo b > b
        echo b > b
        echo c > c
        echo c > c
        cat b c > a

Is there any way to tell GNU make that the commands make all the targets? I
don't want to use .NOTPARALLEL because the subsequent compiles CAN be run in
parallel, it is only the code generation phase that has the problem. I
thought of making a "contrived" dependency of all of the generated files on
one file, but that solution doesn't seem clean or correct.

Thanks in advance,
---
Mike Lindner 



reply via email to

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