home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / sysutl / picnix32.arc / MAKE.ARC / MAKE.DOC < prev    next >
Encoding:
Text File  |  1986-01-31  |  6.6 KB  |  146 lines

  1. The majority of the text of this file was written by:  
  2.  
  3.                 Jeffrey Spidle
  4.                 Systems Analyst
  5.                 Office of Continuing Education
  6.                 Iowa State University
  7.                 Ames,   IA 50011
  8.  
  9. Since there is a similarity in operation between his program and this one,  I
  10. saw no reason to "re-invent the wheel".
  11.  
  12.         This a utility called 'MAKE' and is a much simplified version of the 
  13. MAKE utility on UNIX (a trademark or something of AT&T).  This program was ori-
  14. ginally written by Larry Campbell of DEC using the CI-C86 compiler.  I have re-
  15. written it using the Lattice C compiler Ver. 2.14 running under MS/PC-DOS 2.1x. 
  16. Added features include macro capability, command line parsing of macros, silent
  17. operation (-s option), ignore/obey errors (-i option), faster operation, and 
  18. the ability to run any DOS-level command.       --      March 31,  1985
  19.  
  20.                                 Mike Hickey
  21.                                 Systems Programmer
  22.                                 Computer Center
  23.                                 University of DC
  24.                                 Washington, DC
  25.  
  26.  
  27. /* modifications made June, 1985 by Dan Grayson, 2409 S. Vine St. , Urbana, 
  28.         IL 61801 */
  29.  
  30.  
  31.  
  32.         'MAKE' takes a file of dependencies (a  'makefile') and decides what
  33. commands have to be executed to bring the  files up to  date.  These commands 
  34. are either executed directly from 'MAKE' or written to the standard output with-
  35. out executing them.
  36.  
  37. 'MAKEFILE' format:
  38.  
  39.         -       The first makefile read is MAKE.INI, which can be located
  40.                 anywhere along the PATH.
  41.  
  42.         -       The default name of the makefile is MAKEFILE on the default
  43.                 disk.  An alternate makefile can be specified using the '-f' 
  44.                 option on the command  line.
  45.  
  46.         -       Any line starting with a "#" is considered to be a
  47.                 comment line and is ignored by MAKE.  So is a line which is
  48.                 completely blank.
  49.  
  50.         -       A line in a 'makefile' that starts with a tab or space is a 
  51.                 'howto' line and consists of a command name followed by arg-
  52.                 uments.  When
  53.                 commands are executed, the PATH environment variable is used to
  54.                 find the command, in the same manner as DOS does. 
  55.                 'Howto' lines apply to the most recently preceding 'dependency'
  56.                 line.  It is an error for a 'howto' line  to precede the first 
  57.                 'dependency' line.  Howto lines may have any combination of the
  58.                 following characters to the left of the command:
  59.  
  60.                         @               will not echo the command line
  61.  
  62.                         -               MAKE will ignore the exit code of the
  63.                                         command, i.e. the ERRORLEVEL of MSDOS.
  64.                                         Without this, make terminates when a
  65.                                         nonzero exit code is returned.
  66.  
  67.                         +               MAKE will use command.com to execute
  68.                                         the command - you must use this if the
  69.                                         command is non resident and you use
  70.                                         io redirection with < or > or | .
  71.  
  72.         -       A line of the form
  73.  
  74.                 FOOBAR = THIS AND THAT AND MORE OF THOSE
  75.  
  76.                 is a symbol definition line.  Later in the makefile, any line
  77.                 containing $FOOBAR or $(FOOBAR) will have that bit replaced by
  78.                 ' THIS AND THAT AND MORE OF THOSE'.
  79.  
  80.         -       Any other non-blank line is a 'dependency' line.  Dependency
  81.                 lines consist of a filenames, then ':', then the filenames on
  82.                 which the previous ones depend.  If one of the files (call this
  83.                 one the target) to the
  84.                 left of the ':' needs to be made, first all the files to right
  85.                 will be made.  Then if any of the dates on the right is more
  86.                 recent than the target, the howto lines (if any) following this
  87.                 dependency line will be executed.  If there weren't any howto
  88.                 lines, then we try to make the target according to any
  89.                 existing wildcard dependency lines - see the next item.
  90.          
  91.         -       Special allowance is made on MSDOS for the colons which are
  92.                 needed to specify files on other drives, so for example:
  93.                         c:foo.bar : a:fee.ber
  94.                 ought to work as intended.
  95.  
  96.         -       There is a special sort of dependency line which allows for
  97.                 wildcards in the file names.  It looks like this (along with
  98.                 an example howto line) :
  99.  
  100.                 *.obj : *.c
  101.                         msc $*.c ;
  102.  
  103.                 This says that whenever a file of the form *.obj needs to be
  104.                 made, say it's called foo.obj, then provided foo.c can
  105.                 be made, we will make foo.obj by means of the command
  106.  
  107.                         msc foo.c ;
  108.  
  109.                 which on my system, is the way I run the C compiler.
  110.  
  111.  
  112.                         Operation
  113. Syntax:
  114.         make [filename]  [-f makefilename] [-i] [-n] [-s]
  115.  
  116.         -i      means continue even if an error is encountered while executing 
  117.                 a command.
  118.  
  119.         -n      means don't execute the commands, just write the ones that
  120.                 should be executed to the standard output.  This is useful
  121.                 for creating batch files, for  example.
  122.  
  123.         -f      specifies that the following argument is the name of a makefile
  124.                 to be used instead of the default (MAKEFILE).
  125.  
  126.         -s      suppress MAKE echoing commands.  Only text echoed from an
  127.                 invoked program will appear on the screen.
  128.  
  129.         First, MAKE reads all of the makefiles.  It then proceeds through all of
  130. the filename arguments,  'making' each one in turn, unless there are none, in
  131. which case it makes the first item in the makefile.  A file is remade if it is 
  132. out of date with respect to the files it depends on or is non-existent.  Depen-
  133. dencies are processed in a 'tree' fashion,  so that the lowest-order files are 
  134. remade first.
  135.  
  136.         
  137.  
  138.  
  139. remarks:
  140.  
  141.     1    MAKE REQUIRES DOS 2.0 OR HIGHER
  142.  
  143.     2    With a moderate size makefile, the programs executed by MAKE will
  144.          notice that available RAM has decreased by about 40K.
  145.  
  146.