home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat1 / imake.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  10.4 KB  |  265 lines

  1.  
  2.  
  3.  
  4. IMAKE(1)                         IMAKE(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        imake - C preprocessor interface to the make utility
  9.  
  10. SSYYNNOOPPSSIISS
  11.        iimmaakkee  [ --DD_d_e_f_i_n_e ] [ --II_d_i_r ] [ --TT_t_e_m_p_l_a_t_e ] [ --ff _f_i_l_e_n_a_m_e
  12.        ] [ --CC _f_i_l_e_n_a_m_e ] [ --ss _f_i_l_e_n_a_m_e ] [ --ee ] [ --vv ]
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.        _I_m_a_k_e is used to generate _M_a_k_e_f_i_l_e_s from a template, a set
  16.        of  _c_p_p    macro  functions,  and a per-directory input file
  17.        called an _I_m_a_k_e_f_i_l_e.   This  allows  machine  dependencies
  18.        (such  as  compiler  options, alternate command names, and
  19.        special _m_a_k_e rules) to be kept separate from the     descrip-
  20.        tions of the various items to be built.
  21.  
  22. OOPPTTIIOONNSS
  23.        The following command line options may be passed to _i_m_a_k_e:
  24.  
  25.        --DD_d_e_f_i_n_e
  26.            This option is passed directly to _c_p_p.  It is typ-
  27.            ically  used  to set directory-specific variables.
  28.            For example, the X Window System uses this flag to
  29.            set _T_O_P_D_I_R to the name of the directory containing
  30.            the top of the core distribution and _C_U_R_D_I_R to the
  31.            name  of     the  current  directory, relative to the
  32.            top.
  33.  
  34.        --II_d_i_r_e_c_t_o_r_y
  35.            This option is passed directly to _c_p_p.  It is typ-
  36.            ically used to indicate the directory in which the
  37.            _i_m_a_k_e template  and  configuration  files  may  be
  38.            found.
  39.  
  40.        --TT_t_e_m_p_l_a_t_e
  41.            This  option specifies the name of the master tem-
  42.            plate file (which is usually located in the direc-
  43.            tory  specified with _-_I) used by _c_p_p.  The default
  44.            is _I_m_a_k_e_._t_m_p_l.
  45.  
  46.        --ff _f_i_l_e_n_a_m_e
  47.            This  option  specifies    the  name  of  the   per-
  48.            directory input file.  The default is _I_m_a_k_e_f_i_l_e.
  49.  
  50.        --CC _f_i_l_e_n_a_m_e
  51.            This option specifies the name of the .c file that
  52.            is constructed  in  the    current     directory.   The
  53.            default is _I_m_a_k_e_f_i_l_e_._c.
  54.  
  55.        --ss _f_i_l_e_n_a_m_e
  56.            This   option  specifies     the  name  of    the  _m_a_k_e
  57.            description file to be generated but  _m_a_k_e  should
  58.            not  be    invoked.   If the _f_i_l_e_n_a_m_e is a dash (-),
  59.            the output is written to _s_t_d_o_u_t.     The  default  is
  60.            to generate, but not execute, a _M_a_k_e_f_i_l_e.
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. IMAKE(1)                         IMAKE(1)
  71.  
  72.  
  73.        --ee      This option indicates the _i_m_a_k_e should execute the
  74.            generated _M_a_k_e_f_i_l_e.  The default is to leave  this
  75.            to the user.
  76.  
  77.        --vv      This  option indicates that _i_m_a_k_e should print the
  78.            _c_p_p command line that it is using to generate  the
  79.            _M_a_k_e_f_i_l_e.
  80.  
  81. HHOOWW IITT WWOORRKKSS
  82.        _I_m_a_k_e  invokes  _c_p_p  with any _-_I or _-_D flags passed on the
  83.        command line and passes the name of a file containing  the
  84.        following 3 lines:
  85.  
  86.          #define IMAKE_TEMPLATE "Imake.tmpl"
  87.          #define INCLUDE_IMAKEFILE <Imakefile>
  88.          #include IMAKE_TEMPLATE
  89.  
  90.        where _I_m_a_k_e_._t_m_p_l and _I_m_a_k_e_f_i_l_e may be overridden by the _-_T
  91.        and _-_f command options, respectively.
  92.  
  93.        The IMAKE_TEMPLATE typically reads in  a     file  containing
  94.        machine-dependent parameters (specified as _c_p_p symbols), a
  95.        site-specific parameters file, a file defining  variables,
  96.        a  file containing _c_p_p macro functions for generating _m_a_k_e
  97.        rules,    and   finally    the   _I_m_a_k_e_f_i_l_e      (specified   by
  98.        INCLUDE_IMAKEFILE)  in  the current directory.  The _I_m_a_k_e_-
  99.        _f_i_l_e uses the macro functions  to  indicate  what  targets
  100.        should be built; _i_m_a_k_e takes care of generating the appro-
  101.        priate rules.
  102.  
  103.        _I_m_a_k_e configuration files contain two types of  variables,
  104.        imake  variables     and make variables.  The imake variables
  105.        are interpreted by cpp when _i_m_a_k_e is run.   By  convention
  106.        they  are mixed case.  The make variables are written into
  107.        the _M_a_k_e_f_i_l_e for later interpretation by _m_a_k_e_.  By conven-
  108.        tion make variables are upper case.
  109.  
  110.        The  rules file (usually named _I_m_a_k_e_._r_u_l_e_s in the configu-
  111.        ration directory) contains a variety of    _c_p_p  macro  func-
  112.        tions  that  are configured according to the current plat-
  113.        form.  _I_m_a_k_e replaces any occurrences of the string ``@@''
  114.        with a newline to allow macros that generate more than one
  115.        line of _m_a_k_e rules.  For example, the macro
  116.  
  117.        #define     program_target(program, objlist)     @@\
  118.        program:     objlist                 @@\
  119.          $(CC)    -o  $@    objlist     $(LDFLAGS)
  120.  
  121.        when called with _p_r_o_g_r_a_m___t_a_r_g_e_t_(_f_o_o_, _f_o_o_1_._o  _f_o_o_2_._o_)  will
  122.        expand to
  123.  
  124.        foo:     foo1.o     foo2.o
  125.          $(CC)    -o  $@    foo1.o    foo2.o    $(LDFLAGS)
  126.  
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. IMAKE(1)                         IMAKE(1)
  137.  
  138.  
  139.        _I_m_a_k_e  also replaces any occurrences of the word ``XCOMM''
  140.        with the character ``#'' to permit placing comments in the
  141.        Makefile without causing ``invalid directive'' errors from
  142.        the preprocessor.
  143.  
  144.        Some complex _i_m_a_k_e macros require generated _m_a_k_e variables
  145.        local to each invocation of the macro, often because their
  146.        value depends on parameters passed  to  the  macro.   Such
  147.        variables can be created by using an _i_m_a_k_e variable of the
  148.        form XXVVAARRddeeff_n, where _n is a single digit.  A  unique  _m_a_k_e
  149.        variable     will  be  substituted.     Later occurrences of the
  150.        variable XXVVAARRuussee_n will be replaced by the variable created
  151.        by the corresponding XXVVAARRddeeff_n.
  152.  
  153.        On systems whose _c_p_p reduces multiple tabs and spaces to a
  154.        single space, _i_m_a_k_e attempts to    put  back  any    necessary
  155.        tabs (_m_a_k_e is very picky about the difference between tabs
  156.        and spaces).  For this reason, colons (:) in command lines
  157.        must be preceded by a backslash (\).
  158.  
  159. UUSSEE WWIITTHH TTHHEE XX WWIINNDDOOWW SSYYSSTTEEMM
  160.        The  X Window System uses _i_m_a_k_e extensively, for both full
  161.        builds within the source tree and external  software.   As
  162.        mentioned above, two special variables, _T_O_P_D_I_R and _C_U_R_D_I_R_,
  163.        are set to make    referencing  files  using  relative  path
  164.        names  easier.  For example, the following command is gen-
  165.        erated automatically to build the _M_a_k_e_f_i_l_e in  the  direc-
  166.        tory _l_i_b_/_X_/ (relative to the top of the sources):
  167.  
  168.          %  ../.././config/imake  -I../.././config  \
  169.                -DTOPDIR=../../.      -DCURDIR=./lib/X
  170.  
  171.        When  building  X programs outside the source tree, a spe-
  172.        cial symbol _U_s_e_I_n_s_t_a_l_l_e_d is defined and _T_O_P_D_I_R and  _C_U_R_D_I_R
  173.        are  omitted.   If the configuration files have been prop-
  174.        erly installed, the script _x_m_k_m_f(1) may be used.
  175.  
  176. IINNPPUUTT FFIILLEESS
  177.        Here is a summary of the files read by _i_m_a_k_e as used by X.
  178.        The indentation shows what files include what other files.
  179.  
  180.        Imake.tmpl             generic variables
  181.            site.def             site-specific, BeforeVendorCF defined
  182.            *.cf             machine-specific
  183.            *Lib.rules         shared library rules
  184.            site.def             site-specific, AfterVendorCF defined
  185.            Imake.rules         rules
  186.            Project.tmpl         X-specific variables
  187.            *Lib.tmpl         shared library variables
  188.            Imakefile
  189.            Library.tmpl         library rules
  190.            Server.tmpl         server rules
  191.            Threads.tmpl         multi-threaded rules
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. IMAKE(1)                         IMAKE(1)
  203.  
  204.  
  205.        Note that _s_i_t_e_._d_e_f gets included twice,    once  before  the
  206.        _*_._c_f  file  and once after.  Although most site customiza-
  207.        tions should be specified after the _*_._c_f file, some,  such
  208.        as  the    choice    of compiler, need to be specified before,
  209.        because other variable settings may depend on them.
  210.  
  211.        The  first  time     _s_i_t_e_._d_e_f  is  included,   the     variable
  212.        BeforeVendorCF  is defined, and the second time, the vari-
  213.        able AfterVendorCF  is  defined.      All  code  in     _s_i_t_e_._d_e_f
  214.        should be inside an #ifdef for one of these symbols.
  215.  
  216. FFIILLEESS
  217.        Imakefile.c             temporary input file for cpp
  218.        /tmp/Imf.XXXXXX             temporary Makefile for -s
  219.        /tmp/IIf.XXXXXX             temporary Imakefile if spec-
  220.        ified Imakefile uses # comments
  221.        /lib/cpp                 default C preprocessor
  222.  
  223. SSEEEE AALLSSOO
  224.        make(1), xmkmf(1)
  225.        S.  I. Feldman, _M_a_k_e _-_- _A _P_r_o_g_r_a_m _f_o_r _M_a_i_n_t_a_i_n_i_n_g _C_o_m_p_u_t_e_r
  226.        _P_r_o_g_r_a_m_s
  227.  
  228. EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
  229.        The following environment variables may    be  set,  however
  230.        their  use  is not recommended as they introduce dependen-
  231.        cies that are not readily apparent when _i_m_a_k_e is run:
  232.  
  233.        IIMMAAKKEEIINNCCLLUUDDEE
  234.         If defined, this specifies a ``-I'' include     argument
  235.         to      pass      to    the    C   preprocessor.    E.g.,
  236.         ``-I/usr/X11/config''.
  237.  
  238.        IIMMAAKKEECCPPPP
  239.         If defined, this should be a valid path to a  prepro-
  240.         cessor   program.     E.g.,     ``/usr/local/cpp''.   By
  241.         default, _i_m_a_k_e will use /lib/cpp.
  242.  
  243.        IIMMAAKKEEMMAAKKEE
  244.         If defined, this should be a valid    path  to  a  make
  245.         program,  such  as    ``/usr/local/make''.  By default,
  246.         _i_m_a_k_e will use whatever _m_a_k_e program is  found  using
  247.         _e_x_e_c_v_p_(_3_)_.     This variable is only used if the ``-e''
  248.         option is specified.
  249.  
  250. AAUUTTHHOORR
  251.        Todd Brunhoff, Tektronix and MIT Project Athena; Jim  Ful-
  252.        ton, MIT X Consortium
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.