home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / c / pdc.lzh / File6 < prev    next >
Text File  |  1991-08-04  |  6KB  |  170 lines

  1.             SYNOPSIS
  2.  
  3.  
  4.       make [-f makefile] [-ins] [target(s) ...]
  5.  
  6.       (Better than EON mk but not quite as good as UNIX make)
  7.  
  8.       -f makefile name
  9.       -i ignore exit status
  10.       -n Pretend to make
  11.       -p Print all macros & targets
  12.       -q Question up-to-dateness of target.  Return exit status 1 if not
  13.       -r Don't not use inbuilt rules
  14.       -s Make silently
  15.       -t Touch files instead of making them
  16.       -m Change memory requirements (EON only)
  17.  
  18. .........................................................................
  19.  
  20.  
  21.                                                           make(1)
  22.  
  23.  
  24.  
  25. NAME
  26.      make - maintain program groups
  27.  
  28. SYNTAX
  29.      make [ -f makefile ] [ option ] ...  file ...
  30.  
  31. DESCRIPTION
  32.      Make executes commands in makefile to update one or more
  33.      target names.  Name is typically a program.  If no -f option
  34.      is present, `makefile' and `Makefile' are tried in order.
  35.      If makefile is `-', the standard input is taken.  More than
  36.      one -f option may appear
  37.  
  38.      Make updates a target if it depends on prerequisite files
  39.      that have been modified since the target was last modified,
  40.      or if the target does not exist.
  41.  
  42.      Makefile contains a sequence of entries that specify depen-
  43.      dencies.  The first line of an entry is a blank-separated
  44.      list of targets, then a colon, then a list of prerequisite
  45.      files.  Text following a semicolon, and all following lines
  46.      that begin with a tab, are shell commands to be executed to
  47.      update the target.  If a name appears on the left of more
  48.      than one `colon' line, then it depends on all of the names
  49.      on the right of the colon on those lines, but only one com-
  50.      mand sequence may be specified for it.  If a name appears on
  51.      a line with a double colon :: then the command sequence fol-
  52.      lowing that line is performed only if the name is out of
  53.      date with respect to the names to the right of the double
  54.      colon, and is not affected by other double colon lines on
  55.      which that name may appear.
  56.  
  57.      Two special forms of a name are recognized.  A name like
  58.      a(b) means the file named b stored in the archive named a. A
  59.      name like a((b)) means the file stored in archive a contain-
  60.      ing the entry point b.
  61.  
  62.      Sharp and newline surround comments.
  63.  
  64.      The following makefile says that `pgm' depends on two files
  65.      `a.o' and `b.o', and that they in turn depend on `.c' files
  66.      and a common file `incl'.
  67.  
  68.           pgm: a.o b.o
  69.             cc a.o b.o -lm -o pgm
  70.           a.o: incl a.c
  71.             cc -c a.c
  72.           b.o: incl b.c
  73.             cc -c b.c
  74.  
  75.      Makefile entries of the form
  76.  
  77.           string1 = string2
  78.  
  79.      are macro definitions.  Subsequent appearances of $(string1)
  80.      or ${string1} are replaced by string2.  If string1 is a sin-
  81.      gle character, the parentheses or braces are optional.
  82.  
  83.      Make infers prerequisites for files for which makefile gives
  84.      no construction commands.  For example, a `.c' file may be
  85.      inferred as prerequisite for a `.o' file and be compiled to
  86.      produce the `.o' file.  Thus the preceding example can be
  87.      done more briefly:
  88.  
  89.           pgm: a.o b.o
  90.             cc a.o b.o -lm -o pgm
  91.           a.o b.o: incl
  92.  
  93.      Prerequisites are inferred according to selected suffixes
  94.      listed as the `prerequisites' for the special name `.SUF-
  95.      FIXES'; multiple lists accumulate; an empty list clears what
  96.      came before.  Order is significant; the first possible name
  97.      for which both a file and a rule as described in the next
  98.      paragraph exist is inferred.  The default list is
  99.  
  100.           .SUFFIXES: .out .o .c .e .r .f .y .l .s .p
  101.  
  102.      The rule to create a file with suffix s2 that depends on a
  103.      similarly named file with suffix s1 is specified as an entry
  104.      for the `target' s1s2.  In such an entry, the special macro
  105.      $* stands for the target name with suffix deleted, $@ for
  106.      the full target name, $< for the complete list of prere-
  107.      quisites, and $? for the list of prerequisites that are out
  108.      of date.  For example, a rule for making optimized `.o'
  109.      files from `.c' files is
  110.  
  111.           .c.o: ; cc -c -O -o $@ $*.c
  112.  
  113.      Certain macros are used by the default inference rules to
  114.      communicate optional arguments to any resulting compila-
  115.      tions.  In particular, `CFLAGS' is used for cc(1) options,
  116.      `FFLAGS' for f77(1) options, `PFLAGS' for pc(1) options, and
  117.      `LFLAGS' and `YFLAGS' for lex and yacc(1) options.  In addi-
  118.      tion, the macro `MFLAGS' is filled in with the initial com-
  119.      mand line options supplied to make.  This simplifies main-
  120.      taining a hierarchy of makefiles as one may then invoke make
  121.      on makefiles in subdirectories and pass along useful options
  122.      such as -k.
  123.  
  124.      Command lines are executed one at a time, each by its own
  125.      shell.  A line is printed when it is executed unless the
  126.      special target `.SILENT' is in makefile, or the first char-
  127.      acter of the command is `@'.
  128.  
  129.      Commands returning nonzero status (see intro(1)) cause make
  130.      to terminate unless the special target `.IGNORE' is in
  131.      makefile or the command begins with <tab><hyphen>.
  132.  
  133.      Interrupt and quit cause the target to be deleted unless the
  134.      target is a directory or depends on the special name `.PRE-
  135.      CIOUS'.
  136.  
  137.      Other options:
  138.  
  139.      -i   Equivalent to the special entry `.IGNORE:'.
  140.  
  141.      -k   When a command returns nonzero status, abandon work on
  142.           the current entry, but continue on branches that do not
  143.           depend on the current entry.
  144.  
  145.      -n   Trace and print, but do not execute the commands needed
  146.           to update the targets.
  147.  
  148.      -t   Touch, i.e. update the modified date of targets,
  149.           without executing any commands.
  150.  
  151.      -r   Equivalent to an initial special entry `.SUFFIXES:'
  152.           with no list.
  153.  
  154.      -s   Equivalent to the special entry `.SILENT:'.
  155.  
  156. FILES
  157.      makefile, Makefile
  158.  
  159. SEE ALSO
  160.      sh(1), touch(1), f77(1), pc(1)
  161.      S. I. Feldman Make - A Program for Maintaining Computer Pro-
  162.      grams
  163.  
  164. RESTRICTIONS
  165.      Some commands return nonzero status inappropriately.  Use -i
  166.      to overcome the difficulty.
  167.      Commands that are directly executed by the shell, notably
  168.      cd(1), are ineffectual across newlines in make.
  169.  
  170.