Hi, In a .mk makefile, there are these kinds of lines: modules := abc xyz abc_type := static_library abc_target := libabc.a I know traditional Makefile format(simple usage). Where can find these "new" format guide? Thanks Ming Cheng
On Mon, 20 Jun 2022, 05:58 Ming Cheng via Gcc-help, <gcc-help@gcc.gnu.org> wrote: > Hi, > > In a .mk makefile, there are these kinds of lines: > modules := abc xyz > abc_type := static_library > abc_target := libabc.a > > > I know traditional Makefile format(simple usage). Where can find these > "new" format guide? > GCC requires GNU Make. This syntax is documented in the GNU Make manual: https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors > Thanks > Ming Cheng >
________________________________ From: Ming Cheng <chengm349@hotmail.com> Sent: Tuesday, June 21, 2022 8:41 AM To: Jonathan Wakely <jwakely.gcc@gmail.com> Subject: Re: Makefile format Hi Jonathan Wakely, Thanks for your kind first step. I should have made my question more clearer. We have a module called abc. Amazingly user can just define abc_type, abc_target; and GNU make seems to me that according to its rules will implicitly look for these bars if defined. Does the same doc have these rules description? Thanks Ming ________________________________ From: Jonathan Wakely <jwakely.gcc@gmail.com> Sent: Monday, June 20, 2022 6:45 AM To: Ming Cheng <chengm349@hotmail.com> Cc: gcc-help <gcc-help@gcc.gnu.org> Subject: Re: Makefile format On Mon, 20 Jun 2022, 05:58 Ming Cheng via Gcc-help, <gcc-help@gcc.gnu.org<mailto:gcc-help@gcc.gnu.org>> wrote: Hi, In a .mk makefile, there are these kinds of lines: modules := abc xyz abc_type := static_library abc_target := libabc.a I know traditional Makefile format(simple usage). Where can find these "new" format guide? GCC requires GNU Make. This syntax is documented in the GNU Make manual: https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors Thanks Ming Cheng
On Tue, 21 Jun 2022 at 09:50, Ming Cheng via Gcc-help <gcc-help@gcc.gnu.org> wrote: > Hi Jonathan Wakely, > > Thanks for your kind first step. I should have made my question more clearer. > > We have a module called abc. Amazingly user can just define abc_type, abc_target; and GNU make seems to me that according to its rules will implicitly look for these bars if defined. Does the same doc have these rules description? Yes, the GNU Make manual is detailed and complete, see https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#Catalogue-of-Rules This is off-topic for the gcc-help list though.
On Tue, 2022-06-21 at 10:42 +0100, Jonathan Wakely via Gcc-help wrote:
> > Thanks for your kind first step. I should have made my question
> > more clearer.
> >
> > We have a module called abc. Amazingly user can just define
> > abc_type, abc_target; and GNU make seems to me that according to
> > its rules will implicitly look for these bars if defined. Does the
> > same doc have these rules description?
>
> Yes, the GNU Make manual is detailed and complete, see
> https://www.gnu.org/software/make/manual/html_node/Catalogue-of-
> Rules.html#Catalogue-of-Rules
> This is off-topic for the gcc-help list though.
Please use the help-make@gnu.org mailing list for assistance using GNU
make.
Cheers!
Hi Paul,
I downloaded the PDF and failed to find _target, _type. I must miss you point. Please guide further.
Thanks.
Ming
________________________________
From: Paul Smith <paul@mad-scientist.net>
Sent: Tuesday, June 21, 2022 11:55 AM
To: Ming Cheng <chengm349@hotmail.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Fw: Makefile format
On Tue, 2022-06-21 at 10:42 +0100, Jonathan Wakely via Gcc-help wrote:
> > Thanks for your kind first step. I should have made my question
> > more clearer.
> >
> > We have a module called abc. Amazingly user can just define
> > abc_type, abc_target; and GNU make seems to me that according to
> > its rules will implicitly look for these bars if defined. Does the
> > same doc have these rules description?
>
> Yes, the GNU Make manual is detailed and complete, see
> https://www.gnu.org/software/make/manual/html_node/Catalogue-of-
> Rules.html#Catalogue-of-Rules
> This is off-topic for the gcc-help list though.
Please use the help-make@gnu.org mailing list for assistance using GNU
make.
Cheers!
On Wed, 2022-06-22 at 03:12 +0000, Ming Cheng wrote:
> I downloaded the PDF and failed to find _target, _type. I must miss
> you point. Please guide further.
What I'm saying is that the gcc-help mailing list is not the right
place to ask for help understanding makefiles or using GNU make. gcc-
help is for help with the GCC compiler. GNU make is a completely
separate project, so you shouldn't be sending those questions to the
GCC list.
Instead you should send your questions about understanding makefiles or
using GNU make only to the help-make@gnu.org mailing list, not the GCC
list.
As for your question, I didn't fully understand it so when you send
questions to the help-make@gnu.org mailing list, please include an
example of the part of the makefile that you don't understand, and/or
the make command you typed, and/or the output you received that was not
right, and explain why it wasn't what you expected and what you wanted
to happen instead.
Just to be clear, there is nothing built into GNU make that treats any
files ending with "_target" or "_type" in any special way at all, so
you won't find any reference to such a thing in the GNU make manual.
If something special is happening with those targets then something in
your makefiles is doing it. We cannot guess what that might be, with
the information provided.