bug-make
[Top][All Lists]
Advanced

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

make -j2 does the same thing twice


From: Peter Kutschera
Subject: make -j2 does the same thing twice
Date: Thu, 11 Apr 2002 09:58:18 +0200

Good Morning!

I am writing because I have a problem with make.
The problem is if there exists rules generating some "object"-files from 
one "source"-file with rules like:

my_clnt.c my_xdr.c my.h my_svc.c : my.x
          rpcgen my.x

When using make -j rpcgen is executed IM PARALELL several times.

This was a minor problem some years ago but is really annoying with java where
it is normal to get more .class from one .java!

I really would be happy to use -j2 since there are 2 CPUs in my workstation
and there are about 400 java-files and 1200 class-files (yes, this number 
is 3 times higher!) in my current project!

Are there any workarounds / undocumented options / ... ?

Thanks
 Peter Kutschera
 http://peter.kutschera.at
 mailto:address@hidden

P.S.: Well, the docu says to include some info in this mail....


---------------------8<------------------


9:50 pinguin2% uname -a                                             ~/test/make
Linux pinguin2 2.4.7 #4 SMP Tue Jul 24 16:52:08 CEST 2001 i686 unknown

9:50 pinguin2% make -v                                              ~/test/make
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for i686-pc-linux-gnu
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <address@hidden>.


-------------------8<----------------------

############################################################
# /home/peter/test/make/GNUMakefile
# Peter Kutschera, Wed Apr 10 17:04:53 2002
# Time-stamp: "2002-04-11 09:04:56 peter"
# $Id$
# address@hidden  (Forschungszentrum Seibersdorf)
# address@hidden (privat)
# 짤 Peter Kutschera
#############################################################


test:
        rm -f A B C D
        touch C
        @echo '***  OK: A and B are build once  ***'
        $(MAKE) D
        rm A B C D
        touch C
        @echo '***  WRONG: A and B are build twice !!  ***'
        $(MAKE) -j2 D
        rm A B C D


A B : C
        @echo building A and B
        cp C A
        cp C B

D: A B
        cat $^ > $@



----------------------8<---------------------
And the result when running the Makefile

9:50 pinguin2% make                                                 ~/test/make
rm -f A B C D
touch C
***  OK: A and B are build once  ***
make D
make[1]: Entering directory `/home/peter/test/make'
building A and B
cp C A
cp C B
cat A B > D
make[1]: Leaving directory `/home/peter/test/make'
rm A B C D
touch C
***  WRONG: A and B are build twice !!  ***
make -j2 D
make[1]: Entering directory `/home/peter/test/make'
building A and B
cp C A
cp C B
building A and B
cp C A
cp C B
cat A B > D
make[1]: Leaving directory `/home/peter/test/make'
rm A B C D
9:51 pinguin2%

:-(
 Peter



reply via email to

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