I fixed the obj/ src/ problem with
g++ -MM src/*.cpp | sed "s/^/obj\//" > Makefile.obj

On 10/6/06, Adam H. Peterson <[EMAIL PROTECTED]> wrote:

Why not make Makefile.obj depend on src/*?

Makefile.obj: src/*
    ...

And with regard to your obj/ src/ issue, perhaps you could use perl as a
filter?
    g++ -MM src/*.cpp | perl -e 'while (<>) {
s/^(.*\:\s*)/src\/\1obj\//; print; }" > Makefile.obj

(Perl probably has an option that will wrap the expression in a
read-print-loop for you, by the way, if you want to go that route.)

Or you might want to look at gcc's -MQ and -MT options.

Note that I haven't actually executed the above lines, so syntax errors
may remain.  But hopefully you get the idea.

By the way, I used to have a really elaborate build system using make
and generated .dep files, but I found it was more brittle than I liked.
Make can get touchy about missing .dep files, even if the next make run
would have removed their dependency.  In the end, I switched to SCons.
It gives me a bit more control, I think.

--------------------
BYU Unix Users Group
http://uug.byu.edu/

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

--------------------
BYU Unix Users Group http://uug.byu.edu/
The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to