home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / make-ds.lbr / MAKE.MQN / MAKE.MAN
Encoding:
Text File  |  1986-09-04  |  11.5 KB  |  356 lines

  1. MAKE
  2. Version 1.2 6/14/85 Bridger Mitchell
  3. Version 1.0 4/08/85 Neil Maron
  4.  
  5.                     Cover sheet for MAKE.MAN 6/14/85
  6.  
  7. This cover sheet is provided by Neil Maron.  I took a very nice program
  8. that was written by Landon Dyer of Atari Corp.  and converted it to run
  9. under CP/M 80(tm), BDS-C(tm) using DATESTAMPER(tm).  The details follow
  10. in the actual manual provided by Landon but this describes the
  11. BDS-C(tm) modifications.
  12.  
  13. The source files I provide have had all the conditional compilation
  14. removed.  The I/O and externals of BDS-C(tm) are vastly different from
  15. Lattice-C(tm) so I got lazy and just made these sources BDS-C(tm)
  16. specific.  I also added a new macro "~BATCH" to invoke your favorite
  17. batch processor under CP/M(tm) (mine is EX v1.4a).  Now I will go through
  18. the sections of the manual giving the additions or comments:
  19.  
  20.  
  21. DESCRIPTION - 
  22.  
  23. The default makefile is "MAKEFILE.".  I don't search around looking for
  24. one.  Use -f ...  to get to yours if it is on a different user number or
  25. disk.
  26.  
  27. MAKE is the program name used in unix(tm).  It conflicts with an older
  28. CP/M program with the same name that changes the user number of a (set
  29. of) files.  You may want to rename that program MAKEUSER.
  30.  
  31. THE MAKEFILE -
  32.  
  33. I used the backslash (\) as the escape character.  User numbers and
  34. disks may be specified in the dependency files.  I allow two forms:  the
  35. BDS-C(tm) form "u/d:" or the ZCPRx form "dn:".  So a file could be
  36. specified as "file.ext" or "2/c:file.ext" or "c2:file.ext:".
  37.  
  38. I defined a new macro "~BATCH" to allow automatically invoking a batch
  39. processor.  If it is set then it will automatically be started with the
  40. name MAKE$$$$.SUB.  If "-n" is specified it will never be started up.
  41. Example: ~BATCH = 14/c:ex will start up ex on disk c, user 14 if
  42. there is anything required to do.
  43.  
  44. MISCELLANEOUS - 
  45.  
  46. Make should be compiled and loaded under BDS-C(tm) V1.50a if you are
  47. rebuilding it.  Use the "u/d:" form for getting to a different user
  48. number or disk.  If your BDS-C version is not "1.50a", you will also
  49. need to reassemble the CSM modules and double-check the equates to the
  50. run-time library routines.
  51.  
  52. There are three files provided that were not in the original c-source. 
  53. They should be very useful to BDS-C(tm) users of DATESTAMPER(tm).
  54.  
  55. 1. MAKELIB.CSM contains several functions.  One is BDOSDE().  It is like
  56. BDOS() but has one more argument that returns the DE value returned.
  57. This is required when trying to obtain the date of a file.  It is of the
  58. form:
  59.     bdosde(a_input,de_input, *de_returned)
  60.     char a_input;
  61.     int de_input;
  62.     int *de_returned;
  63.  
  64. There are several other functions in MAKLIB.CSM extracted from the
  65. DateStamper Toolkit disk that are provided for getting the current date
  66. and time in BCD or as a formatted ASCII string.  Some of these functions
  67. have been renamed to prevent conflict with the c-function names in MAKE.
  68.  
  69. 2. OSDATE.C.  It will return the date/time of a file. See the source for
  70. details.  It is more general than the similar ASM function in MAKELIB.CSM.
  71.  
  72. 3. ALLOC.CSM is a fast 8080 version of alloc() and free() for bds-c 1.5a.
  73. Because it references the externals in <bdscio.h> it must be assembled
  74. with the base equate set for a specific external address (currently 0x5000).
  75. Or, you can omit it from the link line and use the standard bds-c library
  76. versions.
  77.  
  78. WARNING:  If you re-compile MAKE with different a different external
  79. switch value ("-ennnn") you must either omit alloc.crl from the link
  80. line or reassemble ALLOC.ASM with a new base equate.
  81.  
  82.  
  83. I hope this utility makes having CP/M 80 a lot more fun to have.  Many
  84. thanks to the DATESTAMPER(tm) from Plu*Perfect Systems and Landon Dyer
  85. for doing the "original" MAKE source for MSDOS.
  86.  
  87. (vers 1.2, 6/14/85 by Bridger Mitchell, Plu*Perfect Systems )
  88.  
  89. ========================================================================
  90.           This is the end of the cover sheet.   The  rest  of
  91.           this manual is the original supplied by Landon Dyer.
  92. ========================================================================
  93.  
  94. MAKE(I)                3/10/84                    MAKE(I)
  95.  
  96.  
  97.  
  98. NAME
  99.     MAKE - maintain multiple source files (VAX/VMS and MSDOS 2.0)
  100.  
  101.  
  102. SYNOPSIS
  103.     MAKE [-N] [-A] [-F makefile] [name ...]
  104.  
  105.  
  106. DESCRIPTION
  107.     MAKE is a utility inspired by the Unix(tm) command of the same
  108.     name.  MAKE helps maintain programs that are constructed from
  109.     many files.  MAKE processes a "makefile", a file which describes
  110.     how to build a program from its source files, and produces a
  111.     script file containing the commands necessary to recompile the
  112.     program.
  113.  
  114.     Be careful: this MAKE is NOT compatible with Unix(tm) MAKE!
  115.  
  116.     The 'N' option causes MAKE to print out the steps it would follow
  117.     in order to rebuild the program.  The 'A' option tells MAKE to
  118.     assume that all files are obsolete, and that everything should be
  119.     recompiled.  The 'F' option, followed by a filename, can be used
  120.     to specify a makefile other than the default one.
  121.  
  122.     If no names are specified in the commandline, the first dependency
  123.     in the makefile is examined.  Otherwise, the specified root names
  124.     are brought up to date.
  125.  
  126.     The default makefiles are:
  127.  
  128.         for VAX/VMS:    MAKEFILE
  129.                 [-]MAKEFILE
  130.                 SYS$LOGIN:MAKEFILE
  131.  
  132.         for MSDOS:    MAKEFILE
  133.                 ..\MAKEFILE
  134.  
  135.     If the first makefile cannot be found, MAKE attempts to use the
  136.     next one.  If no makefile is ever found, MAKE prints a diagnostic
  137.     and aborts.
  138.  
  139.  
  140.  
  141. THE MAKEFILE
  142.     Comments begin with '!' and extend to the end of the line.  A
  143.     '!' (or almost any other character) may be escaped with the escape
  144.     character (backslash (\) on VMS, backquote (`) on MSDOS).  An escape
  145.     character may be typed by doubling it (\\ or ``).  The standard
  146.     Unix escape codes are recognized (\n, \r, \t, \b, \f, `n, `r, `t,
  147.     `b and `f).
  148.  
  149.     A makefile is a list of dependencies.  A dependency consists of
  150.     a root name, a colon, and zero or more names of dependent files.
  151.     (The colon MUST be preceeded by whitespace.)  For instance, in:
  152.  
  153.         make.exe : make.obj parsedir.obj file.obj macro.obj mk.h
  154.  
  155.     the file 'make.exe' depends on five other files.  A root name
  156.     with an empty dependency, as in:
  157.  
  158.         print :
  159.  
  160.     is assumed NEVER up to date, and will always be recompiled.
  161.  
  162.     The dependency list may be continued on successive lines:
  163.  
  164.         bigfile.exe : one.obj two.obj three.obj four.obj
  165.         five.obj six.obj gronk.obj freeple.obj scuzzy.lnk
  166.         frog.txt greeble.out
  167.  
  168.     Any number of 'method' lines may follow a dependency.  Method lines
  169.     begin with an ascii tab.  When a file is to be recompiled, MAKE
  170.     copies these method lines (minus the tab) to the script file.
  171.     For example, in:
  172.  
  173.         make.exe : make.obj parsedir.obj file.obj macro.obj mk.h
  174.             $link make, parsedir, file, macro
  175.             $write sys$output "Just another version of MAKE ..."
  176.             $purge
  177.  
  178.     the three lines following the dependency make up the method for
  179.     recompiling (or in this case, re-linking) the file 'make.exe'.
  180.  
  181.  
  182.     If the macro "~INIT" is defined, its text will appear first in the
  183.     script file.  If the macro "~DEINIT" is defined, its text will
  184.     appear last in the script file.  By defining these two macros, it
  185.     is possible to configure the shell enviroment:
  186.  
  187.         ~INIT = $set term/nowrap\n$on error then goto err_handler
  188.         ~DEINIT = $set term/wrap\n$exit\$err_handler:\n
  189.         ~DEINIT = #(~DEINIT)$type err.log\n$exit
  190.  
  191.     will expand (in the script file) to:
  192.  
  193.         $set term/nowrap
  194.         $on error then goto err_handler
  195.         .
  196.         .
  197.         $set term/wrap
  198.         $exit
  199.         $err_handler:
  200.         $type err.log
  201.         $exit
  202.  
  203.     When a root's method is defined, the value of the macro "~BEFORE"
  204.     is prefixed to the method, and the value of the macro "~AFTER" is
  205.     appended to it.
  206.  
  207.     Frequently one wants to maintain more than one program with a single
  208.     makefile.  In this case, a "master dependency" can appear first in
  209.     the file:
  210.  
  211.         allOfMyToolsAndHorribleHacks : cat peek poke.exe grunge
  212.         cat : cat.exe
  213.         cat.exe : ....
  214.             (stuff for CAT.EXE)
  215.         peek : peek.exe
  216.         peek.exe : (stuff for PEEK.EXE)
  217.         poke.exe : (stuff for POKE.EXE)
  218.         grunge : grunge.com
  219.         grunge.com : (stuff for grung)
  220.  
  221.     In other words, make will bring everything up to date that is somehow
  222.     connected to the first dependency (its assumed that the incredibly
  223.     lengthy filename specified in this example won't actually exist).
  224.  
  225.  
  226.  
  227. MACROS
  228.     A macro is defined by a line of the form (the '=' MUST be surrounded
  229.     by whitespace):
  230.  
  231.         <macro-name> = <macro-body>
  232.  
  233.     A macro may be deleted by assigning an empty value to it.  Macros
  234.     may be redefined, but old definitions stay around.  If a macro is
  235.     redefined, and the redefinition is later deleted, the first definition
  236.     will take effect:
  237.  
  238.         MAC = first            ! MAC = "first"
  239.         MAC = second            ! MAC = "second"
  240.         MAC = #(MAC) third        ! MAC = "second third"
  241.         MAC =                ! MAC = "second"
  242.         MAC =                ! MAC = "first"
  243.         MAC =                ! MAC has no definition
  244.  
  245.     A macro may be referenced in two ways:
  246.  
  247.             #<char>      or    #(macro-name)
  248.  
  249.     The first way only works if the macro's name is a single character.
  250.     If the macro's name is longer than one character, it must be
  251.     enclosed in parenthesis.  ['#' may be escaped by doubling it ("##".)]
  252.     For example, in:
  253.  
  254.         G = mk.h mk1.h
  255.         OBJS = make.obj file.obj parsedir.obj macro.obj
  256.         BOTH = #(OBJS) #G
  257.     
  258.         make.exe : #(OBJS) #G
  259.         make.exe : #(BOTH)
  260.         make.exe : mk.h mk1.h make.obj file.obj parsedir.obj macro.obj
  261.             $write sys$output "This is a number sign --> ##"
  262.  
  263.     after macro expansion, the three dependencies will appear identical
  264.     and the two '#'s in the last line will turn into one '#'.
  265.  
  266.  
  267.  
  268. UNIX(tm) MAKE AND THIS ONE
  269.     They are NOT the same.    Do not expect Unix makefiles to work with
  270.     this MAKE, even if you change the pathnames.  There are some major
  271.     differences between this version and the standard Unix(tm) MAKE:
  272.  
  273.     1. The Unix(tm) comment character is '#', VAX/VMS's is '!'.
  274.  
  275.     2. The Unix(tm) macro-expansion character is '$'.  While this would
  276.        have been easy to leave the same, the '$' character is used so
  277.        often in VAX/VMS command-lines that I thought it best to change
  278.        it to '#'.
  279.  
  280.     3. Multiple root names are not allowed.  Unix(tm) MAKE accepts lines
  281.        of the form:
  282.  
  283.         name1 name2 : depend1 depend2
  284.  
  285.        but this one doesn't.
  286.  
  287.     4. There is no equivalent of double-colon ("::".)
  288.  
  289.     5. There is no equivalent of .SUFFIXES, or the corresponding special
  290.        macros.
  291.  
  292.  
  293. SAMPLE MAKEFILE
  294.     !
  295.     ! VAX/VMS MAKE
  296.     ! Landon Dyer
  297.     !
  298.     H = make.h
  299.     FILES = #H, make.c, macro.c, token.c, parsedir.c, file.c
  300.     DOCUMENTATION = distr.mem make.man makefile. make.com
  301.     
  302.     make.exe : make.obj macro.obj token.obj parsedir.obj file.obj
  303.         $link make.obj, macro, token, parsedir, file
  304.         $purge
  305.     
  306.     make.obj : make.c #H
  307.         $cc make.c
  308.     
  309.     macro.obj : macro.c #H
  310.         $cc macro
  311.     
  312.     token.obj : token.c #H
  313.         $cc token
  314.     
  315.     parsedir.obj : parsedir.c #H
  316.         $cc parsedir
  317.     
  318.     file.obj : file.c
  319.         $cc file
  320.     
  321.     !
  322.     ! Print files associated with MAKE
  323.     !
  324.     print :
  325.         $print make.man, #(FILES), make.com, makefile.
  326.     
  327.     !
  328.     ! Type out source to MAKE
  329.     !
  330.     type :
  331.         $type #(FILES), make.com, makefile.
  332.     
  333.     !
  334.     ! Make backup of source files.
  335.     !
  336.     BACKUP = [.bak]
  337.     backup :
  338.         $copy #(FILES) #(BACKUP)
  339.         $copy make.man, make.com, makefile. #(BACKUP)
  340.     
  341.     !
  342.     ! Collect MAKE into a distribution file.
  343.     !
  344.     collect :
  345.         $collect collect distr.mem make.man makefile make.com make.h -
  346.             make.c macro.c token.c parsedir.c file.c
  347.  
  348. AUTHOR
  349.     Landon Dyer            G.DYER@SU-SCORE.ARPA
  350.     175 Calvert Dr. #F-211        BASHFL::DYER (Atari Coinop)
  351.     Cupertino, CA 95014
  352.  
  353.  
  354. = distr.mem make.man makefile. make.com
  355.     
  356.     make.exe :