Changes between Version 3 and Version 4 of kmk Quick Reference


Ignore:
Timestamp:
Apr 18, 2009, 12:08:24 PM (15 years ago)
Author:
bird
Comment:

Added recipes.

Legend:

Unmodified
Added
Removed
Modified
  • kmk Quick Reference

    v3 v4  
    11{{{
    22#!rst
     3
    34
    45kmk Quick Reference
     
    976977
    977978
     979Recipes
     980-------
     981
     982    A typical recipe takes one of the two following forms::
     983
     984        targets : normal-prerequisites | order-only-prerequisites
     985                command
     986                ...
     987
     988        targets : normal-prerequisites | order-only-prerequisites ; command
     989                command
     990                ...
     991
     992    Specifying more than one file in the ``targets`` lists is the same as
     993    repeating the recipe for each of the files.
     994
     995    Use ``+`` and ``+|`` in the list of ``targets`` to tell ``kmk`` that the
     996    recipe has more than one output. [1]_ The files after a ``+`` will
     997    always be remade, while the files after a ``+|`` don't have to be remade.
     998    The latter is frequently employed to update files which prerequisites
     999    change wihtout the output files necessarily changing. See also
     1000    ``kmk_cp --changed``.
     1001
     1002
     1003Double colon recipes
     1004
     1005    Double colon recipes are written with ``::`` instead of ``:`` and are
     1006    handled differently from ordinary recipes if the target appears in more
     1007    than one recipe. First, all the recipes must be of the double colon type.
     1008    Second, the recipes are executed individually and may be omitted depending
     1009    on the state of their prerequisites. Double colon recipes without any
     1010    prerequisites will always be executed.
     1011
     1012
     1013Pattern rules
     1014
     1015    A couple of examples::
     1016
     1017        %.o : %.c
     1018                gcc -o $@ $<
     1019        %.tab.c %.tab.h : %.y
     1020                bison -d $<
     1021
     1022    The latter has two outputs.
     1023
     1024
    9781025-----
    9791026
     
    9831030-----
    9841031
    985 :Status: $Id: QuickReference-kmk.txt 2172 2008-12-31 00:03:02Z bird $
     1032:Status: $Id: QuickReference-kmk.txt 2340 2009-04-18 12:05:47Z bird $
    9861033:Copyright: Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
    9871034            1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
    9881035            2007 Free Software Foundation, Inc.
    9891036
    990             Copyright (C) 2008 Knut St. Osmundsen
     1037            Copyright (c) 2008-2009 knut st. osmundsen
    9911038
    9921039}}}