[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how to avoid unnecessary recompile when using configure script
From: |
Andrew Wu |
Subject: |
how to avoid unnecessary recompile when using configure script |
Date: |
Thu, 12 Aug 2004 18:45:39 -0700 (PDT) |
I'm looking for help to make my build/make process smarter to
avoid unnecessary recompilation.
I'm using the following example to illustrate/describe my problem.
Say I have a source tree that has 3 directories: dir_1, dir_2, dir_3.
At the top of the source tree I have a Makefile.
Root/Makefile
/dir_1/file_1.c
/dir_2/file_2.c
/dir_3/file_3.c
The top level Makefile consists of the following:
All:
cd dir_1; automake; autoheader; autoconf; ./configure; cd obj_dir_1; make
cd dir_2; automake; autoheader; autoconf; ./configure; cd obj_dir_2; make
cd dir_3; automake; autoheader; autoconf; ./configure; cd obj_dir_3; make
After I have my source tree in place first time, then I do a ¡®make¡¯
from Unix shell. Everything works as I expected. I got the first build
from the scratch.
After I make code changes only to dir_1/file_1.c, I need to make
a new build. Now if I simply run 'make' from under the root,
everything will be recompiled, including the file_2.c, and file_3.c
which have not been modified at all. The file_2.c is recompiled
because the Makefile under dir_2/ is newly re-generated
due to the ./configure is run. The same reason for the recompilation
of the dir_3/file_3.c.
Obviously, file_2.c and file3_.c do not need
to be recompiled at all, for nothing has changed to
them nor their build/make environment.
Could someone please send me some pointers regarding
how to make the changes (in the Makefile or the
configure script) to avoid the unnecessary re-compilation?
I still want to simply run ¡®make¡¯ from the top level of the
source tree though.
Thanks,
-andrew
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
- how to avoid unnecessary recompile when using configure script,
Andrew Wu <=