home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 594a.lha / imake / imake.doc.pp / imake.doc
Text File  |  1991-12-05  |  7KB  |  265 lines

  1.  
  2.  
  3.  
  4. IMAKE(1)                 USER COMMANDS                   IMAKE(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      imake - C preprocessor interface to the make utility
  10.  
  11. SYNOPSIS
  12.      imake [-Ddefine]  [-Idir]  [-Ttemplate]  [-f  filename]  [-s
  13.      filename] [-e] [-v]
  14.  
  15. DESCRIPTION
  16.      Imake is used to generate Makefiles from a template,  a  set
  17.      of  cpp  macro  functions,  and  a  per-directory input file
  18.      called an Imakefile.  This allows machine dependencies (such
  19.      has  compiler  options, alternate command names, and special
  20.      make rules) to be kept separate from the descriptions of the
  21.      various items to be built.
  22.  
  23. OPTIONS
  24.      The following command line options may be passed to imake:
  25.  
  26.      -Ddefine
  27.              This option is passed directly to cpp.  It is  typi-
  28.              cally used to set directory-specific variables.  For
  29.              example, the X Window System uses this flag  to  set
  30.              TOPDIR  to  the name of the directory containing the
  31.              top of the core distribution and CURDIR to the  name
  32.              of the current directory, relative to the top.
  33.  
  34.      -Idirectory
  35.              This option is passed directly to cpp.  It is  typi-
  36.              cally  used  to  indicate the directory in which the
  37.              imake template and configuration files may be found.
  38.  
  39.      -Ttemplate
  40.              This option specifies the name of  the  master  tem-
  41.              plate  file  (which is usually located in the direc-
  42.              tory specified with -I) used by cpp.  The default is
  43.              Imake.tmpl.
  44.  
  45.      -f filename
  46.              This option specifies the name of the  per-directory
  47.              input file.  The default is Imakefile.
  48.  
  49.      -s filename
  50.              This option specifies the name of the make  descrip-
  51.              tion  file  to  be  generated but make should not be
  52.              invoked.  If the filename is a dash (-), the  output
  53.              is  written  to stdout.  The default is to generate,
  54.              but not execute, a Makefile.
  55.  
  56.      -e      This option indicates the imake should  execute  the
  57.              generated Makefile.  The default is to leave this to
  58.              the user.
  59.  
  60.  
  61.  
  62.  
  63. X Version 11         Last change: Release 4                     1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. IMAKE(1)                 USER COMMANDS                   IMAKE(1)
  71.  
  72.  
  73.  
  74.      -v      This option indicates that imake  should  print  the
  75.              cpp  command  line  that it is using to generate the
  76.              Makefile.
  77.  
  78. HOW IT WORKS
  79.      Imake invokes cpp with any -I or -D flags passed on the com-
  80.      mand line and passes it the following 3 lines:
  81.  
  82.                #define IMAKE_TEMPLATE "Imake.tmpl"
  83.                #define INCLUDE_IMAKEFILE "Imakefile"
  84.                #include IMAKE_TEMPLATE
  85.  
  86.      where Imake.tmpl and Imakefile may be overridden by  the  -T
  87.      and -f command options, respectively.  If the Imakefile con-
  88.      tains any lines beginning with a '#' character that  is  not
  89.      followed  by  a  cpp  directive  (#include, #define, #undef,
  90.      #ifdef, #else, #endif, or #if), imake will make a  temporary
  91.      makefile  in  which  the  '#'  lines  are prepended with the
  92.      string ``/**/'' (so that cpp will copy  the  line  into  the
  93.      Makefile as a comment).
  94.  
  95.      The Imakefile reads  in  file  containing  machine-dependent
  96.      parameters  (specified  as  cpp  symbols),  a  site-specific
  97.      parameters file, a file containing cpp macro  functions  for
  98.      generating  make rules, and finally the Imakefile (specified
  99.      by  INCLUDE_IMAKEFILE)  in  the  current   directory.    The
  100.      Imakefile  uses the macro functions to indicate what targets
  101.      should  be  built;  imake  takes  care  of  generating   the
  102.      appropriate rules.
  103.  
  104.      The rules file (usually named Imake.rules in the  configura-
  105.      tion  directory)  contains  a variety of cpp macro functions
  106.      that are  configured  according  to  the  current  platform.
  107.      Imake  replaces  any occurrences of the string ``@@'' with a
  108.      newline to allow macros that generate more than one line  of
  109.      make rules. For example, the macro
  110.  
  111.      #define program_target(program, objlist)          @@\
  112.      program:        objlist                           @@\
  113.              $(CC) -o $@ objlist $(LDFLAGS)
  114.  
  115.      when called with  program_target(foo,  foo1.o  foo2.o)  will
  116.      expand to
  117.  
  118.      foo:    foo1.o foo2.o
  119.              $(CC) -o $@ foo1.o foo2.o $(LDFLAGS)
  120.  
  121.  
  122.      On systems whose cpp reduces multiple tabs and spaces  to  a
  123.      single  space, imake attempts to put back any necessary tabs
  124.      (make is very picky about the difference  between  tabs  and
  125.      spaces).   For this reason, colons (:) in command lines must
  126.  
  127.  
  128.  
  129. X Version 11         Last change: Release 4                     2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. IMAKE(1)                 USER COMMANDS                   IMAKE(1)
  137.  
  138.  
  139.  
  140.      be preceded by a backslash (\).
  141.  
  142. USE WITH THE X WINDOW SYSTEM
  143.      The X Window System uses imake extensively,  for  both  full
  144.      builds  within  the  source  tree and external software.  As
  145.      mentioned above, two special variables,  TOPDIR  and  CURDIR
  146.      set  to  make  referencing  files  using relative path names
  147.      easier.  For example, the  following  command  is  generated
  148.      automatically  to build the Makefile in the directory lib/X/
  149.      (relative to the top of the sources):
  150.  
  151.              %  ../.././config/imake  -I../.././config \
  152.                      -DTOPDIR=../../. -DCURDIR=./lib/X
  153.  
  154.      When building X programs outside the source tree, a  special
  155.      symbol  UseInstalled  is  defined  and TOPDIR and CURDIR are
  156.      omitted.  If the  configuration  files  have  been  properly
  157.      installed,  the  script  xmkmf(1) may be used to specify the
  158.      proper options:
  159.  
  160.              %  xmkmf
  161.  
  162.      The command make Makefiles can  then  be  used  to  generate
  163.      Makefiles in any subdirectories.
  164.  
  165. FILES
  166.      /usr/tmp/tmp-imake.nnnnnn     temporary input file for cpp
  167.      /usr/tmp/tmp-make.nnnnnn      temporary input file for make
  168.      /lib/cpp                      default C preprocessor
  169.  
  170. SEE ALSO
  171.      make(1)
  172.      S. I. Feldman Make - A Program for Maintaining Computer Pro-
  173.      grams
  174.  
  175. ENVIRONMENT VARIABLES
  176.      The following environment  variables  may  be  set,  however
  177.      their  use is not recommended as they introduce dependencies
  178.      that are not readily apparent when imake is run:
  179.  
  180.      IMAKEINCLUDE
  181.           If defined, this should be a valid include argument for
  182.           the  C  preprocessor.   E.g.  ``-I/usr/include/local''.
  183.           Actually, any valid cpp argument will work here.
  184.  
  185.      IMAKECPP
  186.           If defined, this should be a valid path to a preproces-
  187.           sor  program.   E.g.  ``/usr/local/cpp''.   By default,
  188.           imake will use /lib/cpp.
  189.  
  190.      IMAKEMAKE
  191.           If defined, this should be  a  valid  path  to  a  make
  192.  
  193.  
  194.  
  195. X Version 11         Last change: Release 4                     3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. IMAKE(1)                 USER COMMANDS                   IMAKE(1)
  203.  
  204.  
  205.  
  206.           program.   E.g. ``/usr/local/make''.  By default, imake
  207.           will  use  whatever  make  program   is   found   using
  208.           execvp(3).
  209.  
  210. BUGS
  211.      Comments should be preceded by  ``/**/#''  to  protect  them
  212.      from cpp.
  213.  
  214. AUTHOR
  215.      Todd Brunhoff, Tektronix and MIT Project Athena; Jim Fulton,
  216.      MIT X Consortium
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261. X Version 11         Last change: Release 4                     4
  262.  
  263.  
  264.  
  265.