home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / gnu / info / make.info-7 (.txt) < prev    next >
GNU Info File  |  1994-11-12  |  26KB  |  595 lines

  1. This is Info file make.info, produced by Makeinfo-1.55 from the input
  2. file ./make.texinfo.
  3.    This file documents the GNU Make utility, which determines
  4. automatically which pieces of a large program need to be recompiled,
  5. and issues the commands to recompile them.
  6.    This is Edition 0.47, last updated 1 November 1994, of `The GNU Make
  7. Manual', for `make', Version 3.72 Beta.
  8.    Copyright (C) 1988, '89, '90, '91, '92, '93, '94 Free Software
  9. Foundation, Inc.
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.    Permission is granted to copy and distribute modified versions of
  14. this manual under the conditions for verbatim copying, provided that
  15. the entire resulting derived work is distributed under the terms of a
  16. permission notice identical to this one.
  17.    Permission is granted to copy and distribute translations of this
  18. manual into another language, under the above conditions for modified
  19. versions, except that this permission notice may be stated in a
  20. translation approved by the Free Software Foundation.
  21. File: make.info,  Node: Directory Variables,  Prev: Command Variables,  Up: Makefile Conventions
  22. Variables for Installation Directories
  23. ======================================
  24.    Installation directories should always be named by variables, so it
  25. is easy to install in a nonstandard place.  The standard names for these
  26. variables are as follows.
  27.    These two variables set the root for the installation.  All the other
  28. installation directories should be subdirectories of one of these two,
  29. and nothing should be directly installed into these two directories.
  30. `prefix'
  31.      A prefix used in constructing the default values of the variables
  32.      listed below.  The default value of `prefix' should be `/usr/local'
  33.      (at least for now).
  34. `exec_prefix'
  35.      A prefix used in constructing the default values of some of the
  36.      variables listed below.  The default value of `exec_prefix' should
  37.      be `$(prefix)'.
  38.      Generally, `$(exec_prefix)' is used for directories that contain
  39.      machine-specific files (such as executables and subroutine
  40.      libraries), while `$(prefix)' is used directly for other
  41.      directories.
  42.    Executable programs are installed in one of the following
  43. directories.
  44. `bindir'
  45.      The directory for installing executable programs that users can
  46.      run.  This should normally be `/usr/local/bin', but write it as
  47.      `$(exec_prefix)/bin'.
  48. `sbindir'
  49.      The directory for installing executable programs that can be run
  50.      from the shell, but are only generally useful to system
  51.      administrators.  This should normally be `/usr/local/sbin', but
  52.      write it as `$(exec_prefix)/sbin'.
  53. `libexecdir'
  54.      The directory for installing executable programs to be run by other
  55.      programs rather than by users.  This directory should normally be
  56.      `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'.
  57.    Data files used by the program during its execution are divided into
  58. categories in two ways.
  59.    * Some files are normally modified by programs; others are never
  60.      normally modified (though users may edit some of these).
  61.    * Some files are architecture-independent and can be shared by all
  62.      machines at a site; some are architecture-dependent and can be
  63.      shared only by machines of the same kind and operating system;
  64.      others may never be shared between two machines.
  65.    This makes for six different possibilities.  However, we want to
  66. discourage the use of architecture-dependent files, aside from of object
  67. files and libraries.  It is much cleaner to make other data files
  68. architecture-independent, and it is generally not hard.
  69.    Therefore, here are the variables makefiles should use to specify
  70. directories:
  71. `datadir'
  72.      The directory for installing read-only architecture independent
  73.      data files.  This should normally be `/usr/local/share', but write
  74.      it as `$(prefix)/share'.  As a special exception, see `$(infodir)'
  75.      and `$(includedir)' below.
  76. `sysconfdir'
  77.      The directory for installing read-only data files that pertain to a
  78.      single machine-that is to say, files for configuring a host.
  79.      Mailer and network configuration files, `/etc/passwd', and so
  80.      forth belong here.  All the files in this directory should be
  81.      ordinary ASCII text files.  This directory should normally be
  82.      `/usr/local/etc', but write it as `$(prefix)/etc'.
  83.      Do not install executables in this directory (they probably belong
  84.      in `$(libexecdir)' or `$(sbindir))'.  Also do not install files
  85.      that are modified in the normal course of their use (programs
  86.      whose purpose is to change the configuration of the system
  87.      excluded).  Those probably belong in `$(localstatedir)'.
  88. `sharedstatedir'
  89.      The directory for installing architecture-independent data files
  90.      which the programs modify while they run.  This should normally be
  91.      `/usr/local/com', but write it as `$(prefix)/com'.
  92. `localstatedir'
  93.      The directory for installing data files which the programs modify
  94.      while they run, and that pertain to one specific machine.  Users
  95.      should never need to modify files in this directory to configure
  96.      the package's operation; put such configuration information in
  97.      separate files that go in `datadir' or `$(sysconfdir)'.
  98.      `$(localstatedir)' should normally be `/usr/local/var', but write
  99.      it as `$(prefix)/var'.
  100. `libdir'
  101.      The directory for object files and libraries of object code.  Do
  102.      not install executables here, they probably belong in
  103.      `$(libexecdir)' instead.  The value of `libdir' should normally be
  104.      `/usr/local/lib', but write it as `$(exec_prefix)/lib'.
  105. `infodir'
  106.      The directory for installing the Info files for this package.  By
  107.      default, it should be `/usr/local/info', but it should be written
  108.      as `$(prefix)/info'.
  109. `includedir'
  110.      The directory for installing header files to be included by user
  111.      programs with the C `#include' preprocessor directive.  This
  112.      should normally be `/usr/local/include', but write it as
  113.      `$(prefix)/include'.
  114.      Most compilers other than GCC do not look for header files in
  115.      `/usr/local/include'.  So installing the header files this way is
  116.      only useful with GCC.  Sometimes this is not a problem because some
  117.      libraries are only really intended to work with GCC.  But some
  118.      libraries are intended to work with other compilers.  They should
  119.      install their header files in two places, one specified by
  120.      `includedir' and one specified by `oldincludedir'.
  121. `oldincludedir'
  122.      The directory for installing `#include' header files for use with
  123.      compilers other than GCC.  This should normally be `/usr/include'.
  124.      The Makefile commands should check whether the value of
  125.      `oldincludedir' is empty.  If it is, they should not try to use
  126.      it; they should cancel the second installation of the header files.
  127.      A package should not replace an existing header in this directory
  128.      unless the header came from the same package.  Thus, if your Foo
  129.      package provides a header file `foo.h', then it should install the
  130.      header file in the `oldincludedir' directory if either (1) there
  131.      is no `foo.h' there or (2) the `foo.h' that exists came from the
  132.      Foo package.
  133.      To tell whether `foo.h' came from the Foo package, put a magic
  134.      string in the file--part of a comment--and grep for that string.
  135.    Unix-style man pages are installed in one of the following:
  136. `mandir'
  137.      The directory for installing the man pages (if any) for this
  138.      package.  It should include the suffix for the proper section of
  139.      the manual--usually `1' for a utility.  It will normally be
  140.      `/usr/local/man/man1', but you should write it as
  141.      `$(prefix)/man/man1'.
  142. `man1dir'
  143.      The directory for installing section 1 man pages.
  144. `man2dir'
  145.      The directory for installing section 2 man pages.
  146. `...'
  147.      Use these names instead of `mandir' if the package needs to
  148.      install man pages in more than one section of the manual.
  149.      *Don't make the primary documentation for any GNU software be a
  150.      man page.  Write a manual in Texinfo instead.  Man pages are just
  151.      for the sake of people running GNU software on Unix, which is a
  152.      secondary application only.*
  153. `manext'
  154.      The file name extension for the installed man page.  This should
  155.      contain a period followed by the appropriate digit; it should
  156.      normally be `.1'.
  157. `man1ext'
  158.      The file name extension for installed section 1 man pages.
  159. `man2ext'
  160.      The file name extension for installed section 2 man pages.
  161. `...'
  162.      Use these names instead of `manext' if the package needs to
  163.      install man pages in more than one section of the manual.
  164.    And finally, you should set the following variable:
  165. `srcdir'
  166.      The directory for the sources being compiled.  The value of this
  167.      variable is normally inserted by the `configure' shell script.
  168.    For example:
  169.      # Common prefix for installation directories.
  170.      # NOTE: This directory must exist when you start the install.
  171.      prefix = /usr/local
  172.      exec_prefix = $(prefix)
  173.      # Where to put the executable for the command `gcc'.
  174.      bindir = $(exec_prefix)/bin
  175.      # Where to put the directories used by the compiler.
  176.      libexecdir = $(exec_prefix)/libexec
  177.      # Where to put the Info files.
  178.      infodir = $(prefix)/info
  179.    If your program installs a large number of files into one of the
  180. standard user-specified directories, it might be useful to group them
  181. into a subdirectory particular to that program.  If you do this, you
  182. should write the `install' rule to create these subdirectories.
  183.    Do not expect the user to include the subdirectory name in the value
  184. of any of the variables listed above.  The idea of having a uniform set
  185. of variable names for installation directories is to enable the user to
  186. specify the exact same values for several different GNU packages.  In
  187. order for this to be useful, all the packages must be designed so that
  188. they will work sensibly when the user does so.
  189. File: make.info,  Node: Quick Reference,  Next: Complex Makefile,  Prev: Makefile Conventions,  Up: Top
  190. Quick Reference
  191. ***************
  192.    This appendix summarizes the directives, text manipulation functions,
  193. and special variables which GNU `make' understands.  *Note Special
  194. Targets::, *Note Catalogue of Implicit Rules: Catalogue of Rules, and
  195. *Note Summary of Options: Options Summary, for other summaries.
  196.    Here is a summary of the directives GNU `make' recognizes:
  197. `define VARIABLE'
  198. `endef'
  199.      Define a multi-line, recursively-expanded variable.
  200.      *Note Sequences::.
  201. `ifdef VARIABLE'
  202. `ifndef VARIABLE'
  203. `ifeq (A,B)'
  204. `ifeq "A" "B"'
  205. `ifeq 'A' 'B''
  206. `ifneq (A,B)'
  207. `ifneq "A" "B"'
  208. `ifneq 'A' 'B''
  209. `else'
  210. `endif'
  211.      Conditionally evaluate part of the makefile.
  212.      *Note Conditionals::.
  213. `include FILE'
  214.      Include another makefile.
  215.      *Note Including Other Makefiles: Include.
  216. `override VARIABLE = VALUE'
  217. `override VARIABLE := VALUE'
  218. `override VARIABLE += VALUE'
  219. `override define VARIABLE'
  220. `endef'
  221.      Define a variable, overriding any previous definition, even one
  222.      from the command line.
  223.      *Note The `override' Directive: Override Directive.
  224. `export'
  225.      Tell `make' to export all variables to child processes by default.
  226.      *Note Communicating Variables to a Sub-`make': Variables/Recursion.
  227. `export VARIABLE'
  228. `export VARIABLE = VALUE'
  229. `export VARIABLE := VALUE'
  230. `export VARIABLE += VALUE'
  231. `unexport VARIABLE'
  232.      Tell `make' whether or not to export a particular variable to child
  233.      processes.
  234.      *Note Communicating Variables to a Sub-`make': Variables/Recursion.
  235. `vpath PATTERN PATH'
  236.      Specify a search path for files matching a `%' pattern.
  237.      *Note The `vpath' Directive: Selective Search.
  238. `vpath PATTERN'
  239.      Remove all search paths previously specified for PATTERN.
  240. `vpath'
  241.      Remove all search paths previously specified in any `vpath'
  242.      directive.
  243.    Here is a summary of the text manipulation functions (*note
  244. Functions::.):
  245. `$(subst FROM,TO,TEXT)'
  246.      Replace FROM with TO in TEXT.
  247.      *Note Functions for String Substitution and Analysis: Text
  248.      Functions.
  249. `$(patsubst PATTERN,REPLACEMENT,TEXT)'
  250.      Replace words matching PATTERN with REPLACEMENT in TEXT.
  251.      *Note Functions for String Substitution and Analysis: Text
  252.      Functions.
  253. `$(strip STRING)'
  254.      Remove excess whitespace characters from STRING.
  255.      *Note Functions for String Substitution and Analysis: Text
  256.      Functions.
  257. `$(findstring FIND,TEXT)'
  258.      Locate FIND in TEXT.
  259.      *Note Functions for String Substitution and Analysis: Text
  260.      Functions.
  261. `$(filter PATTERN...,TEXT)'
  262.      Select words in TEXT that match one of the PATTERN words.
  263.      *Note Functions for String Substitution and Analysis: Text
  264.      Functions.
  265. `$(filter-out PATTERN...,TEXT)'
  266.      Select words in TEXT that *do not* match any of the PATTERN words.
  267.      *Note Functions for String Substitution and Analysis: Text
  268.      Functions.
  269. `$(sort LIST)'
  270.      Sort the words in LIST lexicographically, removing duplicates.
  271.      *Note Functions for String Substitution and Analysis: Text
  272.      Functions.
  273. `$(dir NAMES...)'
  274.      Extract the directory part of each file name.
  275.      *Note Functions for File Names: Filename Functions.
  276. `$(notdir NAMES...)'
  277.      Extract the non-directory part of each file name.
  278.      *Note Functions for File Names: Filename Functions.
  279. `$(suffix NAMES...)'
  280.      Extract the suffix (the last `.' and following characters) of each
  281.      file name.
  282.      *Note Functions for File Names: Filename Functions.
  283. `$(basename NAMES...)'
  284.      Extract the base name (name without suffix) of each file name.
  285.      *Note Functions for File Names: Filename Functions.
  286. `$(addsuffix SUFFIX,NAMES...)'
  287.      Append SUFFIX to each word in NAMES.
  288.      *Note Functions for File Names: Filename Functions.
  289. `$(addprefix PREFIX,NAMES...)'
  290.      Prepend PREFIX to each word in NAMES.
  291.      *Note Functions for File Names: Filename Functions.
  292. `$(join LIST1,LIST2)'
  293.      Join two parallel lists of words.
  294.      *Note Functions for File Names: Filename Functions.
  295. `$(word N,TEXT)'
  296.      Extract the Nth word (one-origin) of TEXT.
  297.      *Note Functions for File Names: Filename Functions.
  298. `$(words TEXT)'
  299.      Count the number of words in TEXT.
  300.      *Note Functions for File Names: Filename Functions.
  301. `$(firstword NAMES...)'
  302.      Extract the first word of NAMES.
  303.      *Note Functions for File Names: Filename Functions.
  304. `$(wildcard PATTERN...)'
  305.      Find file names matching a shell file name pattern (*not* a `%'
  306.      pattern).
  307.      *Note The Function `wildcard': Wildcard Function.
  308. `$(shell COMMAND)'
  309.      Execute a shell command and return its output.
  310.      *Note The `shell' Function: Shell Function.
  311. `$(origin VARIABLE)'
  312.      Return a string describing how the `make' variable VARIABLE was
  313.      defined.
  314.      *Note The `origin' Function: Origin Function.
  315. `$(foreach VAR,WORDS,TEXT)'
  316.      Evaluate TEXT with VAR bound to each word in WORDS, and
  317.      concatenate the results.
  318.      *Note The `foreach' Function: Foreach Function.
  319.    Here is a summary of the automatic variables.  *Note Automatic
  320. Variables: Automatic, for full information.
  321.      The file name of the target.
  322.      The target member name, when the target is an archive member.
  323.      The name of the first dependency.
  324.      The names of all the dependencies that are newer than the target,
  325.      with spaces between them.  For dependencies which are archive
  326.      members, only the member named is used (*note Archives::.).
  327.      The names of all the dependencies, with spaces between them.  For
  328.      dependencies which are archive members, only the member named is
  329.      used (*note Archives::.).  The value of `$^' omits duplicate
  330.      dependencies, while `$+' retains them and preserves their order.
  331.      The stem with which an implicit rule matches (*note How Patterns
  332.      Match: Pattern Match.).
  333. `$(@D)'
  334. `$(@F)'
  335.      The directory part and the file-within-directory part of `$@'.
  336. `$(*D)'
  337. `$(*F)'
  338.      The directory part and the file-within-directory part of `$*'.
  339. `$(%D)'
  340. `$(%F)'
  341.      The directory part and the file-within-directory part of `$%'.
  342. `$(<D)'
  343. `$(<F)'
  344.      The directory part and the file-within-directory part of `$<'.
  345. `$(^D)'
  346. `$(^F)'
  347.      The directory part and the file-within-directory part of `$^'.
  348. `$(+D)'
  349. `$(+F)'
  350.      The directory part and the file-within-directory part of `$+'.
  351. `$(?D)'
  352. `$(?F)'
  353.      The directory part and the file-within-directory part of `$?'.
  354.    These variables are used specially by GNU `make':
  355. `MAKEFILES'
  356.      Makefiles to be read on every invocation of `make'.
  357.      *Note The Variable `MAKEFILES': MAKEFILES Variable.
  358. `VPATH'
  359.      Directory search path for files not found in the current directory.
  360.      *Note `VPATH' Search Path for All Dependencies: General Search.
  361. `SHELL'
  362.      The name of the system default command interpreter, usually
  363.      `/bin/sh'.  You can set `SHELL' in the makefile to change the
  364.      shell used to run commands.  *Note Command Execution: Execution.
  365. `MAKE'
  366.      The name with which `make' was invoked.  Using this variable in
  367.      commands has special meaning.  *Note How the `MAKE' Variable
  368.      Works: MAKE Variable.
  369. `MAKELEVEL'
  370.      The number of levels of recursion (sub-`make's).
  371.      *Note Variables/Recursion::.
  372. `MAKEFLAGS'
  373.      The flags given to `make'.  You can set this in the environment or
  374.      a makefile to set flags.
  375.      *Note Communicating Options to a Sub-`make': Options/Recursion.
  376. `SUFFIXES'
  377.      The default list of suffixes before `make' reads any makefiles.
  378. File: make.info,  Node: Complex Makefile,  Next: Concept Index,  Prev: Quick Reference,  Up: Top
  379. Complex Makefile Example
  380. ************************
  381.    Here is the makefile for the GNU `tar' program.  This is a
  382. moderately complex makefile.
  383.    Because it is the first target, the default goal is `all'.  An
  384. interesting feature of this makefile is that `testpad.h' is a source
  385. file automatically created by the `testpad' program, itself compiled
  386. from `testpad.c'.
  387.    If you type `make' or `make all', then `make' creates the `tar'
  388. executable, the `rmt' daemon that provides remote tape access, and the
  389. `tar.info' Info file.
  390.    If you type `make install', then `make' not only creates `tar',
  391. `rmt', and `tar.info', but also installs them.
  392.    If you type `make clean', then `make' removes the `.o' files, and
  393. the `tar', `rmt', `testpad', `testpad.h', and `core' files.
  394.    If you type `make distclean', then `make' not only removes the same
  395. files as does `make clean' but also the `TAGS', `Makefile', and
  396. `config.status' files.  (Although it is not evident, this makefile (and
  397. `config.status') is generated by the user with the `configure' program,
  398. which is provided in the `tar' distribution, but is not shown here.)
  399.    If you type `make realclean', then `make' removes the same files as
  400. does `make distclean' and also removes the Info files generated from
  401. `tar.texinfo'.
  402.    In addition, there are targets `shar' and `dist' that create
  403. distribution kits.
  404.      # Generated automatically from Makefile.in by configure.
  405.      # Un*x Makefile for GNU tar program.
  406.      # Copyright (C) 1991 Free Software Foundation, Inc.
  407.      
  408.      # This program is free software; you can redistribute
  409.      # it and/or modify it under the terms of the GNU
  410.      # General Public License ...
  411.      ...
  412.      ...
  413.      
  414.      SHELL = /bin/sh
  415.      
  416.      #### Start of system configuration section. ####
  417.      
  418.      srcdir = .
  419.      
  420.      # If you use gcc, you should either run the
  421.      # fixincludes script that comes with it or else use
  422.      # gcc with the -traditional option.  Otherwise ioctl
  423.      # calls will be compiled incorrectly on some systems.
  424.      CC = gcc -O
  425.      YACC = bison -y
  426.      INSTALL = /usr/local/bin/install -c
  427.      INSTALLDATA = /usr/local/bin/install -c -m 644
  428.      
  429.      # Things you might add to DEFS:
  430.      # -DSTDC_HEADERS        If you have ANSI C headers and
  431.      #                       libraries.
  432.      # -DPOSIX               If you have POSIX.1 headers and
  433.      #                       libraries.
  434.      # -DBSD42               If you have sys/dir.h (unless
  435.      #                       you use -DPOSIX), sys/file.h,
  436.      #                       and st_blocks in `struct stat'.
  437.      # -DUSG                 If you have System V/ANSI C
  438.      #                       string and memory functions
  439.      #                       and headers, sys/sysmacros.h,
  440.      #                       fcntl.h, getcwd, no valloc,
  441.      #                       and ndir.h (unless
  442.      #                       you use -DDIRENT).
  443.      # -DNO_MEMORY_H         If USG or STDC_HEADERS but do not
  444.      #                       include memory.h.
  445.      # -DDIRENT              If USG and you have dirent.h
  446.      #                       instead of ndir.h.
  447.      # -DSIGTYPE=int         If your signal handlers
  448.      #                       return int, not void.
  449.      # -DNO_MTIO             If you lack sys/mtio.h
  450.      #                       (magtape ioctls).
  451.      # -DNO_REMOTE           If you do not have a remote shell
  452.      #                       or rexec.
  453.      # -DUSE_REXEC           To use rexec for remote tape
  454.      #                       operations instead of
  455.      #                       forking rsh or remsh.
  456.      # -DVPRINTF_MISSING     If you lack vprintf function
  457.      #                       (but have _doprnt).
  458.      # -DDOPRNT_MISSING      If you lack _doprnt function.
  459.      #                       Also need to define
  460.      #                       -DVPRINTF_MISSING.
  461.      # -DFTIME_MISSING       If you lack ftime system call.
  462.      # -DSTRSTR_MISSING      If you lack strstr function.
  463.      # -DVALLOC_MISSING      If you lack valloc function.
  464.      # -DMKDIR_MISSING       If you lack mkdir and
  465.      #                       rmdir system calls.
  466.      # -DRENAME_MISSING      If you lack rename system call.
  467.      # -DFTRUNCATE_MISSING   If you lack ftruncate
  468.      #                       system call.
  469.      # -DV7                  On Version 7 Unix (not
  470.      #                       tested in a long time).
  471.      # -DEMUL_OPEN3          If you lack a 3-argument version
  472.      #                       of open, and want to emulate it
  473.      #                       with system calls you do have.
  474.      # -DNO_OPEN3            If you lack the 3-argument open
  475.      #                       and want to disable the tar -k
  476.      #                       option instead of emulating open.
  477.      # -DXENIX               If you have sys/inode.h
  478.      #                       and need it 94 to be included.
  479.      
  480.      DEFS =  -DSIGTYPE=int -DDIRENT -DSTRSTR_MISSING \
  481.              -DVPRINTF_MISSING -DBSD42
  482.      # Set this to rtapelib.o unless you defined NO_REMOTE,
  483.      # in which case make it empty.
  484.      RTAPELIB = rtapelib.o
  485.      LIBS =
  486.      DEF_AR_FILE = /dev/rmt8
  487.      DEFBLOCKING = 20
  488.      
  489.      CDEBUG = -g
  490.      CFLAGS = $(CDEBUG) -I. -I$(srcdir) $(DEFS) \
  491.              -DDEF_AR_FILE=\"$(DEF_AR_FILE)\" \
  492.              -DDEFBLOCKING=$(DEFBLOCKING)
  493.      LDFLAGS = -g
  494.      
  495.      prefix = /usr/local
  496.      # Prefix for each installed program,
  497.      # normally empty or `g'.
  498.      binprefix =
  499.      
  500.      # The directory to install tar in.
  501.      bindir = $(prefix)/bin
  502.      
  503.      # The directory to install the info files in.
  504.      infodir = $(prefix)/info
  505.      
  506.      #### End of system configuration section. ####
  507.      
  508.      SRC1 =  tar.c create.c extract.c buffer.c \
  509.              getoldopt.c update.c gnu.c mangle.c
  510.      SRC2 =  version.c list.c names.c diffarch.c \
  511.              port.c wildmat.c getopt.c
  512.      SRC3 =  getopt1.c regex.c getdate.y
  513.      SRCS =  $(SRC1) $(SRC2) $(SRC3)
  514.      OBJ1 =  tar.o create.o extract.o buffer.o \
  515.              getoldopt.o update.o gnu.o mangle.o
  516.      OBJ2 =  version.o list.o names.o diffarch.o \
  517.              port.o wildmat.o getopt.o
  518.      OBJ3 =  getopt1.o regex.o getdate.o $(RTAPELIB)
  519.      OBJS =  $(OBJ1) $(OBJ2) $(OBJ3)
  520.      AUX =   README COPYING ChangeLog Makefile.in  \
  521.              makefile.pc configure configure.in \
  522.              tar.texinfo tar.info* texinfo.tex \
  523.              tar.h port.h open3.h getopt.h regex.h \
  524.              rmt.h rmt.c rtapelib.c alloca.c \
  525.              msd_dir.h msd_dir.c tcexparg.c \
  526.              level-0 level-1 backup-specs testpad.c
  527.      
  528.      all:    tar rmt tar.info
  529.      
  530.      tar:    $(OBJS)
  531.              $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  532.      
  533.      rmt:    rmt.c
  534.              $(CC) $(CFLAGS) $(LDFLAGS) -o $@ rmt.c
  535.      
  536.      tar.info: tar.texinfo
  537.              makeinfo tar.texinfo
  538.      
  539.      install: all
  540.              $(INSTALL) tar $(bindir)/$(binprefix)tar
  541.              -test ! -f rmt || $(INSTALL) rmt /etc/rmt
  542.              $(INSTALLDATA) $(srcdir)/tar.info* $(infodir)
  543.      
  544.      $(OBJS): tar.h port.h testpad.h
  545.      regex.o buffer.o tar.o: regex.h
  546.      # getdate.y has 8 shift/reduce conflicts.
  547.      
  548.      testpad.h: testpad
  549.              ./testpad
  550.      
  551.      testpad: testpad.o
  552.              $(CC) -o $@ testpad.o
  553.      
  554.      TAGS:   $(SRCS)
  555.              etags $(SRCS)
  556.      
  557.      clean:
  558.              rm -f *.o tar rmt testpad testpad.h core
  559.      
  560.      distclean: clean
  561.              rm -f TAGS Makefile config.status
  562.      
  563.      realclean: distclean
  564.              rm -f tar.info*
  565.      
  566.      shar: $(SRCS) $(AUX)
  567.              shar $(SRCS) $(AUX) | compress \
  568.                > tar-`sed -e '/version_string/!d' \
  569.                           -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
  570.                           -e q
  571.                           version.c`.shar.Z
  572.      
  573.      dist: $(SRCS) $(AUX)
  574.              echo tar-`sed \
  575.                   -e '/version_string/!d' \
  576.                   -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
  577.                   -e q
  578.                   version.c` > .fname
  579.              -rm -rf `cat .fname`
  580.              mkdir `cat .fname`
  581.              ln $(SRCS) $(AUX) `cat .fname`
  582.              -rm -rf `cat .fname` .fname
  583.              tar chZf `cat .fname`.tar.Z `cat .fname`
  584.      
  585.      tar.zoo: $(SRCS) $(AUX)
  586.              -rm -rf tmp.dir
  587.              -mkdir tmp.dir
  588.              -rm tar.zoo
  589.              for X in $(SRCS) $(AUX) ; do \
  590.                  echo $$X ; \
  591.                  sed 's/$$/^M/' $$X \
  592.                  > tmp.dir/$$X ; done
  593.              cd tmp.dir ; zoo aM ../tar.zoo *
  594.              -rm -rf tmp.dir
  595.