home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / tools / smak / smak.doc < prev    next >
Text File  |  1992-07-03  |  13KB  |  293 lines

  1.  
  2.                                  SMAK
  3.                                  
  4.  
  5. Did you ever try to use one of the big-name MAKE programs, only to find 
  6. yourself facing a steep slope at the front of the learning curve?  I 
  7. know the feeling, so I decided to "make" it easier.
  8.  
  9. Kiss your compile and link headaches goodbye with SMAK, the Simple MAKE 
  10. utility from Martin Systems.
  11.  
  12. So much for the commercial.  Here's the beef.
  13.  
  14. Simple MAKE automates the compile/link process, but keeps it simple.  It 
  15. reads a short, well-defined script which is stored in your source code 
  16. and builds the executable file without further intervention.
  17.  
  18. SMAK is shareware and may be distributed freely as long as the additional 
  19. document files are distributed with it.  Registration is only $25 and 
  20. provides registered owners with the following benefits:
  21.  
  22.     1.  An enhanced version of SMAK, plus free upgrade privileges for
  23.         one year.  Current enhancements include:
  24.           Greater capacity (up to 128 list files).
  25.           Option to check all include files for changes when
  26.             determining a conditional compile.
  27.           Mixed language support with multiple scripts per file.
  28.           Compile and link errors stop the make process.
  29.           (Other enhancements will surely follow.)
  30.     2.  QuickBasic source code for SMAK.
  31.     3.  A $15 discount on Basic Building Blocks (normally $35), our
  32.         library of assembly language routines and QuickBasic subprograms.
  33.         Some BBB routines were crucial in creating SMAK.  They are written
  34.         to be smaller and faster than other high-priced libraries (which I
  35.         cut my teeth on), while providing the same or greater functionality.
  36.         See the file BBB.DOC describing Basic Building Blocks.
  37.  
  38. SMAK is primarily designed to work with Microsoft QuickBasic 2.0 and
  39. above, but it can also make PDS, assembler, and C programs.  It is small
  40. and fast, taking only 12K of disk space and reserving only 26K of RAM when
  41. loaded and running the compiler or linker.  It is also Desqview aware and
  42. will "behave" in a DV window despite using some direct screen writes.
  43.  
  44.  
  45. Syntax for running SMAK is:  [path\]SMAK source[.ext] [options]
  46.  
  47.              where:  source is the source file name that contains
  48.                      the main source code module and the make script
  49.  
  50. If no extension is given for file name, .BAS is assumed.  Options are:
  51.  
  52.              /F    force compile and link of all source files
  53.              /2    pass compiler instructions in Microsoft C format
  54.              /M    have linker generate a MAP file
  55.              /E    assume all source/object files exist somewhere
  56.              /C    compile only
  57.              /L    link only
  58.  
  59.  
  60. The script that SMAK reads may be anywhere in the source file (or in its
  61. own separate file), though near the beginning of the file is best for
  62. fastest processing.  Storing the script in the source file saves disk
  63. space by not creating a separate make file, and also documents all files
  64. needed to create the final EXE file within the main source code module.
  65.  
  66. All lines of the script are commented off with apostrophes.  It looks like
  67. this:
  68.  
  69.  1  'begin make                         'identifies start of script
  70.  2  '  c:\qb45\bc                       'name of compiler program
  71.  3  '  c:\qb45\link /nod /noe           'name of linker with link options
  72.  4  '  begin BAS                        'start of source file list
  73.  5  '    d:\make\smak /o                'main source file & compile options
  74.  6  '    d:\bbb\strip /o                'other source file & compile options
  75.  7  '    d:\bbb\parse /o                'other source file & compile options
  76.  8  '  begin OBJ                        'start of object file list
  77.  9  '    d:\bbb\FileInfo                'object file name
  78. 10  '    d:\bbb\CheckKB                 'many object files may be
  79. 11  '    c:\pdq\_noread                 '  listed here, just like for
  80. 12  '    c:\pdq\_noerror                '  for the BAS source files
  81. 13  '    c:\pdq\_noval                  '(this is a PDQ stub file)
  82. 14  '  begin LIB                        'start of link library file list
  83. 15  '    c:\pdq\pdq                     '  many LIB files may follow
  84. 16  'end make                           'identifies end of script
  85.  
  86.  
  87. Line numbers are added here only as an aide to the detailed explanation
  88. that follows.  Each line would actually start with ' in the source
  89. file.  Any line can contain trailing comments that also begin with an
  90. apostrophe, which SMAK ignores.  SMAK does not change the case of any
  91. line so that case-sensitive parameters may be used (as in C).
  92.  
  93. Line 1 simply identifies the beginning of the MAKE script.
  94.  
  95. Line 2 contains the compiler program name that you would normally need to
  96. type to run your compiler.  It's a good idea to include its drive and
  97. path spec, so DOS won't have to spend time searching through the
  98. directories in your PATH statement.  You may leave the compiler program
  99. name blank, if desired, to perform linking only.
  100.  
  101. Line 3 contains the linker program name that you would normally need to
  102. type to run your linker.  Again, include its drive and path for fastest
  103. loading.  You may leave the linker program name blank, if desired, to
  104. perform compiling only.  Any link options to be used during linking should
  105. follow the linker program name, separated from it by a space.
  106.  
  107. Line 4 identifies the start of the list of source files.  Often there is
  108. only one, but you can have many source files (one per line) in the list.
  109. Each one will be compiled, and their respective object files will be linked 
  110. into the final EXE file.  The BAS specifies the default file extension for 
  111. any files in the list which do not have file extensions.  You can specify 
  112. any other default file extension if desired, like PDS, ASM, C, or PDQ.
  113.  
  114. Line 5 contains the name of the main source code file.  Again, include its 
  115. drive and path for fastest processing and to know where its object file 
  116. will end up residing.  The main source code module should be first in the 
  117. list, since the resulting EXE file will have the same name as the first 
  118. source file.  Compiler options can follow the source code file name, and 
  119. can be different for each source code file.
  120.  
  121. Lines 6 and 7 are additional source modules needed to make the example 
  122. program SMAK.EXE.
  123.  
  124. Line 8 identifies the start of the list of object files.  Often there 
  125. will be none, since all object files created by compiling the source code 
  126. files are automatically passed to the linker.  You can have many object 
  127. files (one per line) in the list.  Each one will be linked into the 
  128. final EXE file.  The OBJ specifies the default file extension for any
  129. files in the list which do not have file extensions, and may be changed.
  130.  
  131. Library files may be included in the object file list, but be aware that 
  132. every routine in that library will be linked into the final EXE file, 
  133. whether it is called or not.  Library files should usually go in the 
  134. library file list.  See the explanation for line 14.
  135.  
  136. Lines 9 through 13 are additional object module file names which were 
  137. NOT created by compiling the source code files listed under "begin BAS" 
  138. but are referenced or needed for a successful link.
  139.  
  140. Line 14 identifies the start of the list of library files.  Often there 
  141. will be none, since the default library file name (like BRUN45.LIB or 
  142. BCOM45.LIB if you used QB's /O compile switch) is usually passed to the
  143. linker in the main object file.  If the correct default LIB file is not 
  144. in your path, or its path is not found in the LIB environment variable, 
  145. you may need to include its complete file spec here.  You can have many 
  146. library files (one per line) in the list.  Library files in this list are 
  147. searched for any missing routines needed to complete the link, and only 
  148. called routines are linked into the final EXE file.   The LIB specifies
  149. the default file extension for any files in the list which do not have
  150. file extensions, and may be changed.
  151.  
  152. Line 15 contains a link library needed in this example to make the
  153. SMAK.EXE program.
  154.  
  155. Line 16 identifies the end of the script.
  156.  
  157.  
  158. The example below shows a simple script needed to create the file
  159. HELLO.EXE from the source code file HELLO.BAS.
  160.  
  161. '===================== Begin program HELLO.BAS ====================
  162.  
  163.   'begin make                          'identifies start of script
  164.   '  c:\qb45\bc                        'name of compiler program
  165.   '  c:\qb45\link                      'name of link program
  166.   '  begin BAS                         'start of source file list
  167.   '    c:\bbb\hello /o                 'main source file & compile options
  168.   'end make                            'identifies end of script
  169.  
  170.  
  171.   print "  HELLO!  (compiled and linked with SMAK, written in QuickBasic 4.5)"
  172.   end
  173.  
  174. '====================== End program HELLO.BAS =====================
  175.  
  176.  
  177. SMAK works with other languages besides QuickBasic, like assembler and C.
  178. See the files SMAK_C.DOC and SMAK_ASM.DOC for more information.
  179.  
  180.  
  181.  
  182. Notes about path specs:
  183.  
  184. SMAK does its work quicker and more accurately if you use complete path
  185. specs for all files in the make directives.  SMAK verifies that each
  186. source or object file exists.  If any files are missing, SMAK will
  187. identify them and terminate before compiling or linking.  Each file's
  188. date/time stamp is also noted for conditional compiling and linking.
  189.  
  190. SMAK checks for files without path specs in the current directory only.
  191. SMAK will not search your PATH or LIB directories for a file.  If you
  192. rely on your compiler or linker to find certain files in those
  193. directories, and you do not specify their paths in the make directives,
  194. you will need to use the /E command line switch when you invoke SMAK.
  195.  
  196. Another advantage of using path specs with your file names is that you 
  197. can run SMAK while in any directory, against a source file in any 
  198. directory, and still have all the files produced by compiling and linking 
  199. end up where they are supposed to be.  I use a simple batch file in my 
  200. path containing F:\MAKE\SMAK %1 %2 %3 %4 to make my programs.
  201.  
  202.  
  203. Notes on command line parameters:
  204.  
  205. The /E parameter tells SMAK to assume that any source or object file it 
  206. cannot find exists anyway.  The compiler and linker are then responsible 
  207. for checking that the file exists.  Conditional compilation of that file 
  208. also becomes the responsibility of the compiler, as well.
  209.  
  210. The /2 parameter passes the compile commands to the compiler (or assembler) 
  211. in the following format:  CompilerName SourceName [options]
  212. The default format is:    CompilerName SourceName, ObjectName [options];
  213.  
  214. The /C parameter tells SMAK to compile only.  No linking occurs.  Note 
  215. that which modules are compiled is still conditional.  Use /C/F to do an
  216. unconditional compile only.
  217.  
  218. The /L parameter tells SMAK to link only.  No compiling occurs.  Note 
  219. that linking is still conditional.  Use /L/F to do an unconditional link
  220. only.
  221.  
  222.  
  223. Miscellaneous notes:
  224.  
  225. Maximum number of file names in the combined source, object, and library 
  226. lists is 32.  The actual number in each list may vary, as long as the 
  227. sum does not exceed 32.  If you need greater capacity, combine object 
  228. files into one or more libraries, or register to receive the enhanced 
  229. version which allows up to 128 files in the combined lists.
  230.  
  231. If you have a list of library files, you must also always have a list of 
  232. object files, even if it is an empty list.  The SMAK program always 
  233. considers the second "begin" to mark the start of the object file list.
  234.  
  235.  
  236.  
  237.  
  238.                         D  I  S  C  L  A  I  M  E  R
  239.  
  240.  
  241. By using this software, you agree to hold harmless Martin Systems for any
  242. resulting loss or damage.  There are no warranties expressed or implied.
  243.  
  244.  
  245.  
  246. ==============================================================================
  247.  
  248.  
  249.  
  250.                            REGISTRATION FORM
  251.  
  252.  
  253.  
  254.     NAME  ______________________________________________
  255.  
  256.  
  257.  ADDRESS  ______________________________________________
  258.  
  259.  
  260.     CITY  _____________________________    STATE  ______    ZIP  _________
  261.  
  262.  
  263.    PHONE  (_______)____________________
  264.  
  265.  
  266.  
  267.  
  268.                                              QTY                   NET
  269.  
  270.     SMAK registration only                 ______  @ $25 each =   ______
  271.  
  272.     Basic Building Blocks only             ______  @ $35 each =   ______
  273.  
  274.     Basic Building Blocks and SMAK (!)     ______  @ $45 each =   ______
  275.  
  276.  
  277.  
  278.          (Prices include US Mail shipping)           TOTAL        ______
  279.  
  280.  
  281.  
  282.    Diskette type:        [  ] 360K        [  ] 720K
  283.  
  284.  
  285.          Send to:  Martin Systems
  286.                    120 Fence Post Court
  287.                    Fountain, CO  80817
  288.  
  289.                    (719) 382-8216  BBS
  290.  
  291.  
  292. ==============================================================================
  293.