home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 342a.lha / make / make.man < prev    next >
Encoding:
Text File  |  1990-02-10  |  9.6 KB  |  265 lines

  1.  
  2.      MAKE(1)               AMIGA Programmer's Manual                MAKE(1)
  3.  
  4.  
  5.  
  6.      ›1mNAME 
  7.           ›0mmake - maintain program groups 
  8.  
  9.      ›1mSYNTAX 
  10.           ›0mmake [ -f makefile ] [ option ] ... file ...  
  11.  
  12.      ›1mDESCRIPTION 
  13.           ›0m›3mMake  ›0mexecutes  commands  in  ›3mmakefile ›0mto update one or more
  14.           target ›3mnames.  Name ›0mis typically a program.  If no -f option
  15.           is present, `makefile' and `Makefile' are  tried  in  order.
  16.           If ›3mmakefile  ›0mis `-', the standard input is taken.  More than
  17.           one -f option may appear.  
  18.  
  19.           ›3mMake ›0mupdates a target if it depends  on  prerequisite  files
  20.           that  have been modified since the target was last modified,
  21.           or if the target does not exist.  
  22.  
  23.           ›3mMakefile  ›0mcontains  a  sequence  of  entries  that   specify
  24.           dependencies.    The   first   line   of   an   entry  is  a
  25.           blank-separated list of targets, then a colon, then  a  list
  26.           of prerequisite  files.  Text following a semicolon, and all
  27.           following lines that begin with a tab, are shell commands to
  28.           be executed to update the target.  If a name appears on  the
  29.           left  of  more than one `colon' line, then it depends on all
  30.           of the names on the right of the colon on those  lines,  but
  31.           only one  command  sequence  may  be specified for it.  If a
  32.           name appears on a line with  a  double  colon  ::  then  the
  33.           command  sequence  following  that line is performed only if
  34.           the name is out of date with respect to  the  names  to  the
  35.           right  of  the  double  colon,  and is not affected by other
  36.           double colon lines on which that name may appear.  
  37.  
  38.           Two special forms of a name are recognized.    A  name  like
  39.           ›3ma(b)  ›0mmeans  the file named ›3mb ›0mstored in the archive named ›3ma.
  40.           ›0mA name like ›3ma((b))  ›0mmeans  the  file  stored  in  archive  a
  41.           containing the entry point ›3mb.  
  42.  
  43.           ›0mSharp and newline surround comments.  
  44.  
  45.           The  following makefile says that `pgm' depends on two files
  46.           `a.o' and `b.o', and that they in turn depend on `.c'  files
  47.           and a common file `incl'.  
  48.  
  49.                   pgm: a.o b.o 
  50.                           cc a.o b.o -lm -o pgm 
  51.                   a.o: incl a.c 
  52.                           cc -c a.c 
  53.                   b.o: incl b.c 
  54.                           cc -c b.c 
  55.  
  56.           ›3mMakefile ›0mentries of the form 
  57.  
  58.                   string1 = string2 
  59.  
  60.           are macro definitions.  Subsequent appearances of ›3m$(string1)
  61.           ›0mor ›3m${string1}  ›0mare  replaced  by  ›3mstring2.   ›0mIf ›3mstring1 ›0mis a
  62.           single character, the parentheses or braces are optional.  
  63.  
  64.  
  65.                                       -1-
  66.  
  67.  
  68.      MAKE(1)               AMIGA Programmer's Manual                MAKE(1)
  69.  
  70.  
  71.  
  72.           ›3mMake ›0minfers prerequisites for files for which ›3mmakefile ›0mgives
  73.           no construction commands.  For example, a `.c' file  may  be
  74.           inferred  as prerequisite for a `.o' file and be compiled to
  75.           produce the `.o' file.  Thus the preceding  example  can  be
  76.           done more briefly: 
  77.  
  78.                   pgm: a.o b.o 
  79.                           cc a.o b.o -lm -o pgm 
  80.                   a.o b.o: incl 
  81.  
  82.           Prerequisites  are  inferred  according to selected suffixes
  83.           listed  as  the  `prerequisites'  for   the   special   name
  84.           `.SUFFIXES'; multiple lists accumulate; an empty list clears
  85.           what came  before.  Order is significant; the first possible
  86.           name for which both a file and a rule as  described  in  the
  87.           next paragraph exist is inferred.  The default list is 
  88.  
  89.                   .SUFFIXES: .out .o .c .e .r .f .y .l .s .p 
  90.  
  91.           The  rule  to create a file with suffix ›3ms2 ›0mthat depends on a
  92.           similarly named file with suffix ›3ms1 ›0mis specified as an entry
  93.           for the `target' ›3ms1s2.  ›0mIn such an entry, the special  macro
  94.           $*  stands  for  the target name with suffix deleted, $@ for
  95.           the  full  target  name,  $<  for  the  complete   list   of
  96.           prerequisites, and  $?    for the list of prerequisites that
  97.           are out of date.  For example, a rule for  making  optimized
  98.           `.o' files from `.c' files is 
  99.  
  100.                   .c.o: ; cc -c -O -o $@ $*.c 
  101.  
  102.           Certain  macros  are  used by the default inference rules to
  103.           communicate   optional   arguments    to    any    resulting
  104.           compilations.   In  particular,  `CFLAGS'  is used for ›3mcc(1)
  105.           ›0moptions, `FFLAGS' for ›3mf77(1)  ›0moptions,  `PFLAGS'  for  ›3mpc(1)
  106.           ›0moptions,  and  `LFLAGS'  and  `YFLAGS'  for  ›3mlex ›0mand ›3myacc(1)
  107.           ›0moptions.  In addition, the macro `MFLAGS' is filled in  with
  108.           the initial  command  line  options  supplied to ›3mmake.  ›0mThis
  109.           simplifies maintaining a hierarchy of makefiles as  one  may
  110.           then  invoke  ›3mmake  ›0mon  makefiles in subdirectories and pass
  111.           along useful options such as -k.  
  112.  
  113.           Command lines are executed one at a time, each  by  its  own
  114.           shell.   A  line  is  printed when it is executed unless the
  115.           special target  `.SILENT'  is  in  ›3mmakefile,  ›0mor  the  first
  116.           character of the command is `@'.  
  117.  
  118.           Commands  returning nonzero status (see ›3mintro(1)) ›0mcause ›3mmake
  119.           ›0mto terminate unless  the  special  target  `.IGNORE'  is  in
  120.           ›3mmakefile ›0mor the command begins with <tab><hyphen>.  
  121.  
  122.           Interrupt and quit cause the target to be deleted unless the
  123.           target  is  a  directory  or  depends  on  the  special name
  124.           `.PRECIOUS'.  
  125.  
  126.           Other options: 
  127.  
  128.           -i   Equivalent to the special entry `.IGNORE:'.  
  129.  
  130.  
  131.                                       -2-
  132.  
  133.  
  134.      MAKE(1)               AMIGA Programmer's Manual                MAKE(1)
  135.  
  136.  
  137.  
  138.           -k   When a command returns nonzero status, abandon work  on
  139.                the current entry, but continue on branches that do not
  140.                depend on the current entry.  
  141.  
  142.           -n   Trace and print, but do not execute the commands needed
  143.                to update the targets.  
  144.  
  145.           -t   Touch, i.e.    update  the  modified  date  of targets,
  146.                without executing any commands.  
  147.  
  148.           -r   Equivalent to an  initial  special  entry  `.SUFFIXES:'
  149.                with no list.  
  150.  
  151.           -s   Equivalent to the special entry `.SILENT:'.  
  152.  
  153.           -q   Question up-to-dateness  of target.  Return exit status
  154.                1 if not; otherwise, return 0.  
  155.  
  156.           -r   Don't use built-in rules.  
  157.  
  158.      ›1mFILES 
  159.           ›0mmakefile, Makefile 
  160.  
  161.      ›1mSEE ALSO 
  162.           ›0msh(1), touch(1), f77(1), pc(1) 
  163.           S. I. Feldman ›3mMake -  A  Program  for  Maintaining  Computer
  164.           Programs 
  165.  
  166.      ›0m›1mBUGS 
  167.           ›0mSome commands return nonzero status inappropriately.  Use -i
  168.           to overcome  the  difficulty.    Commands  that are directly
  169.           executed by the shell, notably ›3mcd(1), ›0mare ineffectual across
  170.           newlines in ›3mmake.  
  171.  
  172.      ›0m›1mAMIGA VERSION 
  173.           ›0mNot all of the above applies to the Amiga version  of  ›3mmake.
  174.           ›0mIn   particular,   the   default   rules  and  suffixes  are
  175.           different.  
  176.  
  177.           Omissions: 
  178.           Libraries and the related notation are not implemented.  
  179.           The -k option is not supported.  
  180.           The `;' construct is not implemented.  
  181.           The remarks related to ›3mMFLAGS, lex(1), yacc(1),  f77(1)  ›0mand
  182.           ›3mpc(1) ›0mdo not apply.  
  183.           $< and  $?    are  not  exactly  as  specified:  $<  is  ONE
  184.           prerequisite that is out of date (including path name),  and
  185.           $?  is ALL prerequisites (without path names).  
  186.  
  187.           Additions: 
  188.           If  a file ›3ms:builtins.make ›0mexists, this file is used instead
  189.           of the built-in rules.  
  190.           Filenames are not  case-significant.    Unfortunately,  this
  191.           also  applies to the special target names .PRECIOUS, .IGNORE
  192.           and .SILENT. These can also be specified  as  .Precious,  or
  193.           .iGnOrE.  
  194.           ›3mCd ›0mcommands are effective.  
  195.  
  196.  
  197.                                       -3-
  198.  
  199.  
  200.      MAKE(1)               AMIGA Programmer's Manual                MAKE(1)
  201.  
  202.  
  203.           Comment characters (#) may be escaped with a backslash (\).  
  204.           At  most  1  colon  is  allowed  in  a target file name (for
  205.           including device names).  In that case, the  trailing  colon
  206.           must   follow  the  target  name  immediately,  without  any
  207.           intervening white space.    Spaces  in  the  names  are  not
  208.           allowed.  
  209.           A new  special  target  name  has  been  added:  ›3m.PATH.  ›0mAny
  210.           prerequisite names for ›3m.PATH ›0mare  used  for  finding  source
  211.           files for implicit rules.  You name one or more directories,
  212.           and  if the source file for an implicit rule cannot be found
  213.           in the current directory, each of the the given pathnames is
  214.           prepended (in the order given) to the source name, until the
  215.           file is found.  
  216.  
  217.           For instance, the Makefile 
  218.  
  219.                   .PATH: src/ include/ src/old 
  220.  
  221.                   pgm: pgm.o 
  222.  
  223.           will look (according to the .c.o rule) for pgm.c, src/pgm.c,
  224.           include/pgm.c and src/oldpgm.c, in that order.   Of  course,
  225.           due  to  other  implicit  rules,  other  files  (with  other
  226.           suffixes) may be tried as well.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.                                       -4-
  264.  
  265.