help-make
[Top][All Lists]
Advanced

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

RE:Recursive use of Gmake


From: Yanghui Bian
Subject: RE:Recursive use of Gmake
Date: Mon, 10 Feb 2003 18:46:36 +0100

Hello,
Here in the example, make = make subdirs.
If you don't have the subdirs, you cannot explicitly specify the goal for make.

Regards, 
Yanghui Bian

-----Original Message-----
From: address@hidden [mailto:address@hidden
Sent: Friday, February 07, 2003 18:04
To: address@hidden
Subject: Help-make Digest, Vol 3, Issue 6


Send Help-make mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.gnu.org/mailman/listinfo/help-make
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Help-make digest..."


Today's Topics:

   1. Re: missing 'endif' error from eval inside ifeq (gk)
   2. Recursive use of Gmake
   3. make Eval function / factoring out analagous rules & variables
       (Alister Shipman)
   4. eval function (Shipman, Alister)


----------------------------------------------------------------------

Date: Thu, 06 Feb 2003 17:57:10 -0800
From: gk <address@hidden>
To: "Paul D. Smith" <address@hidden>
Cc: address@hidden
Subject: Re: missing 'endif' error from eval inside ifeq
Message-ID: <address@hidden>
In-Reply-To: <address@hidden>
References: <address@hidden>
 <address@hidden>
Content-Type: text/plain; charset="us-ascii"; format=flowed
MIME-Version: 1.0
Precedence: list
Message: 1

At 08:26 PM 2/5/2003 -0500, Paul D. Smith wrote:
>Yes, and it's been reported and fixed in the source.  There's a patch
>attached to the bug report in Savannah.

Thanks. I downloaded the patch (bug 1516) but seem to be having trouble 
applying it since I previously applied a later patch (1517) to the 
make-3.80 sources.

Any pointers to how to apply these patches correctly would be appreciated.

I have tried to reverse the patch by re-applying it but it doesn't seem to 
work.
Maybe I just didn't answer correctly in the following session.

address@hidden make-3.80]# patch -p0<eval-crash.diff
patching file variable.h
Reversed (or previously applied) patch detected!  Assume -R? [n] y
patching file expand.c
Reversed (or previously applied) patch detected!  Assume -R? [n] Y
Apply anyway? [n] Y
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file expand.c.rej
patching file function.c
Reversed (or previously applied) patch detected!  Assume -R? [n] Y
Apply anyway? [n] Y
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file function.c.rej

I tried to download another copy of the sources from your web site but the 
link to ftp://ftp.gnu.org/gnu/make/make-3.80.tar.gz doesn't seem to work.


- Greg Keraunen
http://www.xmake.org
http://www.xmlmake.com



------------------------------

Date: Fri, 7 Feb 2003 09:57:11 +0100
From: address@hidden
To: address@hidden
Subject: Recursive use of Gmake
Message-ID: <address@hidden>
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Precedence: list
Message: 2

Hello all,

I repost this because I have trouble to use something I don't
understand....
Is it easy or a pain to explain ?

Thank you for your help
With regards
Jean-Paul

---------------------- Forwarded by Jean-Paul CLOAREC/FR/ALCATEL on
07/02/2003 09:55 ---------------------------


Jean-Paul CLOAREC/FR/address@hidden@gnu.org on 04/02/2003 10:20:39

Sent by:  address@hidden


To:   address@hidden
cc:
Subject:  Recursive use of Gmake



Hello,

There is something I don't understand regarding recursive make
>From the manual , I got this :
SUBDIRS = foo bar baz

  .PHONY: subdirs $(SUBDIRS)

  subdirs: $(SUBDIRS)

  $(SUBDIRS):
          $(MAKE) -C $@

  foo: baz


What I don't understand is subdirs target
What is the difference with the following :

SUBDIRS = foo bar baz

  .PHONY: $(SUBDIRS)

  $(SUBDIRS):
          $(MAKE) -C $@

  foo: baz

I tried it. It seems to work fine :
% Gmake
( cd baz; Gmake )
Gmake[1]: Entering directory `/vob/cncs_training_ni/FICHE1/baz'
cc -o toto toto.c
Gmake[1]: Leaving directory `/vob/cncs_training_ni/FICHE1/baz'
( cd foo; Gmake )
Gmake[1]: Entering directory `/vob/cncs_training_ni/FICHE1/foo'
cc -o toto toto.c
Gmake[1]: Leaving directory `/vob/cncs_training_ni/FICHE1/foo'

So, what is the purpose of subdirs ?

Thank you for your help
Best regards
jena-paul





_______________________________________________
Help-make mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-make




------------------------------

Date: Thu, 6 Feb 2003 19:56:57 -0800 (PST)
From: Alister Shipman <address@hidden>
To: address@hidden
Subject: make Eval function / factoring out analagous rules & variables
Message-ID: <address@hidden>
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Precedence: list
Message: 3

Hi, 

    I sent this directly to Paul but then realsied
others might answer these enquiries too - so...

I have a single makefile which builds many libraries -
i.e which is organised in part as follows - (in line
with a prior solution provided by Paul)

LIBRARY_LIST = libsl_dbtypes.a libsl_db_types_etc.a

## Db_types
dbtypes_CCSRCS = DataSourceBase.cc DbTypesBase.cc
ObjectName.cc 
dbtypes_CCOBJS = ${dbtypes_CCSRCS:.cc=.o} 
libsl_dbtypes.a : $(dbtypes_CCOBJS) 
VPATH +=
$(WORKAREA)/sl_libdbase,$(LNAME)/sl_libdbase/sl_dbtypes/src

## Db_types_etc
dbtypes_etc_CCSRCS = DataBase.cc DataSource.cc
Station.cc 
dbtypes_etc_CCOBJS = ${dbtypes_etc_CCSRCS:.cc=.o} 
libsl_dbtypes_etc.a : $(dbtypes_etc_CCOBJS)
VPATH +=
$(WORKAREA)/sl_libdbase,$(LNAME)/sl_libdbase/sl_dbtypes_etc/src

$(LIBRARY_LIST):
           $(AR) ARFLAGS $@ $^

- Now considering the analogous nature of the two
pattern matching lines and the two rules lines I would
like to automatically generate these off the library
list - possibly using the eval function ?? ( as per
the example in the gnu documentation). I want the
pattern matching rules because I want to avoid having
to type the .o list and the .cc list. 

- The plot then thickens - for each of these libraries
I wish to be able to supply compiler flags - say:

db_types_CCFLAGS = -g

and have this passed to the compiler. So I really want
to generate more rules, of the form

$(<libraryname>_CCOBJS) : $(<libraryname>_CCSRCS)
        COMPILER_CMND $(<libraryname>_CCFLAGS) -o $@ $^

(I am doing this because I am trying to write all my
rules in a single makefile rather than employing rules
files for each library and employing recursive make)

- So far I try and define these "dynamically"
generated macros by:

define PATTERN_MATCH_MACROS
$(1)_CCOBJS = $${$(1)_CCSRCS:.cc=.o}
endef

$(foreach library, $(LIBRARY_LIST), $(eval $(call
PATTERN_MATCH_MACROS,$(library))))

But when it gets to the rules - even when they are
just typed in (as opposed to generated) i.e 
libsl_dbtypes.a : $(dbtypes_CCOBJS)

it claims there are no pre-requisites for
libsl_dbtypes.a - and when I try an origin call on
dbtypes_CCOBJS it reports it as undefined.

************************************************************************************
I can, as an alternative, just create the rules, and
leave the pattern match macros in for Each library -
but we are talking 160 odd libraries and apps - I
would like to factor out these lines if possible.

It is entirely possible I am again not seeing the
"woods for the trees" again ! But..

When is the eval function evaluated ?
Does using a function (i.e. patsubst aka the pattern
match macro) inside an eval statement work ? Does this
function need to be wrapped inside an eval call itself
? i.e. nested eval calls ? Should I just use the eval
call, as per the example in the gnu manual, to
generate the rules for the .o files and leave the
pattern match macro's in for each library ? 

I hope I've explained this properly, just missed
something in my design and you can point my way back
to K.I.S.S land. Again any help is greatly appreciated
:-)

Alister 

PS: Paul if your answering this although they are sent
from different addresses either is fine to reply to. 

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


------------------------------

Date: Fri, 7 Feb 2003 17:41:05 +1100 
From: "Shipman, Alister" <address@hidden>
To: address@hidden
Subject: eval function
Message-ID: <address@hidden>
Content-Type: multipart/alternative;
        boundary="----_=_NextPart_001_01C2CE73.E3545170"
MIME-Version: 1.0
Precedence: list
Reply-To: "Shipman, Alister" <address@hidden>, "
        address@hidden" <address@hidden>
Message: 4

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2CE73.E3545170
Content-Type: text/plain;
        charset="iso-8859-1"

Hi guys/Paul,

Still trying to understand "eval" which could be very useful for me. Below
is the bare minimum makefile which illustrates my problem.

****************************************************************************
****************************************multicast_CCSRCS = 1.cc 2.cc 3.cc

define RULE_MATCH_MACROS
libsl_$(1).a : $$($(1)_OBJS)
endef

multicast_OBJS := $(multicast_CCSRCS:.cc=.o)
temp := $(eval $(call RULE_MATCH_MACROS,multicast))

.SUFFIXES: .cc .o 

%.o : %.cc
        @echo 'Reached object target'
****************************************************************************
****************************************

Running this with the goal target libsl_multicast.a results in a "no rule to
make target "libsl_multicast.a"

Any thoughts ?
Is their any way to view the makefile that is produced after make has
processed all the eval statements, include files etc - like a compiler
switch that allows you to just run the pre-processor and view the output ??

I'm really keen to get over this understanding hurdle (plus it can help make
a really bad build system good !) - think I'm almost their - so again, your
help is greatly appreciated :-)

Alister


------_=_NextPart_001_01C2CE73.E3545170
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<DEFANGED_META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<DEFANGED_META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.89">
<TITLE>eval function</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi guys/Paul,</FONT>
</P>

<P><FONT SIZE=3D2>Still trying to understand "eval" which could be very =
useful for me. Below is the bare minimum makefile which illustrates my =
problem.</FONT></P>

<P><FONT =
SIZE=3D2>***************************************************************=
*****************************************************multicast_CCSRCS =
=3D 1.cc 2.cc 3.cc</FONT></P>

<P><FONT SIZE=3D2>define RULE_MATCH_MACROS</FONT>
<BR><FONT SIZE=3D2>libsl_$(1).a : $$($(1)_OBJS)</FONT>
<BR><FONT SIZE=3D2>endef</FONT>
</P>

<P><FONT SIZE=3D2>multicast_OBJS :=3D =
$(multicast_CCSRCS:.cc=3D.o)</FONT>
<BR><FONT SIZE=3D2>temp :=3D $(eval $(call =
RULE_MATCH_MACROS,multicast))</FONT>
</P>

<P><FONT SIZE=3D2>.SUFFIXES: .cc .o </FONT>
</P>

<P><FONT SIZE=3D2>%.o : %.cc</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>@echo =
'Reached object target'</FONT>
<BR><FONT =
SIZE=3D2>***************************************************************=
*****************************************************</FONT>
</P>

<P><FONT SIZE=3D2>Running this with the goal target libsl_multicast.a =
results in a &quot;no rule to make target =
&quot;libsl_multicast.a&quot;</FONT>
</P>

<P><FONT SIZE=3D2>Any thoughts ?</FONT>
<BR><FONT SIZE=3D2>Is their any way to view the makefile that is =
produced after make has processed all the eval statements, include =
files etc - like a compiler switch that allows you to just run the =
pre-processor and view the output ??</FONT></P>

<P><FONT SIZE=3D2>I'm really keen to get over this understanding hurdle =
(plus it can help make a really bad build system good !) - think I'm =
almost their - so again, your help is greatly appreciated =
:-)</FONT></P>

<P><FONT SIZE=3D2>Alister</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C2CE73.E3545170--


------------------------------

_______________________________________________
Help-make mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-make


End of Help-make Digest, Vol 3, Issue 6
***************************************





reply via email to

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