bugmake - Bugs: bug #19298, simplify automatic generation of...

 
 

bug #19298: simplify automatic generation of prerequisites example

Submitter:  None
Submitted:  Sun 11 Mar 2007 05:38:48 PM UTC
   
 
Severity:  1 - Wish Item Group:  Documentation
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  3.81 Operating System:  Any
Fixed Release:  None Triage Status:  Medium Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 03 Oct 2011 10:21:21 AM UTC, comment #3: 

I would not discuss too much on this issue (4 years already!). The first example works indep. of compiler used, second works for gcc.

The request is then to remove the given example in the manual and replace it with:

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


%.d : %.c
 set -e; \
 @echo -n $@" " > $@ \
 $(CC) $(CFLAGS) -MM $< >> $@


Using gcc as compiler, one can also use -MT and -MF:


%.d : %.c
 $(CC) $(CFLAGS) -MM -MT $@ -MT $*.o -MF $@ $<


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

For the rest, I would make another bug request. Afaik the section is very clear, and I don't need to be convinced any further that it is useful.

Patrick M. <fuujuhi>
Sun 02 Aug 2009 11:33:05 PM UTC, comment #2: 

It's more than time to rework this section of the manual to document the newer method of handling automatic prerequisite generation.

Then the question becomes, what example can we use to show the power of automated makefile rebuilds?  I think we might need a section in the manual discussing dynamic makefile creation options.  We can start with constructed variable names, then move to included makefile generation, and end up with the most complex: eval.  We'll need to think up a good set of examples to show the various options and when they're appropriate.

Paul D. Smith <psmith>
Group administrator
Sun 11 Mar 2007 06:29:00 PM UTC, comment #1: 

Unfortunately not every compiler supports these options.  The GNU make manual does not assume that everyone is using GCC.

Specialized commands for use with GCC could perhaps be added as an alternative to the generic method.

Paul D. Smith <psmith>
Group administrator
Sun 11 Mar 2007 05:38:48 PM UTC, original submission:  

in section 4.14 Generating Prerequisites Automatically

the example is quite complex using sed to add the *.d files as target. there are easier ways to do that.

using an extra echo
%.d : %.c
  @echo -n $@" " > $@
  $(CC) $(CFLAGS) -MM $< >> $@

using gcc options -MT and -MF
%.d : %.c
  $(CC) $(CFLAGS) -MM -MT $@ -MT $(basename $@).o -MF $@ $<


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by fuujuhi (Posted a comment)
  • -email is unavailable- added by psmith (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-08-02 psmith Triage StatusNone Medium Effort
    2007-03-11 psmith Severity3 - Normal 1 - Wish

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code