home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / dev / visualmaker-1.0.lha / VisualMaker-1.0 / doc / VisualMaker.doc < prev    next >
Encoding:
Text File  |  1994-05-26  |  23.5 KB  |  544 lines

  1. ****************************************************************************
  2. *                                                                          *
  3. *  VisualMaker V1.00 (first release, internal V5.3) by David Lübbren       *
  4. *  24-May-1994                                                             *
  5. *                                                                          *
  6. *  Copyright (C) 1994 by David Lübbren. All rights reserved.               *
  7. *                                                                          *
  8. *  Written in C with Dice 2.07.54 and MG3a on an Amiga 500 (accelerated).  *
  9. *                                                                          *
  10. *  David Lübbren                                                           *
  11. *  Leopoldstr. 3                                                           *
  12. *  76133 Karlsruhe                                                         *
  13. *  Germany                                                                 *
  14. *                                                                          *
  15. *                                                                          *
  16. ****************************************************************************
  17.  
  18.                  VisualMaker V1.0 © David Lübbren
  19.  
  20.  
  21.                     
  22.  
  23.                              CONTENTS
  24.  
  25.  
  26.                         I.    Legal Stuff
  27.                         II.   Introduction
  28.                         III.  Usage
  29.                         IV.   Gadgets
  30.                         V.    Local compiler options
  31.                         VI.   Global compiler options
  32.                         VII.  The backpanel
  33.                         VIII. The menues
  34.                         IX.   Using the DMakefile
  35.                         X.    Making Protos
  36.                         XI.   Timer problems
  37.                         XII.  Make primer
  38.  
  39.  
  40.  
  41.  
  42.  
  43.                             I.  LEGAL STUFF
  44.  
  45.  
  46.       VisualMaker is SHAREWARE, and may be distributed in a non-commercial 
  47.       way (you may copy, spread, and use it but don't make money out of it).
  48.  
  49.       If you like VisualMaker and regularly use it, I would appreciate being 
  50.       sent a $10 contribution to the above address.  Contributors will 
  51.       receive the complete copyrighted source in C. 
  52.  
  53.        Suggestions, comments and criticisms are also welcome at the above 
  54.        address. If any problems are encountered, PLEASE report them! 
  55.  
  56.  
  57.                                 DISCLAIMER
  58.  
  59.       DAVID LÜBBREN MAKES NO WARRANTIES EITHER EXPRESSED OR IMPLIED, WITH 
  60.       RESPECT TO THIS SOFTWARE, ITS QUALITY, PERFORMANCE OR FITNESS FOR ANY 
  61.       PARTICULAR PURPOSE.  THIS SOFTWARE IS PROVIDED "AS IS." THE ENTIRE 
  62.       RISK AS TO QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH THE USER.  
  63.       IN NO EVENT WILL DAVID LÜBBREN BE LIABLE FOR DIRECT, INDIRECT, INCI-
  64.       DENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT IN THE 
  65.       SOFTWARE. 
  66.  
  67.  
  68.  
  69.  
  70.                           II. INTRODUCTION
  71.  
  72.       VisualMaker is a 'MakeFile' generator for the DiCe compiler package.
  73.       The program is fully controlled through an Intuition interface and 
  74.       allows compiler options to be set for individual files with just a
  75.       couple of mouse clicks. All compiler options are supported. The gen-
  76.       erated 'DMakefile' includes the basic object->source, executable->
  77.       object dependancies as well as dependancies for all included headers,
  78.       precompiled headers and errorfile deletion prior to a new run. The 
  79.       output format is such that all files with the same options and head-
  80.       ers are arranged in groups and referenced through symbolic names 
  81.       where possible. VisualMaker reads your DCCOPTS environment variable
  82.       and shows them on the GUI. An option is included for setting this
  83.       variable.   
  84.  
  85.       Header dependancies are obtained through scanning of the source files
  86.       recursively, so even deeply nested subheaders are found. Every time a 
  87.       headerfile is edited the corresponding source gets recompiled. If the 
  88.       precompile option is selected, precompiled headers will be deleted if 
  89.       any of their dependancies are altered, thus causing DiCe to precompile 
  90.       anew. If compiler error output is redirected to a file, this errorfile
  91.       will be deleted prior to every new compile run.
  92.       
  93.         Only headers included in double quotes (e.g. #include "defs.h") will
  94.       be searched for (angle brackets should be reserved for system headers).
  95.       Headers included inside of plain C comments (/*...*/) will be ignored,
  96.       nested comments are not supported.
  97.  
  98.         The 'DMakefile' itself includes a list of dependancies and commands
  99.       necessary for creating the executable, the object files, disassembled 
  100.       files, automatic deletion of the Errorfile on startup, and for dele-
  101.       tion of objects and preprocessed files.
  102.  
  103.  
  104.  
  105.                                III. USAGE
  106.  
  107.       Invoke VisualMaker from the directory where you would like the 
  108.       'DMakefile' to be written to.  This is usually the directory 
  109.       containing the brunch of your source files and from where the 
  110.       compiler is started.
  111.       The first thing 'VisualMaker' will do after invocation is to read 
  112.       your DCCOPTS environment variable, if found, and activate the cor-
  113.       responding gadgets to reflect your default settings. 
  114.       Choose all the files for your project with the GetFile Gadget in 
  115.       the upper left corner (underneath the 'Generate' Button). This will 
  116.       bring up an ASL FileRequester. You can multiselect files by simul-
  117.       taneously pressing the SHIFT key. Alternatively you can use the 'A' 
  118.       Button (All) to choose all the files in your current directory in 
  119.       one go. The files will show up in the 'Source List' ListviewGadget. 
  120.       (All files without a '.c', '.a' or '.o' extension will be filtered 
  121.       out, as well as object files which have a corresponding source). 
  122.       To remove files from the list, select them and press the 'R' Button 
  123.       (Remove). Now you can select your compiler options. The options are 
  124.       divided into two classes, the global compiler options, which are 
  125.       located underneath the 'Source List' Listview gadget, apply to all 
  126.       files in your project (e.g. Resident, Small/Large-Data model), and 
  127.       the local compiler option, above the 'Source List' (proto, -H, Stack, 
  128.       NoProf). These may apply to only particular files (e.g. profiling of 
  129.       only the time critical routines) as well as to all files. To turn on 
  130.       local options select the files in question. To select a single file, 
  131.       press the left mousebutton (LMB) over the file name. To select seve-
  132.       ral files, drag the mouse while keeping the LMB pressed. To select 
  133.       (or unselect) files which are momentarily not in the visible region, 
  134.       drag the mouse over the rim of the gadget while keeping the button 
  135.       pressed. Pressing a local option button now will effect the selected 
  136.       files, showing the option behind the file name. For a comprehensive 
  137.       explanation of the individual compiler options see the DiCe documen-
  138.       tation (dcc.doc).
  139.         The Program Name defaults to one of the source filenames in the
  140.       Source List (minus the extension). The name can be easily changed to
  141.       another source filname by selecting that particular file in the Source
  142.       List, or of course by typing it into the string gadget.
  143.         The 'Errorfile' StringGadget specifies the output of compiler
  144.       (Error)messages which is by default STDOUT.
  145.         The 'Output Dir' StringGadget determines where the object files 
  146.       are written to. If not specified they are written into the same di-
  147.       rectory as the source files.
  148.         The 'Temporary Dir' StringGadget specifies the directory for pre-
  149.       processed files.
  150.       
  151.         To generate the 'DMakefile' press the 'Generate' Button. All Files 
  152.       will now be scanned, searching for any included headers in double 
  153.       quotes (e.g. #include "defs.h") and, if found, these will be scanned 
  154.       as well searching for subheaders and so on. Note: headers inside of 
  155.       comments will not be searched. After the file has been written into 
  156.       the current directory the program will exit.
  157.         To leave the program without writing the 'DMakefile', press the
  158.       Close-Window gadget, or select 'Exit' in the menu.
  159.  
  160.       
  161.  
  162.  
  163.                               IV.  GADGETS   
  164.  
  165.     CloseWindow
  166.       terminates the program WITHOUT writing the 'DMakefile'.
  167.  
  168.     Generate
  169.       The 'DMakefile' will be written, and 'VisualMaker' will terminate.
  170.  
  171.     GetFileGadget 
  172.       Pressing the GetFileGadget brings up either a file- or directory
  173.       requester. Some of the Requesters allow  multiselection  by hold- 
  174.       ding down the SHIFT key. After selection, files/directories will 
  175.       be listed in the corresponding listview-gadget.
  176.     
  177.     Source List (ListviewGadget)
  178.       Here all Sourcefiles chosen with the FileRequester or 'A' button 
  179.       are listed. Any '.o' or '.a' files which also have a corresponding 
  180.       '*.c' file will NOT be listed. When a particular file is selected 
  181.       the local compiler options apply to this file. (De-)Selection is 
  182.       simply done by pressing the nouse button over a particular source 
  183.       name. Keeping the button pressed and dragging, allows multiselec-
  184.       tion. The name of the executable is automatically set to the last 
  185.       selected file.
  186.  
  187.     R   (Remove)
  188.       Removes a selected file/Directory/Path from a Listview Gadget.
  189.  
  190.     A   (All)
  191.       This is a convenience button to select all files in the current di-
  192.       rectory, bypassing the filerequester. Only files with a '.c', '.a' 
  193.       or '.o' extension are selected and shown in the listviewgadget. If 
  194.       a source and object file of the same name exist, only the source 
  195.       file will be shown.
  196.  
  197.         e.g.   CURRENT DIR      Source List
  198.              main.c main.o  ->     main.c
  199.              main.a main.o  ->     main.a
  200.              main.o         ->     main.o
  201.  
  202.       In other words, object files will only be shown if they are 'extra 
  203.       objects'.
  204.       
  205.     Program Name
  206.       Name of the executable program. If you select a filename from the
  207.       Source List the extension will automatically be truncated and the
  208.       rest placed into this string gadget. If this mechanism annoys you,
  209.       just simpy type something into this Gadget manualy (a 'RETURN' will
  210.       do) and the name will be "frozen".
  211.       
  212.     Errorfile
  213.       Compiler error messages can be diverted to a particular file instead
  214.       of STDOUT. Useful if you have a means of proccessing these from your
  215.       Editor with say an AREXX-script.
  216.       
  217.     Output Dir
  218.       The Directory where all object files ('.o') will be written to. If 
  219.       not specified, each objectfile will be written into the same direc-
  220.       tory its source resides in.
  221.  
  222.     Temporary Dir
  223.       The Directory where preprocessed files are written to.      
  224.  
  225.  
  226.  
  227.                         V. LOCAL COMPILER OPTIONS
  228.  
  229.     -proto
  230.       Sets the "-proto" compiler option, enabling prototype checking. All 
  231.       functions not prototyped will cause an error during compilation. For 
  232.       the amiga library functions, the corresponding '*_protos.h' files in 
  233.       the 'clib' direrctory have to be included. When compiling with regis-
  234.       tered arguments (-mr/-mR/-mRR) prototyping is mandatory.
  235.       
  236.     -H
  237.       Any header files referenced in the source file with #include "name.h" 
  238.       (NOTICE: Header file in Quotes, NOT angle brackets) will be precom-
  239.       piled and placed into the temporary directory (Default: 'T:') with 
  240.       the name 'name.m'. This can speed up compilation time tremendously. 
  241.         In the DMakefile a dependancy will be created, deleting the pre-
  242.       compiled file whenever the corresponding headerfile or any subheaders 
  243.       included in it are changed causing the compiler to generate a new 
  244.       precompiled file. To precompile system headers e.g. '<stdio.h>' or  
  245.       '<intuition/intuition.h>', just include them in a header- or sub-
  246.       headerfile, not in the source files or replace the angle brackets 
  247.       with double quotes, but you'll probably have to add an absolute path.
  248.       
  249.     Stack/-mr/-mR/-mRR
  250.       Handling of function arguments.
  251.  
  252.       Stack -  allows normal passing of function arguments via the stack.
  253.       -mr   -  cause the compiler to create both a stack and registered 
  254.                argument entry point for functions.
  255.       -mR   -  cause the compiler to generate a single registered argument 
  256.                entry point for each function.
  257.       -mRR  -  as above, but extends registration to indirect function 
  258.                calls.
  259.                              
  260.                The registered argument options switch on prototyping auto-
  261.                matically, as this is mandatory.
  262.  
  263.  
  264.     NoProf/-prof1/-prof2/-prof3
  265.       En-/Disable profiling of either only the source (-prof1), source
  266.       and clib functions (-prof2) or source, clib and amigalib functions
  267.       (-prof3). With the latter two options, objects have to be linked 
  268.       with the corresponding profiling libraries.
  269.  
  270.       
  271.    
  272.                       VI. GLOBAL COMPILER OPTIONS
  273.  
  274.     Resident
  275.       Sets the "-r" compiler option, or if  'No Reloc Hunk' is enabled 
  276.       the "-pr" compiler option. This makes the code resident. 
  277.  
  278.     Dynamic Stack
  279.       Sets the "-gs" compiler option, adding code for automatic stack 
  280.       allocation if stack falls below a certain limit. (I have encountered
  281.       some problems with this option).
  282.  
  283.     No Reloc Hunk
  284.       Sets either "-pi", or "-pr" if 'Resident' is also enabled, causing
  285.       the compiler NOT to generate a relocation hunk.
  286.                 
  287.     Small Data / Large Data
  288.       Sets the "-md" / "-mD" compiler options to create either a small 
  289.       (PC-relative) data model, or a large (absolute) data model.
  290.  
  291.     OS 2.0 / OS 3.0 / OS 1.3
  292.       Sets the "-2.0"/"-3.0"/"-1.3" compiler options, telling the linker
  293.       with which amiga library to link with.
  294.       
  295.     C++ Comments
  296.       Sets the "-//" comiler option, letting the compiler recognize
  297.       C++ style comments.
  298.  
  299.     Verbose
  300.       Sets the "-v" compiler option which will show all 'dcc' commands
  301.       in STDOUT while executing.
  302.         
  303.     68000 / 68020 / 68030
  304.       Sets the "-020"/"-030" options, specifing the processor for which 
  305.       the executable is written. (Default 68000)
  306.       
  307.     Small Code / Large Code
  308.       Sets the "-mc" / "-mC" compiler options for either small code
  309.       (Default) or large code model.
  310.       
  311.     -ms0 / -ms1 / -ms2
  312.       ms0  -  only 'const' data is put in code-hunk.
  313.       ms1  -  string constants are also placed in code-hunk.
  314.       ms2  -  as above, but all external 'const' references use near
  315.               addressing.
  316.  
  317.     -unix
  318.       Objects are linked with the unix libraries.
  319.       
  320.     -chip
  321.       Force all hunks into chip memory.
  322.       
  323.     NoCoPro / -881 / -882
  324.       Tells the compiler to produce floatpoint code for corresponding
  325.       co-processor.
  326.       
  327.     -lm
  328.       Objects are linked with the maths library for floatpoint output
  329.       e.g. printf("%lf", ...). By default this is turned on whenever
  330.       VisualMaker encounters an "%*lf" in the source code. See also
  331.       the menu options.  
  332.  
  333.     -s
  334.       Add symbolic debugging information in the executable.
  335.  
  336.     -I0
  337.       Remove default include paths.
  338.       
  339.     -L0
  340.       Remove default library paths.
  341.  
  342.  
  343.       
  344.                               VII. THE BACKPANEL
  345.  
  346.     As you've probably noticed, you access this second panel of gadgets 
  347.     by pressing the LMB anywhere inside the window outside of gadget
  348.     activation areas. The top row of gadgets activates more esoteric
  349.     options of the compiler and I will not go into these (see dcc.doc).
  350.       The listview gadgets underneath allow you to specify additional
  351.     link libraries, library- and include paths. Their functionality is
  352.     the same as with the 'Source List'.
  353.     
  354.   Link Library
  355.     You may specify additional libraries you want to link your code with.
  356.     Only files with a ".lib" extension are accessible through the library-
  357.     requester. It is generally not necessary to add a particular model of 
  358.     the standard c-, amiga-, or maths-library here since these are auto-
  359.     matically dealt with. 
  360.       (e.g. muis.lib - if you're working on a MUI project).
  361.     
  362.   Library Paths
  363.     Specify additional paths (directories) where the compiler should look
  364.     for libraries if they are not located in the standard DLIB: directory.
  365.     
  366.   Include Paths
  367.     Specify additional paths where the compiler should look for include
  368.     files not found in the standard DINCLUDE: directory. The specified
  369.     path will also be searched by VisualMaker if it can't find one of your
  370.     header files either in the current directory or the one the corres-
  371.     ponding source file is located in. 
  372.  
  373.     
  374.       
  375.                             VIII. THE MENUES    
  376.               
  377.   DCCOPTS
  378.     This will pop up a requester allowing you to save the currently set 
  379.     compiler options in VisualMaker to the DCCOPTS environment variable.
  380.     Three options are available:
  381.       SAVE
  382.         Options are saved permanently in ENVARC:DCCOPTS.
  383.       USE
  384.         Options are saved in ENV:DCCOPTS and will be gone when computer 
  385.         is turned off (provided your ENV: directory is in ram:).
  386.       CANCEL
  387.         Self-explanatory.
  388.         
  389.  
  390.   check %lf
  391.     This option causes VisualMaker to search for any output of float-point 
  392.     numbers in the source code and if found automatically set the "-lm"
  393.     option in the DMakefile which causes the compiler to link with math 
  394.     library enabling output of 'float' and 'double' numbers (if not used
  395.     float numbers are literally ouput as "<float>"). The program does not 
  396.     actually look for a 
  397.  
  398.                     '(s|f|v)printf("%...f")' 
  399.  
  400.     command but rather just the format string 
  401.  
  402.                    "%[0-9.l+-\*]*(E|e|f|F|g|G)",
  403.  
  404.     that is it does not know whether the expression is inside a printf-
  405.     family type of command or just a simple string. The option is on by
  406.     default but if it causes any problems due to the above mentioned,
  407.     just turn it off (the -lm option increases the executable size).
  408.  
  409.   EXIT
  410.     Leave program without writing the DMakefile.        
  411.  
  412.  
  413.  
  414.         
  415.                         IX. USING THE DMAKEFILE
  416.  
  417.     'DMake can be called with several keywords, which determine what
  418.     it does. These are:
  419.  
  420.     DMake all         
  421.      or
  422.     DMake <executable>
  423.         -generates the executable (Program Name), recompiling every-
  424.          thing that's necessary. The previous errofile (if specified 
  425.          in 'VisualMaker') is deleted prior to compilation. Note, if 
  426.          a full pathname was specified for the executable in 
  427.          'VisualMaker' it should also be input here. This is case 
  428.          sensitive.
  429.         
  430.     DMake <file>.o
  431.         -generates only the specified object file. Note, if an
  432.          output directory was given this will have to be included,
  433.          and is also case sensitive.
  434.             e.g.  OUTDIR = dtmp: , OBJ = main.o 
  435.                  ==> DMake dtmp:main.o    and not  DTMP:main.o
  436.         
  437.     DMake <file>.a
  438.         -generates only the specified disassembled file. The same
  439.          applies as above.
  440.                 
  441.     DMake clean
  442.         -deletes all object-, precompiled- and error- files.
  443.  
  444.     DMake cleano
  445.         -only deletes all objectfiles.
  446.  
  447.  
  448.  
  449.  
  450.                          X. MAKING PROTOS
  451.  
  452.     If you want a dependancy for the automatic creation of a prototypes 
  453.     file (e.g. 'protos.h') then create an environment variable called 
  454.     'MAKEPROTO'. Place a string with your 'makeproto' calling format fol-
  455.     lowed by a blank and then the prototype filename.
  456.       Example1: 
  457.         If you use Matt Dillon's 'makeproto' and your prototype file is
  458.         called 'protos.h' use the following command;
  459.  
  460.             Setenv MAKEPROTO "makeproto -o protos.h protos.h"
  461.       
  462.  
  463.       Example2:
  464.         If you use Eric Smith's Public Domain 'mkproto' utility (my choice,
  465.         since it extracts the prototypes directly out of the declared func-
  466.         tions) use the following command:
  467.  
  468.             Setenv MAKEPROTO "mkproto >protos.h protos.h"
  469.             
  470.  
  471.     To make this setting permanent copy 'env:MAKEPROTO' into the 'envarc:'
  472.     directory.
  473.  
  474.  
  475.     
  476.  
  477.                           XI. TIMER PROBLEMS 
  478.  
  479.     DMake uses the time-stamp of the files to determine whether a re-
  480.     compilation is neccessary. If you do not have a clock, or it doesn't
  481.     always function properly (mine sometimes sets itself back to Jan-78)
  482.     in an unlucky case it could happen that a freshly edited dependent
  483.     file has an older time stamp than its target file, causing DMake
  484.     not to resolve the dependency (and your bug-fix or added feature
  485.     not showing up). 
  486.  
  487.        e.g. having the following dependancy,
  488.        
  489.        main.o : main.c
  490.          dcc main.c -o main.o
  491.         
  492.       say the target 'main.o' already exists from a previous session,
  493.       in this session your timer misbehaves (setting itself back to the
  494.       70's) and you edited 'main.c', the new file won't be recompiled.
  495.  
  496.       The solution is either 
  497.         a) to always check and set the timer before starting a session, 
  498.         b) to manually set the date of 'main.c' with 'Date' or 'touch' 
  499.            to something newer than 'main.o', 
  500.         c) just simply by deleting the target 'main.o'.
  501.  
  502.  
  503.  
  504.                             XII. MAKE PRIMER      
  505.  
  506.       Make is a utility program included in all serious compiler-packages 
  507.       that automates the recompilation  process for large programs made up 
  508.       of several  files.  When  making  changes to a particular file only 
  509.       those files which are directly influenced by these changes (i.e. which 
  510.       are dependant ) are recompiled, usually not all of them, which can 
  511.       result in tremendous time savings as well as relieving the programer 
  512.       from the burden of remembering and typing endless lines of compiler 
  513.       commands.   
  514.         Make uses  the file  time-stamp in its considerations. The Make 
  515.       program is driven by a Makefile  which consists of a list of file 
  516.       dependancies and command lines. Consider the following simple example:
  517.       
  518.         main.o : main.c
  519.           dcc -c  main.c -o  main.o
  520.  
  521.       Here 'main.o' (target file) depends on 'main.c' (dependant file). If 
  522.       the dependant file is newer than the target file or the target does 
  523.       not exist, the dependancy is resolved, that is the command below is 
  524.       executed. Several other forms of declaring dependancies are available. 
  525.       Furthermore commands may be AmigaDOS commands such as 'Delete' etc. 
  526.       For details of the syntax see the DMake manual.
  527.       (A feature not documented is the prefixing of commands with a minus
  528.       sign which will inhibit premature termination of DMake if a command
  529.       returns an error or warning). 
  530.       
  531.       Anyway, with VisualMaker you should not have to worry about this!!
  532.       Even if you are just compiling a single file, a DMakefile can still
  533.       be of use. Your particular compiler options are saved and you don't
  534.       have to worry about deleting the 'errorfile' (if redirected) prior
  535.       to a new run (remember, the errors and warnings are always appended).
  536.       
  537.       An option I particularly recommend is the precompilation of header
  538.       files. If you have enough memory, all headers, including the system
  539.       headers (e.g. <intuition/intuition.h>) may be precompiled. Since the
  540.       compiler will then only have to read them ONCE from your diskdrive,
  541.       this saves a lot of time. To do this put all your definitions and 
  542.       (system) include files in one header, say 'defs.h', and reference 
  543.       them with #include "defs.h" from every source file which needs them.
  544.