home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / sozobon / scdoc20 / make.doc < prev    next >
Text File  |  1991-03-03  |  11KB  |  315 lines

  1. This is a public domain 'make' program adapted for use with the Sozobon
  2. C compiler by Tony Andrews. Several new features have been added, and
  3. the default rules are set appropriately for use with the Sozobon compiler.
  4.  
  5. The documentation for the original program is included at the end of
  6. this file.
  7.  
  8. The new features are:
  9.  
  10.  * Make will attempt to use its internal rules if no makefile exists, but
  11.    a target was given on the command line. This means that simple programs
  12.    in a single file can be made without a makefile by typing:
  13.  
  14.     make file.ttp
  15.  
  16.    where 'file.c' is the name of the source file.
  17.  
  18.  
  19.  * Make now uses the PATH variable to find executables automatically and
  20.    looks for all standard suffixes (.tos, .ttp, .prg). Commands in makefiles
  21.    can be given without pathnames and without any suffix.
  22.  
  23.  * The environment is now read, and macros corresponding to the variables
  24.    found are initialized within make. This means that setting the "PATH"
  25.    env. variable causes make to set the macro "PATH" to the value found
  26.    and use that for command searches as described above.
  27.  
  28.    Macros are normally set in the following order:
  29.  
  30.        internal defaults
  31.        environment variables
  32.        makefile assignments
  33.  
  34.    If the -e option is given on the command line, the environment overrides
  35.    assignments in the makefile and the order becomes:
  36.  
  37.        internal defaults
  38.        makefile assignments
  39.        environment variables
  40.  
  41.  * To provide better support for nested makefiles, a '-c' option is provided
  42.    to tell make to change its current directory before running. Upper level
  43.    makefiles can invoke make with -c as in:
  44.  
  45.        make -c subdir1 -f sub1.mk install
  46.  
  47.    In this case, make would 'cd' to 'subdir1' before doing anything.
  48.  
  49.  
  50.  * The default rules should be what you'd expect. To help with running
  51.    'make' from GEM, the PATH macro is initialized by default to something
  52.    reasonable. The complete set of defaults is:
  53.  
  54.  
  55.     .SUFFIXES: .prg .tos .ttp .o .bin .s .c .pas
  56.  
  57.     PATH = \bin,\sozobon\bin
  58.     CC = cc
  59.     CFLAGS =
  60.  
  61.     .c.o:
  62.         $(CC) -c $(CFLAGS) $<
  63.  
  64.     .s.o:
  65.         $(CC) -c $(CFLAGS) $<
  66.  
  67.     .c.s:
  68.         $(CC) -S $(CFLAGS) $<
  69.  
  70.     .c.prg:
  71.         $(CC) $(CFLAGS) $< -o $*.prg
  72.  
  73.     .c.tos:
  74.         $(CC) $(CFLAGS) $< -o $*.tos
  75.  
  76.     .c.ttp:
  77.         $(CC) $(CFLAGS) $< -o $*.ttp
  78.  
  79. What follows is the documentation for the program as I received it.
  80.  
  81. ---------------------------------------------------------------------------
  82.     A full featured Public Domain Make for the Atari STs.
  83.  
  84.     Adapted from mod.sources posting (Volume 7, Issue 71, 1986-12-03)
  85.     by Neil Russell and from Jwahar Bammi's port of Neil Russell's
  86.     original net.sources posting.
  87.     Thanks to both of them, they did most of the work and should
  88.     get all the credit they deserve.
  89.  
  90.     This is not a manual how to use make. For that please refer to any
  91.     UNIX manual, and/or look at the sources and example makefile.
  92.  
  93.     First Neil Russell's read.me from the mod.sources posting.
  94.     ---------------------------------------------------------------------------
  95.     Following is a repost of the public domain 'make' that I posted
  96.     to net.sources a couple of months ago.  I have fixed a few bugs, and
  97.     added some more features, and the resulting changes amounted to
  98.     about as much text as the whole program (hence the repost).
  99.     
  100.     For those that missed the net.sources posting, this is a public domain
  101.     re-implementation of the UNIX make program.  There is no manual included;
  102.     for documentation, refer to a UNIX manual, or the source.
  103.  
  104.     Here is a list of the changes made:
  105.  
  106.     i)    If '-' (ignore) or '@' (silent) where used at the start
  107.         of a command, their effect was not turned off for the following
  108.         commands.
  109.     ii)   A special target (.SUFFIXES, .PRECIOUS) or a rule (.c.o, .a.o),
  110.         if first in the file would be taken as the default target.
  111.         This resulted in error messages like "Don't know how to
  112.         make .c", because things like .SUFFIXES were being made.
  113.         This was further complicated by ---
  114.     iii)  Special target lines with no dependents (ie. .SUFFIXES:\n)
  115.         were not clearing out the existing dependents like
  116.         they should.
  117.     iv)   Default rules could not be redefined because of the error
  118.         checking for commands being defined twice.  Now you are
  119.         allowed to define a target beinging with '.', having
  120.         no dependents with commands.
  121.     v)    The -q option didn't do the time comparison correctly,
  122.         or clear the variable used to keep track of this.  Thus
  123.         it didn't work very well.
  124.     vi)   The syntax ${..} for macro's supported by UNIX make was
  125.         not supported.
  126.     vii)  There wuz a couple of spelling errors.
  127.     viii) When make checked for implicit rules on targets without
  128.         a suffix, there were problems.  (Note: The ~ feature of
  129.         UNIX make wasn't and still isn't supported)
  130.     ix)   The -n option did not print @ lines like it was supposed to.
  131.     x)    :: added.  (See UNIX manual)
  132.     xi)   $? added.  (see UNIX manual)
  133.     ---------------------------------------------------------------------------
  134. Sources:
  135.  
  136.     astat.h        h.h            main.c        rules.c
  137.     check.c        gemstart.s     input.c       make.c
  138.     ststuff.c      decl.h         macro.c       reader.c
  139.     touch.c
  140.  
  141. Alcyon C compile scripts (you only need these the first time around!):
  142.     compile.sh
  143.     link.sh
  144.     lnk
  145.  
  146. Makefile for make and touch:
  147.     makefile  - Alcyon C flavor
  148.  
  149. Touch:
  150.     compiling & linking touch.c will result in a touch program. Touch
  151.     updates the mod. time of a file to present.
  152.     Usage: touch file file ......
  153.  
  154.     #define the symbol MEGAMAX at the top of touch.c is you are
  155.     going to compile touch using the Megamax C compiler.
  156.     (Not tested by me)
  157.  
  158. Atari ST Specific Information:
  159.  
  160.     ATARI SPECIAL MACROS:
  161.  
  162.     Since the Atari ST does not have any standard shell, Jwahar built in
  163.     three macros that are useful:
  164.  
  165.     $(RM)   - removes one or more files, wild cards allowed
  166.     $(CP)   - copies one file to another. NO directories allowed,
  167.               will only accept two arguments, both of which
  168.               must be files. If the destination file exists, it
  169.               will be overwritten.
  170.     $(ECHO) - echo's its arguments.
  171.  
  172.     All Atari special commands internally begin with the character '%'
  173.     and are handled by routines in ststuff.c. It should be trivial to
  174.     add other Atari Special commands if you so desire. All other
  175.     commands are executed using the Pexec gemdos command, so complete
  176.     path names must be used.
  177.  
  178.     CONTINUATION LINES:
  179.  
  180.     The line continuation character is '\'. Back slashes may appear in
  181.     pathname, but NOT at the end of a line, as it will be taken as a
  182.     continuation backslash, and not as a part of the pathname. This should
  183.     not create any big problem as far as i can see.
  184.  
  185.  
  186.     DEFAULT RULES:
  187.  
  188.     See the file RULES.C. Jwahar built in default rules for '.c.o'
  189.     for both Alcyon C and Megamax C. But since both use the same '.o' suffix,
  190.     only one may be built into the version of make that you compile. Which
  191.     version gets built into make depends on the preprocessor symbol
  192.     'MEGRULES'. If this symbol is defined (see H.H) then Megamax rules get
  193.     built in. If it is not, then Alcyon rules get built in. All the rules
  194.     are based on values of macros defined in RULES.C. These macros may be
  195.     redefined in a makefile, and when the default rule is expanded by make
  196.     at runtime, the new redefined values will be used instead.
  197.  
  198.     Default rules may be redefined in a makefile. This was not possible
  199.     in the original version. An other way to redefine the default rules is
  200.     to edit RULES.C and recompile and link. The values I have used in
  201.     RULES.C are relevant for my setup. (1 Mb 520 ST+, 2 double sided
  202.     floppies, no hard disk). You will probably want to edit them for
  203.     your setup.
  204.  
  205.     The default rules in RULES.C are as follows:
  206.  
  207.     .SUFFIXES: .prg .68k .o .bin .s .c .pas
  208.  
  209.     Alcyon C default rules (if MEGRULES is not defined):
  210.  
  211.     # Path to the Alcyon C executables
  212.     CPATH = a:\bin
  213.  
  214.     # C preprocessor
  215.     CP68 = "cp68.prg"
  216.  
  217.     # C preprocessor flags
  218.     CPFLAGS = -i a:\include\
  219.  
  220.     # Pass 1 of the C compiler
  221.     C068 = c068.prg
  222.     # Pass 1 flags 
  223.     C0FLAGS = -f   # change to "" if you want to use IEEE
  224.                    # floating point and libm instead of libf
  225.                    # by Default. Otherwise simply redefine
  226.                    # C0FLAGS in your makefile to get the
  227.                    # IEEE floating option.
  228.  
  229.     # Pass 2 of the C compiler
  230.     C168 = c168.prg
  231.  
  232.     # Pass 2  flags
  233.     C1FLAGS = # not defined
  234.  
  235.     # Assembler
  236.     AS = as68.prg
  237.     # Assembler flags
  238.     ASFLAGS = -l -u -s a:\
  239.  
  240.     .c.o:
  241.         $(CPATH)\$(CP68) $(CPFLAGS) $< $*.i
  242.         $(CPATH)\$(C068) $*.i $*.1 $*.2 $*.3 $(C0FLAGS)
  243.         $(RM) $*.i
  244.         $(CPATH)\$(C168) $*.1 $*.2 $*.s $(C1FLAGS)
  245.         $(RM) $*.1 $*.2
  246.         $(CPATH)\$(AS) $(ASFLAGS) $*.s
  247.         $(RM) $*.s
  248.  
  249.     .s.o:
  250.         $(CPATH)\$(AS) $(ASFLAGS) $<
  251.  
  252.     # Linker of choice
  253.     LINKER = a:\link68.prg
  254.  
  255.     # Relmod
  256.     RELMOD = a:\relmod.prg
  257.  
  258.  
  259.     Megamax C default rules (if MEGRULES is defined):
  260.  
  261.     # Megamax C Rules default
  262.  
  263.     # Path to the Megamax C executables */
  264.     CPATH = a:
  265.  
  266.     # C Compiler
  267.     MMCC = mmcc.ttp
  268.  
  269.     # Code Optimizer
  270.     MMIMP = mmimp.ttp
  271.  
  272.     .c.o:
  273.     $(CPATH)\$(MMCC) $<
  274.     $(CPATH)\$(MMIMP) $*.o
  275.  
  276.     # Linker of choice
  277.     LINKER = $(CPATH)\mmlink.ttp
  278.  
  279.     Jwahar did not define any default '.pas.bin' rule for OSS Pascal, but
  280.     that should be easy to add.
  281.  
  282.  
  283.     How to Compile Make:
  284.  
  285.     Edit the file H.H. If you want to use the Megamax C compiler
  286.     uncomment the line /* #define MEGAMAX */ to define the symbol 'MEGAMAX'.
  287.     You probably have to edit all the sources to define the symbol 'ATARIST'.
  288.     I do not know how to tell mmcc that a preprocessor symbol is defined.
  289.     If you are using the Alcyon C compiler, leave the line commented out.
  290.     Edit the file RULES.C and the symbol 'MEGRULES' in H.H for your taste.
  291.     If you have the Beckemeyer C shell you may use the shell scripts
  292.     compile.sh and link.sh for Alcyon C
  293.  
  294.     If you don't have the microCshell, then you will have to use these scripts
  295.     as guideline.
  296.  
  297.     Once make.prg is made, you can safely throw away all the shell scripts!!
  298.     If you intend to use make from the desktop, rename it to make.ttp.
  299.  
  300.  
  301.     This program is fully in the Public Domain, and you are encouraged
  302.     to distribute copies of the program. Your comments/criticisms/fixes etc.
  303.     will be very much appreciated. I am however not responsible for any bugs
  304.     and/or correctness of behavior of the program. No part of this
  305.     distribution may be used for commercial gains.
  306.  
  307.                 Send your comments to:
  308.  
  309.                 Ton van Overbeek
  310.                 Earn/Bitnet:  tpc862@estec
  311.                      Usenet:  .....!{ucbvax|mcvax}!tpc862%estec.bitnet
  312.                        Arpa:  tpc862%estec.bitnet@wiscvm.wisc.edu
  313.                  CompuServe:  71450,3537
  314.  
  315.