home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / uucp / duucp-1.17 / AU-117b-upd3.lha / upd3 / adj / adj.doc < prev    next >
Encoding:
Text File  |  1993-06-09  |  4.9 KB  |  184 lines

  1.  
  2.                          Adj == Adjust DMakefile
  3.  
  4.                                  5/25/93
  5.  
  6.                              Chris Hind Genly
  7.  
  8.                          Eggplant Software Tools
  9.  
  10.                       chris@Eggplant.New-Haven.CT.US
  11.  
  12.  
  13.  
  14. Adj was written to allow Amiga UUCP developers using different compilers
  15. to easily exchange DMakefiles.  It can convert a DMakefile which uses DICE
  16. to a DMakefile which uses SASC, and back again.
  17.  
  18. Adj performs two primary functions.  It translates compiler options, and
  19. it provides conditionals.
  20.  
  21. For adj to work effectively, some simple conventions must be followed.
  22. However, most of the uucp dmakefiles will work with only small changes.
  23.  
  24.  
  25. COMMAND LINE
  26. ------------
  27.  
  28.   adj <switches> [<files>]
  29.  
  30. <files>:
  31.            The names of DMakefiles to adjust.  Default is 'DMakefile'
  32.  
  33. <switches>:
  34.  
  35.   -dice    Adjust the dmakefile so it will use the DICE compiler.
  36.   -sasc    Adjust the dmakefile so it will use SAS compiler.
  37.   -force   Normally when an unrecogized option is encountered in a
  38.            dmakefile, adjustment is aborted, and the dmakefile is
  39.            unchanged.  This option will cause the dmakefile to be changed
  40.            and to throw away the unrecognized option.
  41.  
  42.  
  43. ADJUSTED LINES
  44. --------------
  45.  
  46. Adj will adjust lines starting with the following.  White space
  47. is ignored.
  48.  
  49.     dcc
  50.     sc
  51.     CFLAGS =
  52.     LIBS =
  53.  
  54. Anything following these are considered dcc, or sc options, macro
  55. invocations or file names.  These options will be adjusted for the
  56. requested compiler.
  57.  
  58. When the -sasc switch is given, dcc is converted to sc.  When the -dice
  59. switch is given sc is converted to dcc.
  60.  
  61.  
  62. OPTIONS
  63. -------
  64.  
  65. Here are a list of related dcc and sc options known to adj.
  66.  
  67. For adj to work correctly '-c' must occur on the dcc line, not in the
  68. CFLAGS macro.  'Link' must occur on the sc line, not in the CFLAGS macro.
  69.  
  70. AdjustMakefile does not know about all compiler options.  For example
  71. it does not know dcc's -I0, -L, -L0, -U, -H, -O, or rom options.
  72.  
  73.     sc                 dcc
  74.     ------------       ------------
  75.     AddSymbols         -s
  76.     ANSI                                         // Always added to sc line.
  77.     Code near          -mc
  78.     Code far           -mC
  79.     CPU 68020          -020
  80.     CPU 68030          -030
  81.     Data near          -md
  82.     Data far           -mD
  83.     Define name=val    -D name=val
  84.     IDIR dir           -I dir
  85.     Library file       -l file
  86.     Link               (-c missing)
  87.     Math 68881         -881
  88.     Math 68882         -882
  89.     NoIcons                                      // Always added to sc line.
  90.     ObjectName file    -o file  (-c present)
  91.     ProgramName file   -o file  (-c missing)
  92.     StackExtend        -gs
  93.     Startup=cres       -r
  94.     Verbose            -v
  95.  
  96. CONDITINALS
  97. -----------
  98.  
  99. A conditional starts with the line '#for <compiler>' and ends with
  100. the line '#end'.  <compiler> may be SASC or DICE.
  101.  
  102. The lines between the '#for <compiler>' and '#end' are commented out if
  103. <compiler> does match that designated on the command line.  If it does
  104. match, the lines are uncommented.
  105.  
  106. Here's an example from the DMakefile for the uucp library.
  107.  
  108. #for DICE
  109. $(EXE) : $(OBJS)
  110.     cd $(OD)
  111.     join $(LOBJ1) as ram:j1
  112.     join $(LOBJ2) as ram:j2
  113.     join $(LOBJ3) as ram:j3
  114.     join $(LOBJ4) as ram:j4
  115.     join $(LOBJ5) as ram:j5
  116.     join $(LOBJ6) as ram:j6
  117.     join $(LOBJ7) as ram:j7
  118.     join $(LOBJ8) as ram:j8
  119.     join ram:j1 ram:j2 ram:j3 ram:j4 ram:j5 ram:j6 ram:j7 ram:j8 as %(left)
  120.     delete ram:j1 ram:j2 ram:j3 ram:j4 ram:j5 ram:j6 ram:j7 ram:j8 QUIET
  121.     cd
  122. #end
  123.  
  124. #for SASC
  125. #$(EXE) : $(OBJS)
  126. #    cd $(OD)
  127. #    -delete %(left)
  128. #    echo $(LOBJ1)  >oml_in.tmp
  129. #    echo $(LOBJ2) >>oml_in.tmp
  130. #    echo $(LOBJ3) >>oml_in.tmp
  131. #    echo $(LOBJ4) >>oml_in.tmp
  132. #    echo $(LOBJ5) >>oml_in.tmp
  133. #    echo $(LOBJ6) >>oml_in.tmp
  134. #    echo $(LOBJ7) >>oml_in.tmp
  135. #    echo $(LOBJ8) >>oml_in.tmp
  136. #    oml %(left) r @oml_in.tmp
  137. #    delete oml_in.tmp
  138. #    cd
  139. #end
  140.  
  141. Conventions
  142. -----------
  143.  
  144. 1) Put all compiler options on lines starting with the following.
  145.  
  146.     dcc
  147.     sc
  148.     CFLAGS=
  149.     LIBS =
  150.  
  151. 2) Use the following options on only a dcc line:
  152.         -c
  153.         -o
  154.  
  155. 3) Use the following options only on an sc line:
  156.         Link
  157.         ObjectName
  158.         ProgramName
  159.  
  160. 4) Do not use compiler options adj doesn't understand.
  161.  
  162. 5) Don't use the dcc -L option.  Instead use -l option with a full path
  163.    to the desired library.  The path should include the .lib extension.
  164.  
  165.  
  166.    For example, don't use
  167.  
  168.         LIBS = -L uucp:src/dlib -l uucp
  169.  
  170.    Use
  171.  
  172.        LIBS= -l uucp:src/dlib/uucp.lib
  173.  
  174.    This will correctly translate to the SASC version of
  175.  
  176.        LIBS= Library=uucp:src/dlib/uucp.lib
  177.  
  178.    The reason for this convention is sc does not have the equivalent of
  179.    the dcc -L switch.  The -L switch specifies a directory to search to
  180.    locate a library. However the SASC Library option is very close to the
  181.    DICE -l option.  The Library option requires a full path to the
  182.    library. -l will accept full paths.  So avoid -L and use -l with an
  183.    explicit path.
  184.