Unix Programming - makefile problem should be very simple

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > February 2006 > makefile problem should be very simple





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author makefile problem should be very simple
billy

2006-02-14, 5:54 pm

gmake -v
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for hppa2.0n-hp-hpux11.00
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000

I have:

projects := ldb lde ldg ldm ldf ldw lbf

all : $(projects)

$(projects) :
<commands>

$(substr ldb,,$(projects)) : ldb

I need to set the other 6 to be dependent on ldb finishing. The
example I found shows this to work, but it doesn't

Paul D. Smith

2006-02-14, 5:54 pm

%% "billy" <bp1497@att.com> writes:

b> projects := ldb lde ldg ldm ldf ldw lbf

b> all : $(projects)

b> $(projects) :
b> <commands>

b> $(substr ldb,,$(projects)) : ldb

You should use filter-out here, not substr:

$(filter-out ldb,$(projects)) : ldb

b> I need to set the other 6 to be dependent on ldb finishing. The
b> example I found shows this to work, but it doesn't

Your makefile is correct as written here and will do what you appear to
expect: none of the other targets will start until "ldb" is finished.

If that's not what's happening then there is something else going on
which you have not described here: maybe the makefile you're actually
running is not the same as the one you list here.

--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@gnu.org> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
billy

2006-02-14, 5:54 pm

thanks, worked like a charm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com