Make Q's

bruce.labitt at autoliv.com bruce.labitt at autoliv.com
Thu Sep 17 10:17:51 EDT 2009


> On Wed, 2009-09-16 at 23:28 -0400, Kevin D. Clark wrote:
> > Look, I could write a big writeup here, giving you a complete example
> > of a Makefile that is similar to what I know you are looking for, but
> > in actuality let me just tell you that I happen to be a big fan of the
> > GNU Make manual.  I think that in 20 minutes of skimming you'll be
> > well on your way.
> 
> Lloyd Kvam
> I also like the GNU Make manual, but I found it vary hard to use when
> first learning make.  Once you have a bit of feel for what you are doing
> the manual is clear and concise.
> http://www.gnu.org/software/make/
> 

It is hard to 'skim' 182 pages. :0

Nonetheless, allow me to ask for a critique (do I dare?) for this 
construct:

CC=g++
CCOPTS=
INCLUDES=
DEPS=

%.o: %.cpp $(DEPS)
        $(CC) -c $< $(CCOPTS) $(INCLUDES)

This will process all .cpp files with the rule?

Can I just add this?

%.o: %.c $(DEPS)
        gcc -c $< $(CCOPTS) $(INCLUDES)



> "The art of UNIX Programming" (in the library thanks to Ted Roche) has a
> section in the tools chapter on make, but that's a higher level
> discussion and not a tutorial.  Eric Raymond recommends studying the
> fetchmail make file as a useful example.
> 

I'll try to find it.

> Years ago, Jason Stephenson and Dave Johnson were very helpful to me
> when I posted a request for help writing a makefile.  I'm sure you'll
> get some good advice here.
> 

I need it!

-Bruce


******************************
Neither the footer nor anything else in this E-mail is intended to or constitutes an <br>electronic signature and/or legally binding agreement in the absence of an <br>express statement or Autoliv policy and/or procedure to the contrary.<br>This E-mail and any attachments hereto are Autoliv property and may contain legally <br>privileged, confidential and/or proprietary information.<br>The recipient of this E-mail is prohibited from distributing, copying, forwarding or in any way <br>disseminating any material contained within this E-mail without prior written <br>permission from the author. If you receive this E-mail in error, please <br>immediately notify the author and delete this E-mail.  Autoliv disclaims all <br>responsibility and liability for the consequences of any person who fails to <br>abide by the terms herein. <br>
******************************



More information about the gnhlug-discuss mailing list