I heard peope say make is slow and recursive make is harmful

"ljh" via Users list for the GNU implementation of make <[email protected]>
Newsgroups gmane.comp.gnu.make.general
Message-ID <[email protected]>
I split my project into modules, eg. main, foo.
The main module calls foo which is shared object library.


If I change the foo.c (not the interface foo.h),&nbsp;
only foo.c is compiled and foo is linked.


So, is not what people say a matter of project organization?




$ pwd
/home/ljh/Documents/hello_makefile_OutOfSRC/src
$ ls
foo &nbsp;main &nbsp;Makefile
$


$ tree --charset C
.
|-- foo
| &nbsp; |-- foo.c
| &nbsp; |-- foo.h
| &nbsp; `-- Makefile
|-- main
| &nbsp; |-- main.c
| &nbsp; `-- Makefile
`-- Makefile


$&nbsp;


$ make&nbsp;
make[1]: Entering directory '/home/ljh/Documents/hello_makefile_OutOfSRC/src/foo'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ljh/Documents/hello_makefile_OutOfSRC/src/foo'
make[1]: Entering directory '/home/ljh/Documents/hello_makefile_OutOfSRC/src/main'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ljh/Documents/hello_makefile_OutOfSRC/src/main'
$&nbsp;


$ touch foo/foo.c&nbsp;


$ make&nbsp;
make[1]: Entering directory '/home/ljh/Documents/hello_makefile_OutOfSRC/src/foo'
cc -fPIC &nbsp;-g &nbsp;-MMD -MP &nbsp;-c -o /home/ljh/Documents/hello_makefile_OutOfSRC/src/build/foo/foo.o foo.c
cc -shared &nbsp;-Wl,-rpath,/home/ljh/Documents/hello_makefile_OutOfSRC/src/build/bar -Wl,-rpath,'$ORIGIN/../lib' -Wl,-soname,libfoo.so.1 -fsanitize=address /home/ljh/Documents/hello_makefile_OutOfSRC/src/build/foo/foo.o &nbsp;-o /home/ljh/Documents/hello_makefile_OutOfSRC/src/build/foo/foo
make[1]: Leaving directory '/home/ljh/Documents/hello_makefile_OutOfSRC/src/foo'
make[1]: Entering directory '/home/ljh/Documents/hello_makefile_OutOfSRC/src/main'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ljh/Documents/hello_makefile_OutOfSRC/src/main'
$&nbsp;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.