Changes between Version 17 and Version 18 of Attic/Building/BuildSystem/New


Ignore:
Timestamp:
Jan 13, 2009 2:27:03 PM (5 years ago)
Author:
simonmar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Attic/Building/BuildSystem/New

    v17 v18  
    333333 
    334334 
     335== Idiom: the "all" and "clean" targets == 
     336 
     337We want an `all` target that builds everything, but we also want a way to build individual components (say, everything in `rts/`).  This is achieved by having a separate `all` target for each directory, named `all_`''directory'', e.g. 
     338 
     339{{{ 
     340all : all_rts 
     341.PHONY all_rts 
     342all_rts : ... 
     343}}} 
     344 
     345The `all_rts` target is used by the stub makefile (see earlier stub-makefile idiom) when you say `make` in `rts/`. 
     346 
     347Other standard targets such as `clean`, `install`, and so on use the same technique.  There are pre-canned macros to define your "all" and "clean" targets, take a look in `rules/all-target.mk` and `rules/clean-target.mk`. 
    335348 
    336349== Idiom: no double-colon rules == 
     
    340353executed if the target needs to be rebuilt.  This style was popular 
    341354for things like "all" and "clean" targets in the past, but it's not 
    342 really necessary.   We adopt the following idiom instead: 
    343  
    344 {{{ 
    345 all : all_foo 
    346 .PHONY all_foo 
    347 all_foo : ... 
    348 }}} 
     355really necessary - see the "all" idiom above - and this means there's one fewer makeism you need to know about. 
    349356 
    350357== Idiom: the vanilla way == 
     
    362369course). 
    363370 
    364 == Idiom: the "all" and "clean" targets == 
    365  
    366 There are pre-canned macros to define your "all" and "clean" targets, 
    367 take a look in `rules/all-target.mk` and `rules/clean-target.mk`.