BSD 4_4 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Sat, 12 Jun 1993 10:04:28 +0000 (02:04 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Sat, 12 Jun 1993 10:04:28 +0000 (02:04 -0800)
Work on file usr/src/contrib/X11R5-lib/config/Imake.rules

Synthesized-from: CSRG/cd3/4.4

usr/src/contrib/X11R5-lib/config/Imake.rules [new file with mode: 0644]

diff --git a/usr/src/contrib/X11R5-lib/config/Imake.rules b/usr/src/contrib/X11R5-lib/config/Imake.rules
new file mode 100644 (file)
index 0000000..24d95da
--- /dev/null
@@ -0,0 +1,1499 @@
+XCOMM -------------------------------------------------------------------------
+XCOMM Imake rules for building libraries, programs, scripts, and data files
+XCOMM rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
+
+/*
+ *                MACHINE-INDEPENDENT RULES; DO NOT MODIFY
+ *
+ * Warning, when defining rules: make sure you do not include both a trailing
+ * backslash and double ampersand backslash or else you will get an extra
+ * backslash in the Makefile.
+ * 
+ * The following macros are defined for the various templates and Imakefiles
+ * (for a list of the applicable make variables, see the template files):
+ * 
+ * SaberProgramTarget          (program,srclist,objlist,locallibs,syslibs)
+ * RemoveTargetProgram         (program)
+ * MakeDir                     (dir)
+ * BuildIncludes               (srclist,dstsubdir,dstupdir)
+ * NormalProgramTarget         (program,objects,deplibs,locallibs,syslibs)
+ * SetUIDProgramTarget         (program,objects,deplibs,locallibs,syslibs)
+ * SingleProgramTarget         (program,objects,locallibs,syslibs)
+ * SimpleProgramTarget         (program)
+ * ComplexProgramTarget                (program)
+ * ComplexProgramTarget_1      (program,locallib,syslib)
+ * ComplexProgramTarget_2      (program,locallib,syslib)
+ * ComplexProgramTarget_3      (program,locallib,syslib)
+ * ServerTarget                        (server,subdirs,objects,libs,syslibs)
+ * RanLibrary                  (args)
+ * InstallLibrary              (libname,dest)
+ * MergeIntoInstalledLibrary   (tolib,fromlib)
+ * InstallLibraryAlias         (libname,alias,dest)
+ * InstallLintLibrary          (libname,dest)
+ * InstallManPageLong          (file,destdir,dest)
+ * InstallManPage              (file,destdir)
+ * InstallManPageAliases       (file,destdir,aliases)
+ * InstallNamedNonExec         (srcname,dstname,dest)
+ * InstallNonExecFile          (file,dest)
+ * InstallNonExec              (file,dest)
+ * InstallProgramWithFlags     (program,dest,flags)
+ * InstallProgram              (program,dest)
+ * InstallScript               (program,dest)
+ * InstallNamedProg            (srcname,dstname,dest)
+ * LinkFileList                        (step,list,dir,sub)
+ * InstallMultipleDestFlags    (step,list,dest,flags)
+ * InstallMultipleDest         (step,list,dest)
+ * InstallMultiple             (list,dest)
+ * InstallMultipleFlags                (list,dest,flags)
+ * InstallMultipleMan          (list,dest)
+ * InstallAppDefaults          (class)
+ * InstallAppDefaultsLong      (file,class)
+ * DependDependency            ()
+ * DependTarget                        ()
+ * DependTarget3               (srcs1,srcs2,srcs3)
+ * CleanTarget                 ()
+ * TagsTarget                  ()
+ * ImakeDependency             (target)
+ * BuildMakefileTarget         (notused,imakeflags)
+ * MakefileTarget              ()
+ * LibMkdir                    (dir)
+ * LibCleanDir                 (dir)
+ * ObjectCompile               (options)
+ * NormalLibObjCompile         (options)
+ * NormalSharedLibObjCompile   (options)
+ * LibObjCompile               (dir,options)
+ * DebuggedLibObjCompile       (options)
+ * ProfiledLibObjCompile       (options)
+ * SharedLibObjCompile         (options)
+ * NormalLibraryObjectRule     ()
+ * NormalFortranObjectRule     ()
+ * ObjectFromSpecialSource     (dst,src,flags)
+ * SpecialObjectRule           (objs,depends,options)
+ * NormalLibraryTarget         (libname,objlist)
+ * NormalLibraryTarget2                (libname,objlist1,objlist2)
+ * NormalLibraryTarget3                (libname,objlist1,objlist2,objlist3)
+ * NormalDepLibraryTarget      (libname,deplist,objlist)
+ * SubdirLibraryRule           (objlist)
+ * ProfiledLibraryTarget       (libname,objlist)
+ * DebuggedLibraryTarget       (libname,objlist)
+ * AliasedLibraryTarget                (libname,alias)
+ * NormalRelocatableTarget     (objname,objlist)
+ * ProfiledRelocatableTarget   (objname,objlist)
+ * DebuggedRelocatableTarget   (objname,objlist)
+ * LintLibraryTarget           (libname,srclist)
+ * NormalLintTarget            (srclist)
+ * LintTarget                  ()
+ * LinkSourceFile              (src,dir)
+ * LinkFile                    (tofile,fromfile)
+ * MakeSubincludesForBuild     (step,dir,srclist)
+ * NamedTargetSubdirs          (name,dirs,verb,flags,subname)
+ * NamedMakeSubdirs            (name,dirs)
+ * MakeSubdirs                 (dirs)
+ * DependSubdirs               (dirs)
+ * ForceSubdirs                        (dirs)
+ * InstallSubdirs              (dirs)
+ * InstallManSubdirs           (dirs)
+ * IncludesSubdirs             (dirs)
+ * NamedCleanSubdirs           (name,dirs)
+ * CleanSubdirs                        (dirs)
+ * NamedTagSubdirs             (name,dirs)
+ * TagSubdirs                  (dirs)
+ * MakeLintSubdirs             (dirs,target,subtarget)
+ * LintSubdirs                 (dirs)
+ * MakeLintLibSubdirs          (dirs)
+ * MakeMakeSubdirs             (dirs,target)
+ * MakeNsubdirMakefiles                ()
+ * MakefileSubdirs             (dirs)
+ * CppScriptTarget             (dst,src,defs,deplist)
+ * MakeScriptFromCpp           (name,defs)
+ * CppFileTarget               (dst,src,defs,deplist)
+ * MakeDirectories             (step,dirs)
+ * MakeFontsDir                        (deplist)
+ * MakeFonts                   ()
+ * InstallFontObjs             (objs,dest)
+ * InstallFonts                        (dest)
+ * InstallFontAliases          (dest)
+ * FontSrc                     (basename)
+ * FontBaseObj                 (basename)
+ * InstallFontScale            (dest)
+ * UncompressedFontTarget      (basename)
+ * UncompressedFontTarget      (basename)
+ * CompressedFontTarget                (basename)
+ * FontTarget                  (basename)
+ * FontObj                     (basename)
+ * AllTarget                   (depends)
+ *
+ *
+ * The following are in Imake.tmpl:
+ *
+ * Concat                      (a,b)
+ * Concat3                     (a,b,c)
+ * 
+ *
+ * The following are in specific <os>Lib.rules:
+ *
+ * SharedLibraryTarget         (libname,rev,solist,down,up)
+ * SharedLibraryDataTarget     (libname,rev,salist)
+ * InstallSharedLibrary                (libname,rev,dest)
+ * InstallSharedLibraryData    (libname,rev,dest)
+ * 
+ */
+
+#define NullParameter
+
+/* if [ -d ] or [ ! -d ] causes make to fail, define this as - */
+#ifndef DirFailPrefix
+#define DirFailPrefix
+#endif
+
+/*
+ * SaberProgramTarget - generate rules to make Saber-C read in sources and
+ * objects.
+ */
+#ifndef SaberProgramTarget
+#if HasSaberC
+#define SaberProgramTarget(program,srclist,objlist,locallibs,syslibs)  @@\
+Concat(saber_,program):: srclist                                       @@\
+       XCOMM load $(ALLDEFINES) srclist locallibs $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) syslibs @@\
+                                                                       @@\
+Concat(osaber_,program):: objlist                                      @@\
+       XCOMM load $(ALLDEFINES) objlist locallibs $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) syslibs
+
+#else
+#define SaberProgramTarget(program,srclist,objlist,locallibs,syslibs) /**/
+#endif
+#endif
+
+#ifndef RemoveTargetProgram
+#if RemoveTargetProgramByMoving
+#define RemoveTargetProgram(program) \
+if [ -f program ]; then $(RM) Concat(program,~); $(MV) program Concat(program,~); fi
+#else
+#define RemoveTargetProgram(program) $(RM) program
+#endif
+#endif
+
+#ifndef MakeDir
+#define MakeDir(dir) DirFailPrefix@if [ -d dir ]; then set +x; \       @@\
+               else (set -x; $(MKDIRHIER) dir); fi
+#endif
+
+#ifndef BuildIncludes
+#define BuildIncludes(srclist,dstsubdir,dstupdir)                      @@\
+includes::                                                             @@\
+       MakeDir($(BUILDINCDIR)/dstsubdir)                               @@\
+       @(set -x; cd $(BUILDINCDIR)/dstsubdir; for i in srclist; do \   @@\
+               $(RM) $$i; \                                            @@\
+               $(LN) $(BUILDINCTOP)/dstupdir/$(CURRENT_DIR)/$$i .; \   @@\
+       done)
+#endif /* BuildIncludes */
+
+/*
+ * NormalProgramTarget - generate rules to compile and link the indicated 
+ * program; since it does not use any default object files, it may be used for
+ * multiple programs in the same Imakefile.
+ */
+#ifndef NormalProgramTarget
+#define        NormalProgramTarget(program,objects,deplibs,locallibs,syslibs)  @@\
+program: objects deplibs                                               @@\
+       RemoveTargetProgram($@)                                         @@\
+       $(CC) -o $@ objects $(LDOPTIONS) locallibs $(LDLIBS) syslibs $(EXTRA_LOAD_FLAGS) @@\
+                                                                       @@\
+clean::                                                                        @@\
+       $(RM) program
+#endif /* NormalProgramTarget */
+
+
+#ifndef SetUIDProgramTarget
+#define SetUIDProgramTarget NormalProgramTarget
+#endif
+
+
+/*
+ * SingleProgramTarget - obsolete version of NormalProgramTarget that does
+ * not have deplibs.
+ */
+#ifndef SingleProgramTarget
+#define        SingleProgramTarget(program,objects,locallibs,syslibs)          @@\
+NormalProgramTarget(program,objects,NullParameter,locallibs,syslibs)
+#endif /* SingleProgramTarget */
+
+/*
+ * SimpleProgramTarget - generate rules for compiling and linking programs
+ * that only have one C source file.  It should only be used in Imakefiles 
+ * that describe a single program.
+ */
+#ifndef SimpleProgramTarget
+#define        SimpleProgramTarget(program)                                    @@\
+           OBJS = program.o                                            @@\
+           SRCS = program.c                                            @@\
+                                                                       @@\
+ComplexProgramTarget(program)
+#endif /* SimpleProgramTarget */
+
+
+
+/*
+ * ComplexProgramTarget - generate rules for compiling and linking the 
+ * program specified by $(OBJS) and $(SRCS), installing the program and its
+ * man page, and generating dependencies.  It should only be used in 
+ * Imakefiles that describe a single program.
+ */
+#ifndef ComplexProgramTarget
+#define        ComplexProgramTarget(program)                                   @@\
+        PROGRAM = program                                              @@\
+                                                                       @@\
+AllTarget(program)                                                     @@\
+                                                                       @@\
+program: $(OBJS) $(DEPLIBS)                                            @@\
+       RemoveTargetProgram($@)                                         @@\
+       $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
+                                                                       @@\
+SaberProgramTarget(program,$(SRCS),$(OBJS),$(LOCAL_LIBRARIES),NullParameter) @@\
+                                                                       @@\
+InstallProgram(program,$(BINDIR))                                      @@\
+InstallManPage(program,$(MANDIR))                                      @@\
+DependTarget()                                                         @@\
+LintTarget()                                                           @@\
+                                                                       @@\
+clean::                                                                        @@\
+       $(RM) $(PROGRAM)
+#endif /* ComplexProgramTarget */
+
+
+/*
+ * ComplexProgramTarget_1 - generate rules for compiling and linking the
+ * program specified by $(OBJS1) and $(SRCS1), installing the program and its
+ * man page, and generating dependencies for it and any programs described
+ * by $(SRCS2) and $(SRCS3).  It should be used to build the primary 
+ * program in Imakefiles that describe multiple programs.
+ */
+#ifndef ComplexProgramTarget_1
+#define        ComplexProgramTarget_1(program,locallib,syslib)                 @@\
+            OBJS = $(OBJS1) $(OBJS2) $(OBJS3)                          @@\
+            SRCS = $(SRCS1) $(SRCS2) $(SRCS3)                          @@\
+                                                                       @@\
+AllTarget($(PROGRAMS))                                                 @@\
+                                                                       @@\
+program: $(OBJS1) $(DEPLIBS1)                                          @@\
+       RemoveTargetProgram($@)                                         @@\
+       $(CC) -o $@ $(LDOPTIONS) $(OBJS1) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
+                                                                       @@\
+InstallProgram(program,$(BINDIR))                                      @@\
+InstallManPage(program,$(MANDIR))                                      @@\
+                                                                       @@\
+SaberProgramTarget(program,$(SRCS1),$(OBJS1),locallib,syslib)          @@\
+                                                                       @@\
+DependTarget()                                                         @@\
+LintTarget()                                                           @@\
+                                                                       @@\
+clean::                                                                        @@\
+       $(RM) $(PROGRAMS)
+#endif /* ComplexProgramTarget_1 */
+
+
+/*
+ * ComplexProgramTarget_2 - generate rules for compiling and linking the
+ * program specified by $(OBJS2) and $(SRCS2) and installing the program and
+ * man page.  It should be used to build the second program in Imakefiles 
+ * describing more than one program.
+ */
+#ifndef ComplexProgramTarget_2
+#define        ComplexProgramTarget_2(program,locallib,syslib)                 @@\
+program: $(OBJS2) $(DEPLIBS2)                                          @@\
+       RemoveTargetProgram($@)                                         @@\
+       $(CC) -o $@ $(LDOPTIONS) $(OBJS2) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
+                                                                       @@\
+SaberProgramTarget(program,$(SRCS2),$(OBJS2),locallib,syslib)          @@\
+                                                                       @@\
+InstallProgram(program,$(BINDIR))                                      @@\
+InstallManPage(program,$(MANDIR))
+#endif /* ComplexProgramTarget_2 */
+
+
+/*
+ * ComplexProgramTarget_3 - generate rules for compiling and linking the
+ * program specified by $(OBJS3) and $(SRCS3) and installing the program and
+ * man page.  It should be used to build the third program in Imakefiles 
+ * describing more than one program.
+ */
+#ifndef ComplexProgramTarget_3
+#define        ComplexProgramTarget_3(program,locallib,syslib)                 @@\
+program: $(OBJS3) $(DEPLIBS3)                                          @@\
+       RemoveTargetProgram($@)                                         @@\
+       $(CC) -o $@ $(LDOPTIONS) $(OBJS3) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
+                                                                       @@\
+SaberProgramTarget(program,$(SRCS3),$(OBJS3),locallib,syslib)          @@\
+                                                                       @@\
+InstallProgram(program,$(BINDIR))                                      @@\
+InstallManPage(program,$(MANDIR))
+#endif /* ComplexProgramTarget_3 */
+
+
+
+/*
+ * ServerTarget - generate rules to compile, link, and relink an X server.
+ */
+#ifndef ServerTarget
+#define        ServerTarget(server,subdirs,objects,libs,syslibs)               @@\
+server: subdirs objects libs                                           @@\
+       -@if [ -f server ]; then set -x; \                              @@\
+               $(MV) server server.bak; else exit 0; fi                @@\
+       $(CC) $(CDEBUGFLAGS) $(CCOPTIONS) -o server objects libs $(EXTRA_LIBRARIES) syslibs $(EXTRA_LOAD_FLAGS) @@\
+                                                                       @@\
+Concat(load,server):                                                   @@\
+       -@if [ -f server ]; then set -x; \                              @@\
+               $(MV) server server.bak; else exit 0; fi                @@\
+       $(CC) $(CDEBUGFLAGS) $(CCOPTIONS) -o server objects libs $(EXTRA_LIBRARIES) syslibs $(EXTRA_LOAD_FLAGS)
+#endif /* ServerTarget */
+
+
+#if DoRanlibCmd
+#define RanLibrary(args) $(RANLIB) args
+#else
+#define RanLibrary(args) /**/
+#endif
+
+/*
+ * InstallLibrary - generate rules to install the indicated library.
+ */
+#ifndef InstallLibrary
+#define        InstallLibrary(libname,dest)                                    @@\
+install:: Concat(lib,libname.a)                                                @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.a) $(DESTDIR)dest @@\
+       RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,libname.a))
+#endif /* InstallLibrary */
+
+/*
+ * MergeIntoInstalledLibrary - generate rules to merge one library into another
+ */
+#ifndef MergeIntoInstalledLibrary
+#define MergeIntoInstalledLibrary(tolib,fromlib)                       @@\
+install::  fromlib                                                     @@\
+       $(SCRIPTSRC)/mergelib $(DESTDIR)tolib fromlib
+#endif /* MergeIntoInstalledLibrary */
+
+/*
+ * InstallLibraryAlias - generate rules to create a link from one library name
+ * to another for the purposes of aliasing.
+ */
+#ifndef InstallLibraryAlias
+#define        InstallLibraryAlias(libname,alias,dest)                         @@\
+install::                                                              @@\
+       -(cd $(DESTDIR)dest; \                                          @@\
+               $(RM) Concat(lib,alias.a); \                            @@\
+               $(LN) Concat(lib,libname.a) Concat(lib,alias.a))
+#endif /* InstallLibraryAlias */
+
+
+/*
+ * InstallLintLibrary - generate rules to install the indicated lint library.
+ */
+#ifndef InstallLintLibrary
+#define        InstallLintLibrary(libname,dest)                                @@\
+install.ln:: Concat(llib-l,libname.ln)                                 @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTLIBFLAGS) Concat(llib-l,libname.ln) $(DESTDIR)dest
+#endif /* InstallLintLibrary */
+
+
+/*
+ * InstallManPageLong - generate rules to install the indicated manual page,
+ * giving it an alternate name.  This is used for installing man pages whose
+ * base name without the .man suffix would normally be longer than 8 characters
+ * (the limit for using source code control systems on files systems with 
+ * short file names).
+ */
+#ifndef InstallManPageLong
+#define        InstallManPageLong(file,destdir,dest)                           @@\
+install.man:: file.man                                                 @@\
+       MakeDir($(DESTDIR)destdir)                                      @@\
+       $(INSTALL) -c $(INSTMANFLAGS) file.man $(DESTDIR)destdir/dest.$(MANSUFFIX)
+#endif /* InstallManPageLong */
+
+
+/*
+ * InstallManPage - generate rules to install the indicated manual page.
+ */
+#ifndef InstallManPage
+#define        InstallManPage(file,destdir)                                    @@\
+InstallManPageLong(file,destdir,file)
+#endif /* InstallManPage */
+
+
+/*
+ * InstallManPageAliases - generate rules to install manual page aliases.
+ */
+#ifndef InstallManPageAliases
+#define        InstallManPageAliases(file,destdir,aliases)                     @@\
+install.man::                                                          @@\
+       @(TMP=/tmp/tmp.$$$$; \                                          @@\
+       $(RM) $${TMP}; \                                                @@\
+       echo .so `basename destdir`/file.$(MANSUFFIX) > $${TMP}; \      @@\
+       for i in aliases; do (set -x; \                                 @@\
+       $(INSTALL) -c $(INSTMANFLAGS) $${TMP} $(DESTDIR)destdir/$$i.$(MANSUFFIX)); \ @@\
+       done; \                                                         @@\
+       $(RM) $${TMP})
+#endif /* InstallManPageAliases */
+
+
+/*
+ * InstallNamedNonExec - generate rules to install a data file
+ */
+#ifndef InstallNamedNonExec
+#define        InstallNamedNonExec(srcname,dstname,dest)                       @@\
+install:: srcname                                                      @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTDATFLAGS) srcname $(DESTDIR)dest/dstname
+#endif /* InstallNamedNonExec */
+
+
+/*
+ * InstallNonExecFile - generate rules to install a data file
+ */
+#ifndef InstallNonExecFile
+#define        InstallNonExecFile(file,dest)                                   @@\
+install:: file                                                         @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTDATFLAGS) file $(DESTDIR)dest
+#endif /* InstallNonExecFile */
+
+
+/*
+ * InstallNonExec - generate rules to install a data file, but does not
+ * try to create the destination directory (deprecated)
+ */
+#ifndef InstallNonExec
+#define        InstallNonExec(file,dest)                                       @@\
+install:: file                                                         @@\
+       $(INSTALL) -c $(INSTDATFLAGS) file $(DESTDIR)dest
+#endif /* InstallNonExec */
+
+
+/*
+ * InstallProgramWithFlags - generate rules to install an executable program
+ * using given install flags.
+ */
+#ifndef InstallProgramWithFlags
+#define InstallProgramWithFlags(program,dest,flags)                    @@\
+install:: program                                                      @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTPGMFLAGS) flags program $(DESTDIR)dest
+#endif /* InstallProgramWithFlags */
+
+
+/*
+ * InstallProgram - generate rules to install an executable program using any
+ * special install flags set in $(INSTALLFLAGS).
+ */
+#ifndef InstallProgram
+#define        InstallProgram(program,dest)                                    @@\
+InstallProgramWithFlags(program,dest,NullParameter)
+#endif /* InstallProgram */
+
+
+
+/*
+ * InstallScript - install a shell script.
+ */
+#ifndef InstallScript
+#define        InstallScript(program,dest)                                     @@\
+install:: program.script                                               @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTBINFLAGS) program.script $(DESTDIR)dest/program
+#endif /* InstallScript */
+
+
+/*
+ * InstallNamedProg - install a program with renaming and no stripping.
+ */
+#ifndef InstallNamedProg
+#define        InstallNamedProg(srcname,dstname,dest)                          @@\
+install:: srcname                                                      @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTBINFLAGS) srcname $(DESTDIR)dest/dstname
+#endif /* InstallNamedProg */
+
+
+/*
+ * LinkFileList - link a list of list of files from one place to another
+ */
+#ifndef LinkFileList
+#define LinkFileList(step,list,dir,sub)                                        @@\
+step:: list                                                            @@\
+       @case '${MFLAGS}' in *[i]*) set +e;; esac; \                    @@\
+       echo "  cd" dir; cd dir; \                                      @@\
+       for i in list; do (set -x; $(RM) $$i; $(LN) sub/$$i .); done
+#endif
+
+
+/*
+ * InstallMultipleDestFlags - generate rules to install multiple files at
+ * once during a particular step in the build using a specific set of install 
+ * flags.
+ */
+#ifndef InstallMultipleDestFlags
+#define InstallMultipleDestFlags(step,list,dest,flags)                 @@\
+step:: list                                                            @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       @case '${MFLAGS}' in *[i]*) set +e;; esac; \                    @@\
+       for i in list; do \                                             @@\
+               (set -x; $(INSTALL) -c flags $$i $(DESTDIR)dest); \     @@\
+       done
+#endif /* InstallMultipleDestFlags */
+
+
+/*
+ * InstallMultipleDest - generate rules to install multiple files at once
+ * during a particular step in the build using any install flags set in 
+ * $(INSTALLFLAGS).
+ */
+#ifndef InstallMultipleDest
+#define InstallMultipleDest(step,list,dest)                            @@\
+InstallMultipleDestFlags(step,list,dest,$(INSTALLFLAGS))
+#endif /* InstallMultipleDest */
+
+/*
+ * InstallMultiple - generate rules to install multiple files at once 
+ * during the install step of the build using any install flags set in 
+ * $(INSTALLFLAGS).
+ */
+#ifndef InstallMultiple
+#define        InstallMultiple(list,dest)                                      @@\
+InstallMultipleDest(install,list,dest)
+#endif /* InstallMultiple */
+
+
+/*
+ * InstallMultipleFlags - generate rules to install multiple files at once
+ * during the install step of the build using the given install flags.
+ */
+#ifndef InstallMultipleFlags
+#define InstallMultipleFlags(list,dest,flags)                          @@\
+InstallMultipleDestFlags(install,list,dest,flags)
+#endif /* InstallMultipleFlags */
+
+
+/*
+ * InstallMultipleMan - generate rules to install a variety of manual pages
+ * during the install.man step of the build.
+ */
+#ifndef InstallMultipleMan
+#define InstallMultipleMan(list,dest)                                  @@\
+InstallMultipleDestFlags(install.man,list,dest,$(INSTMANFLAGS))
+#endif /* InstallMultipleMan */
+
+
+/*
+ * InstallAppDefaults - generate rules to install appliation default files 
+ * if the InstallAppDefFiles configuration parameter is set.
+ */
+#ifndef InstallAppDefaults
+#if InstallAppDefFiles
+#define        InstallAppDefaults(class)                                       @@\
+install:: class.ad                                                     @@\
+       MakeDir($(DESTDIR)$(XAPPLOADDIR))                               @@\
+       $(INSTALL) -c $(INSTAPPFLAGS) class.ad $(DESTDIR)$(XAPPLOADDIR)/class
+#else
+#define        InstallAppDefaults(class)
+#endif /* InstallAppDefFiles */
+#endif /* InstallAppDefaults */
+
+/*
+ * InstallAppDefaultsLong - generate rules to install appliation default files 
+ * if the InstallAppDefFiles configuration parameter is set.
+ */
+#ifndef InstallAppDefaultsLong
+#if InstallAppDefFiles
+#define        InstallAppDefaultsLong(file,class)                              @@\
+install:: file.ad                                                      @@\
+       MakeDir($(DESTDIR)$(XAPPLOADDIR))                               @@\
+       $(INSTALL) -c $(INSTAPPFLAGS) file.ad $(DESTDIR)$(XAPPLOADDIR)/class
+#else
+#define        InstallAppDefaultsLong(file,class)
+#endif /* InstallAppDefFiles */
+#endif /* InstallAppDefaultsLong */
+
+
+
+
+/*
+ * DependDependency - generate rules to build the makedepend program if 
+ * this Imakefile is within the source tree.
+ */
+#ifndef DependDependency
+#ifdef UseInstalled
+#define DependDependency() /**/
+#else
+#define DependDependency()                                             @@\
+depend:: $(DEPEND)                                                     @@\
+                                                                       @@\
+$(DEPEND):                                                             @@\
+       @echo "checking $@ over in $(DEPENDSRC) first..."; \            @@\
+       cd $(DEPENDSRC); $(MAKE); \                                     @@\
+       echo "okay, continuing in $(CURRENT_DIR)"
+
+#endif /* UseInstalled */
+#endif /* DependDependency */
+
+
+/*
+ * DependTarget - generate rules to compute dependencies for all files listed
+ * in $(SRCS).
+ */
+#ifndef DependTarget
+#define        DependTarget()                                                  @@\
+DependDependency()                                                     @@\
+                                                                       @@\
+depend::                                                               @@\
+       $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
+#endif /* DependTarget */
+
+
+/*
+ * DependTarget3 - generate rules to compute dependencies for all files given.
+ */
+#ifndef DependTarget3
+#define        DependTarget3(srcs1,srcs2,srcs3)                                @@\
+DependDependency()                                                     @@\
+                                                                       @@\
+depend::                                                               @@\
+       $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- srcs1 @@\
+       $(DEPEND) -a $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- srcs2      @@\
+       $(DEPEND) -a $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- srcs3
+#endif /* DependTarget3 */
+
+
+/*
+ * CleanTarget - generate rules to remove any garbage files; the #* is here
+ * instead of in the definition of RM_CMD because System V will treat the 
+ * pound sign in the RM_CMD variable as a comment.
+ */
+#ifndef CleanTarget
+#define        CleanTarget()                                                   @@\
+clean::                                                                        @@\
+       $(RM_CMD) "#"*
+#endif /* CleanTarget */
+
+
+/*
+ * TagsTarget - generate rules to compute tags files for C source code.
+ */
+#ifndef TagsTarget
+#define        TagsTarget()                                                    @@\
+tags::                                                                 @@\
+       $(TAGS) -w *.[ch]                                               @@\
+       $(TAGS) -xw *.[ch] > TAGS
+#endif /* TagsTarget */
+
+
+/*
+ * ImakeDependency - generate rules to compile imake if this Imakefile is
+ * within the source tree.
+ */
+#ifndef ImakeDependency
+#ifdef UseInstalled
+#define ImakeDependency(target) /**/
+#else
+#define ImakeDependency(target)                                                @@\
+target:: $(IMAKE)                                                      @@\
+                                                                       @@\
+$(IMAKE):                                                              @@\
+       @(cd $(IMAKESRC); if [ -f Makefile ]; then \                    @@\
+       echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) all; else \ @@\
+       echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \    @@\
+       $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; fi; \     @@\
+       echo "okay, continuing in $(CURRENT_DIR)")
+#endif /* UseInstalled */
+#endif /* ImakeDependency */
+
+
+/*
+ * BuildMakefileTarget - generate rules to build a Makefile from an Imakefile
+ * and any special imake flags.  This is generally done automatically by the
+ * template or by any special Imakefiles.  The first argument exists just
+ * because imakeflags is usually empty and some preprocessors will complain
+ * if an empty argument is passed as the sole argument to a macro.
+ */
+#ifndef BuildMakefileTarget
+#define        BuildMakefileTarget(notused,imakeflags)                         @@\
+ImakeDependency(Makefile)                                              @@\
+                                                                       @@\
+Makefile::                                                             @@\
+       -@if [ -f Makefile ]; then set -x; \                            @@\
+               $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \      @@\
+       else exit 0; fi                                                 @@\
+       $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) imakeflags
+
+#endif /* BuildMakefileTarget */
+
+
+/*
+ * MakefileTarget - generate rules to build a normal Makefile.
+ */
+#ifndef MakefileTarget
+#define MakefileTarget()                                               @@\
+BuildMakefileTarget(Imakefile,NullParameter)
+#endif /* MakefileTarget */
+
+
+/*
+ * LibMkdir - helper for creating library object subdirectories
+ */
+#ifndef LibMkdir
+#define LibMkdir(dir) DirFailPrefix@if [ -d dir ]; then exit 0; else set -x; mkdir dir; fi
+#endif
+
+/*
+ * LibCleanDir - helper for cleaning library object subdirectories
+ */
+#ifndef LibCleanDir
+#define LibCleanDir(dir) -@if [ -d dir ]; then \                       @@\
+               (set -x; cd dir; $(RM) *.o); else exit 0; fi
+#endif
+
+/*
+ * ObjectCompile - compile fragment for a normal object file
+ */
+#ifndef ObjectCompile
+#define ObjectCompile(options) $(RM) $@                                        @@\
+       $(CC) -c $(CFLAGS) options $*.c
+#endif
+
+/*
+ * NormalLibObjCompile - compile fragment for a normal library object file
+ */
+#ifndef NormalLibObjCompile
+#define NormalLibObjCompile(options) ObjectCompile(options)
+#endif
+
+/*
+ * NormalSharedLibObjCompile - compile fragment for shared object when
+ * a normal library is not being built
+ */
+#ifndef NormalSharedLibObjCompile
+#define NormalSharedLibObjCompile(options) NormalLibObjCompile(options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS))
+#endif
+
+/*
+ * LibObjCompile - compile fragment for shared/profiled/debugged objects
+ */
+#ifndef LibObjCompile
+#define LibObjCompile(dir,options) $(RM) $@ dir/$@                     @@\
+       $(CC) -c $(CCOPTIONS) $(ALLDEFINES) options $*.c                @@\
+       $(MV) $@ dir/$@
+#endif
+
+/*
+ * DebuggedLibObjCompile - compile fragment for debugged objects
+ */
+#ifndef DebuggedLibObjCompile
+#define DebuggedLibObjCompile(options) LibObjCompile(debugger,-g options)
+#endif
+
+/*
+ * ProfiledLibObjCompile - compile fragment for profiled objects
+ */
+#ifndef ProfiledLibObjCompile
+#define ProfiledLibObjCompile(options) LibObjCompile(profiled,-pg options)
+#endif
+
+/*
+ * SharedLibObjCompile - compile fragment for shared objects
+ */
+#ifndef SharedLibObjCompile
+#define SharedLibObjCompile(options) LibObjCompile(shared,options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) $(CDEBUGFLAGS))
+#endif
+
+/*
+ * NormalLibraryObjectRule - for simple libraries
+ */
+#ifndef NormalLibraryObjectRule
+#define        NormalLibraryObjectRule()                                       @@\
+.c.o:                                                                  @@\
+       ObjectCompile($(_NOOP_))
+#endif /* NormalLibraryObjectRule */
+
+
+#ifndef NormalFortranObjectRule
+#define NormalFortranObjectRule()                                      @@\
+.f.o:                                                                  @@\
+       $(RM) $@                                                        @@\
+       $(FC) -c $(FCFLAGS) $*.f
+#endif
+
+#ifndef ObjectFromSpecialSource
+#define ObjectFromSpecialSource(dst,src,flags)                         @@\
+dst.c:  src.c                                                          @@\
+       $(RM) $@                                                        @@\
+       $(LN) $? $@                                                     @@\
+                                                                       @@\
+dst.o:  dst.c                                                          @@\
+       ObjectCompile(flags)                                            @@\
+                                                                       @@\
+depend::  dst.c                                                                @@\
+                                                                       @@\
+clean::                                                                        @@\
+       $(RM) dst.c
+#endif /* ObjectFromSpecialSource */
+
+/*
+ * SpecialObjectRule - generate rules to compile a file with special flags.
+ */
+#ifndef SpecialObjectRule
+#define SpecialObjectRule(objs,depends,options)                                @@\
+objs:  depends                                                         @@\
+       ObjectCompile(options)
+#endif /* SpecialObjectRule */
+
+
+/*
+ * NormalLibraryTarget - generate rules to create a library.
+ */
+#ifndef NormalLibraryTarget
+#define        NormalLibraryTarget(libname,objlist)                            @@\
+AllTarget(Concat(lib,libname.a))                                       @@\
+                                                                       @@\
+Concat(lib,libname.a): objlist                                         @@\
+       $(RM) $@                                                        @@\
+       $(AR) $@ objlist                                                @@\
+       RanLibrary($@)
+#endif /* NormalLibraryTarget */
+
+
+/*
+ * NormalLibraryTarget2 - generate rules to create a library in two steps.
+ * This is used to create libraries with large numbers of files.
+ */
+#ifndef NormalLibraryTarget2
+#define        NormalLibraryTarget2(libname,objlist1,objlist2)                 @@\
+AllTarget(Concat(lib,libname.a))                                       @@\
+                                                                       @@\
+Concat(lib,libname.a): objlist1 objlist2                               @@\
+       $(RM) $@                                                        @@\
+       $(AR) $@ objlist1                                               @@\
+       $(AR) $@ objlist2                                               @@\
+       RanLibrary($@)
+#endif /* NormalLibraryTarget2 */
+
+
+/*
+ * NormalLibraryTarget3 - generate rules to create a library in three steps.
+ * This is used to create libraries with very large numbers of files.
+ */
+#ifndef NormalLibraryTarget3
+#define        NormalLibraryTarget3(libname,objlist1,objlist2,objlist3)        @@\
+AllTarget(Concat(lib,libname.a))                                       @@\
+                                                                       @@\
+Concat(lib,libname.a): objlist1 objlist2 objlist3                      @@\
+       $(RM) $@                                                        @@\
+       $(AR) $@ objlist1                                               @@\
+       $(AR) $@ objlist2                                               @@\
+       $(AR) $@ objlist3                                               @@\
+       RanLibrary($@)
+#endif /* NormalLibraryTarget3 */
+
+
+/*
+ * NormalDepLibraryTarget - generate rules to create a library.
+ */
+#ifndef NormalDepLibraryTarget
+#define        NormalDepLibraryTarget(libname,deplist,objlist)                 @@\
+AllTarget(Concat(lib,libname.a))                                       @@\
+                                                                       @@\
+Concat(lib,libname.a): deplist                                         @@\
+       $(RM) $@                                                        @@\
+       $(AR) $@ objlist                                                @@\
+       RanLibrary($@)
+#endif /* NormalDepLibraryTarget */
+
+
+/*
+ * SubdirLibraryRule -
+ */
+#ifndef SubdirLibraryRule
+#define        SubdirLibraryRule(objlist)                                      @@\
+all:: DONE                                                             @@\
+                                                                       @@\
+DONE: objlist                                                          @@\
+       touch $@                                                        @@\
+                                                                       @@\
+clean::                                                                        @@\
+       $(RM) DONE
+#endif /* SubdirLibraryRule */
+
+
+/*
+ * ProfiledLibraryTarget - generate rules to create a profiled library.
+ */
+#ifndef ProfiledLibraryTarget
+#define        ProfiledLibraryTarget(libname,objlist)                          @@\
+AllTarget(Concat3(lib,libname,_p.a))                                   @@\
+                                                                       @@\
+Concat3(lib,libname,_p.a): objlist                                     @@\
+       $(RM) $@                                                        @@\
+       cd profiled; $(AR) ../$@ objlist                                @@\
+       RanLibrary($@)
+
+#endif /* ProfiledLibraryTarget */
+
+
+/*
+ * DebuggedLibraryTarget - generate rules to create a debuggable library.
+ */
+#ifndef DebuggedLibraryTarget
+#define        DebuggedLibraryTarget(libname,objlist)                          @@\
+AllTarget(Concat3(lib,libname,_d.a))                                   @@\
+                                                                       @@\
+Concat3(lib,libname,_d.a): objlist                                     @@\
+       $(RM) $@                                                        @@\
+       cd debugger; $(AR) ../$@ objlist                                @@\
+       RanLibrary($@)
+
+#endif /* DebuggedLibraryTarget */
+
+
+/*
+ * AliasedLibraryTarget - generate rules to link one library to another.
+ */
+#ifndef AliasedLibraryTarget
+#define        AliasedLibraryTarget(libname,alias)                             @@\
+AllTarget(Concat(lib,alias.a))                                         @@\
+                                                                       @@\
+Concat(lib,alias.a): Concat(lib,libname.a)                             @@\
+       $(RM) $@                                                        @@\
+       $(LN) Concat(lib,libname.a) $@
+#endif /* AliasedLibraryTarget */
+
+
+/*
+ * NormalRelocatableTarget - generate rules to produce a relocatable object
+ * file instead of a library.  
+ */
+#ifndef NormalRelocatableTarget
+#define        NormalRelocatableTarget(objname,objlist)                        @@\
+AllTarget(objname.o)                                                   @@\
+                                                                       @@\
+objname.o: objlist                                                     @@\
+       $(RM) $@                                                        @@\
+       $(LD) $(LDCOMBINEFLAGS) objlist -o $@
+#endif /* NormalRelocatableTarget */
+
+
+/*
+ * ProfiledRelocatableTarget - generate rules to produce a profiled relocatable
+ * object file instead of a library.
+ */
+#ifndef ProfiledRelocatableTarget
+#define        ProfiledRelocatableTarget(objname,objlist)                      @@\
+AllTarget(Concat(objname,_p.o))                                                @@\
+                                                                       @@\
+Concat(objname,_p.o): objlist                                          @@\
+       $(RM) $@                                                        @@\
+       $(LD) -X -r objlist -o $@
+
+#endif /* ProfiledRelocatableTarget */
+
+
+/*
+ * DebuggedRelocatableTarget - generate rules to produce a debuggable 
+ * relocatable object file instead of a library.
+ */
+#ifndef DebuggedRelocatableTarget
+#define        DebuggedRelocatableTarget(objname,objlist)                      @@\
+AllTarget(Concat(objname,_d.o))                                                @@\
+                                                                       @@\
+Concat(objname,_d.o): objlist                                          @@\
+       $(RM) $@                                                        @@\
+       $(LD) -X -r objlist -o $@
+
+#endif /* DebuggedRelocatableTarget */
+
+
+/*
+ * LintLibraryTarget - generate rules to create a lint library.  Note that the
+ * lint library is always forced to be newer than the library itself.
+ */
+#ifndef LintLibraryTarget
+#define        LintLibraryTarget(libname,srclist)                              @@\
+lintlib:: Concat(llib-l,libname.ln)                                    @@\
+                                                                       @@\
+Concat(llib-l,libname.ln): srclist                                     @@\
+       $(RM) $@                                                        @@\
+       $(LINT) Concat($(LINTLIBFLAG),libname) $(LINTFLAGS) srclist
+#endif /* LintLibraryTarget */
+
+
+/*
+ * NormalLintTarget - generate rules to lint a set of sources.
+ */
+#ifndef NormalLintTarget
+#define NormalLintTarget(srclist)                                      @@\
+lint:                                                                  @@\
+       $(LINT) $(LINTFLAGS) srclist $(LINTLIBS)                        @@\
+lint1:                                                                 @@\
+       $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
+#endif /* NormalLintTarget */
+
+
+/*
+ * LintTarget - generate rules to lint $(SRCS)
+ */
+#ifndef LintTarget
+#define LintTarget()                                                   @@\
+NormalLintTarget($(SRCS))
+#endif
+
+
+/*
+ * LinkSourceFile - snag source file from some other directory
+ */
+#ifndef LinkSourceFile
+#define LinkSourceFile(src,dir)                                                @@\
+src:  dir/src                                                          @@\
+       $(RM) $@                                                        @@\
+       $(LN) $? $@                                                     @@\
+
+#endif
+
+
+/*
+ * LinkFile - link a file
+ */
+#ifndef LinkFile
+#define LinkFile(tofile,fromfile)                                      @@\
+tofile:: fromfile                                                      @@\
+       $(RM) $@                                                        @@\
+       $(LN) $? $@
+#endif
+
+
+#ifndef MakeSubincludesForBuild
+#define MakeSubincludesForBuild(step,dir,srclist)                      @@\
+step::  dir srclist                                                    @@\
+       @-(list=`echo srclist | sed -e 's/[^ ]*\///g'`; \               @@\
+               set -x; cd dir; $(RM) $$list)                           @@\
+       @for i in srclist; do \                                         @@\
+               (set -x; cd dir; $(LN) ../$$i .); \                     @@\
+       done                                                            @@\
+                                                                       @@\
+dir::                                                                  @@\
+       $(MKDIRHIER) dir                                                @@\
+                                                                       @@\
+clean::                                                                        @@\
+       @-(if [ -d dir ]; then \                                        @@\
+               list=`echo srclist | sed -e 's/[^ ]*\///g'`; \          @@\
+               set -x; cd dir; $(RM) $$list; else exit 0; fi)
+#endif
+
+
+/*
+ * NamedTargetSubdirs - recursively make a series of steps
+ */
+#ifndef NamedTargetSubdirs
+#define NamedTargetSubdirs(name,dirs,verb,flags,subname)               @@\
+name::                                                                 @@\
+       @case '${MFLAGS}' in *[ik]*) set +e;; esac; \                   @@\
+       for i in dirs ;\                                                @@\
+       do \                                                            @@\
+               (cd $$i ; echo verb "in $(CURRENT_DIR)/$$i..."; \       @@\
+                       $(MAKE) $(MFLAGS) flags subname); \             @@\
+       done
+#endif
+
+
+/*
+ * NamedMakeSubdirs - generate rules to do makes in the given subdirectories.
+ * If you want CDEBUGFLAGS passed along to subdirectories, provide a line like
+ * the following in the appropriate Imakefile
+ * 
+ *         #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
+ */
+#ifndef NamedMakeSubdirs
+#define NamedMakeSubdirs(name,dirs) \
+NamedTargetSubdirs(name,dirs,"making" name,PassCDebugFlags,all)
+#endif /* NamedMakeSubdirs */
+
+#ifndef MakeSubdirs
+#define MakeSubdirs(dirs)                                              @@\
+NamedMakeSubdirs(all,dirs)
+#endif /* MakeSubdirs */
+
+
+/*
+ * DependSubdirs - generate rules to recursively compute dependencies as
+ * part of the make depend step.
+ */
+#ifndef DependSubdirs
+#define DependSubdirs(dirs) \
+NamedTargetSubdirs(depend,dirs,"depending",NullParameter,depend)
+#endif /* DependSubdirs */
+
+
+/*
+ * ForceSubdirs - force make to build subdirectories
+ */
+#ifndef ForceSubdirs
+#define ForceSubdirs(dirs)                                             @@\
+dirs: FRC                                                              @@\
+       @cd $@ ; echo "making all in $(CURRENT_DIR)/$@..."; \           @@\
+       $(MAKE) $(MFLAGS) PassCDebugFlags all                           @@\
+                                                                       @@\
+FRC:
+#endif /* ForceSubdirs */
+
+/*
+ * InstallSubdirs - generate rules to recursively install programs and files.
+ */
+#ifndef InstallSubdirs
+#define InstallSubdirs(dirs) \
+NamedTargetSubdirs(install,dirs,"installing",DESTDIR='$(DESTDIR)',install)
+#endif /* InstallSubdirs */
+
+
+/*
+ * InstallManSubdirs - generate rules to recursively install manual pages.
+ */
+#ifndef InstallManSubdirs
+#define InstallManSubdirs(dirs) \
+NamedTargetSubdirs(install.man,dirs,"installing man pages",DESTDIR='$(DESTDIR)',install.man)
+#endif /* InstallManSubdirs */
+
+
+/*
+ * IncludesSubdirs - generate rules to recursively put include files in build
+ */
+#ifndef IncludesSubdirs
+#define IncludesSubdirs(dirs) \
+NamedTargetSubdirs(includes,dirs,including,NullParameter,includes)
+#endif
+
+
+/*
+ * CleanSubdirs - generate rules to recursively clean out garbage files.
+ */
+#ifndef NamedCleanSubdirs
+#define NamedCleanSubdirs(name,dirs) \
+NamedTargetSubdirs(name,dirs,"cleaning",RM_CMD='$(RM_CMD)',clean)
+#endif /* NamedCleanSubdirs */
+
+#ifndef CleanSubdirs
+#define CleanSubdirs(dirs) \
+NamedCleanSubdirs(clean,dirs)
+#endif
+
+
+/*
+ * TagSubdirs - generate rules to recursively create tags files.
+ */
+#ifndef NamedTagSubdirs
+#define NamedTagSubdirs(name,dirs) \
+NamedTargetSubdirs(name,dirs,"tagging",TAGS='$(TAGS)',tags)
+#endif /* TagSubdirs */
+
+#ifndef TagSubdirs
+#define TagSubdirs(dirs) \
+NamedTagSubdirs(tags,dirs)
+#endif
+
+/*
+ * MakeLintSubdirs - generate rules to recursively lint directories as part 
+ * of the named step.
+ */
+#ifndef MakeLintSubdirs
+#define MakeLintSubdirs(dirs,target,subtarget) \
+NamedTargetSubdirs(target,dirs,"linting" for target and subtarget,DESTDIR='$(DESTDIR)' LINTOPTS='$(LINTOPTS)',subtarget)
+#endif /* MakeLintSubdirs */
+
+
+/*
+ * LintSubdirs - generate rules to recursively lint directories as part of 
+ * the make lint step.
+ */
+#ifndef LintSubdirs
+#define LintSubdirs(dirs)                                              @@\
+MakeLintSubdirs(dirs,lint,lint)
+#endif /* LintSubdirs */
+
+
+/*
+ * MakeLintLibSubdirs - generate rules to recursively create lint libraries.
+ */
+#ifndef MakeLintLibSubdirs
+#define MakeLintLibSubdirs(dirs)                                       @@\
+MakeLintSubdirs(dirs,lintlib,lintlib)
+#endif /* MakeLintLibSubdirs */
+
+
+/*
+ * MakeMakeSubdirs - generate rules to recursively recreate Makefiles as part
+ * of the specified step in the build.  If $(TOP) is set to an absolute path, 
+ * do not prepend the ../ prefix.  This makes running things outside of the 
+ * source tree to be much easier.
+ */
+#ifndef MakeMakeSubdirs
+#define MakeMakeSubdirs(dirs,target)                                   @@\
+target::                                                               @@\
+       @case '${MFLAGS}' in *[ik]*) set +e;; esac; \                   @@\
+       for i in dirs ;\                                                @@\
+       do \                                                            @@\
+               echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \     @@\
+               case "$$i" in \                                         @@\
+               ./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \ @@\
+               ./?*/?*/?*) newtop=../../../ sub=subsubsub;; \          @@\
+               ./?*/?*)    newtop=../../ sub=subsub;; \                @@\
+               ./?*)       newtop=../ sub=sub;; \                      @@\
+               */?*/?*/?*)    newtop=../../../../ sub=subsubsubsub;; \ @@\
+               */?*/?*)    newtop=../../../ sub=subsubsub;; \          @@\
+               */?*)       newtop=../../ sub=subsub;; \                @@\
+               *)          newtop=../ sub=sub;; \                      @@\
+               esac; \                                                 @@\
+               case "$(TOP)" in \                                      @@\
+               /?*) newtop=  upprefix=  ;; \                           @@\
+               *) upprefix=../ ;; \                                    @@\
+               esac; \                                                 @@\
+               $(MAKE) $${sub}dirMakefiles UPPREFIX=$$upprefix NEWTOP=$$newtop \               @@\
+               MAKEFILE_SUBDIR=$$i NEW_CURRENT_DIR=$(CURRENT_DIR)/$$i;\ @@\
+       done
+#endif /* MakeMakeSubdirs */
+
+
+/*
+ * MakeNsubdirMakefiles - generate rules to create sub Makefiles.
+ */
+#ifndef MakeNsubdirMakefiles
+#define MakeNsubdirMakefiles()                                         @@\
+subdirMakefiles:                                                       @@\
+       $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak                           @@\
+       -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \         @@\
+       $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\
+       else exit 0; fi                                                 @@\
+       cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \   @@\
+       $(MAKE) $(MFLAGS) Makefiles                                     @@\
+                                                                       @@\
+subsubdirMakefiles:                                                    @@\
+       $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak                           @@\
+       -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \         @@\
+       $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\
+       else exit 0; fi                                                 @@\
+       cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \        @@\
+       $(MAKE) $(MFLAGS) Makefiles                                     @@\
+                                                                       @@\
+subsubsubdirMakefiles:                                                 @@\
+       $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak                           @@\
+       -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \         @@\
+       $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\
+       else exit 0; fi @@\
+       cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \     @@\
+       $(MAKE) $(MFLAGS) Makefiles                                     @@\
+                                                                       @@\
+subsubsubsubdirMakefiles:                                              @@\
+       $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak                           @@\
+       -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \         @@\
+       $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\
+       else exit 0; fi                                                 @@\
+       cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \  @@\
+       $(MAKE) $(MFLAGS) Makefiles
+#endif /* MakeNsubdirMakefiles */
+
+
+/*
+ * MakefileSubdirs - generate rules to create Makefiles.
+ */
+#ifndef MakefileSubdirs
+#define MakefileSubdirs(dirs)                                          @@\
+MakeMakeSubdirs(dirs,Makefiles)                                                @@\
+                                                                       @@\
+MakeNsubdirMakefiles()
+#endif /* MakefileSubdirs */
+
+/*
+ * Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
+ * to cpp, because that trick does not work on all ANSI C preprocessors.
+ * Also delete line numbers from the cpp output (-P is not portable, I guess).
+ */
+#ifndef CppSedMagic
+#define CppSedMagic sed -e '/^#  *[0-9][0-9]*  *.*$$/d' \
+                   -e '/^XCOMM$$/s//#/' \
+                   -e '/^XCOMM[^a-zA-Z0-9_]/s/^XCOMM/#/'
+#endif /* CppSedMagic */
+
+/*
+ * CppScriptTarget - generate rules to create a shell script by running the
+ * input through cpp.  If the ExecableScripts configuration parameter is not
+ * set, then make sure that the first line begins with a colon.
+ */
+#ifndef CppScriptTarget
+#if ExecableScripts            /* can use #! instead of colon */
+#define CppScriptTarget(dst,src,defs,deplist)                          @@\
+dst::  src deplist                                                     @@\
+       $(RM) $@                                                        @@\
+       $(CPP) defs <src | CppSedMagic >$@                              @@\
+       chmod a+x $@
+#else
+#define CppScriptTarget(dst,src,defs,deplist)                          @@\
+dst::  src deplist                                                     @@\
+       $(RM) $@                                                        @@\
+       echo \: >$@                                                     @@\
+       sed '1d' src | $(CPP) defs | CppSedMagic >>$@                   @@\
+       chmod a+x $@
+#endif /* ExecableScripts */
+#endif /* CppScriptTarget */
+
+
+/*
+ * MakeScriptFromCpp - generate rules to create a script from a file with a
+ * .cpp suffix.
+ */
+#ifndef MakeScriptFromCpp
+#define MakeScriptFromCpp(name,defs)                                   @@\
+CppScriptTarget(name,name.cpp,defs,NullParameter)
+#endif /* MakeScriptFromCpp */
+
+#ifndef CppFileTarget
+#define CppFileTarget(dst,src,defs,deplist)                            @@\
+dst::  src deplist                                                     @@\
+       $(RM) $@                                                        @@\
+       $(CPP) defs <src | CppSedMagic >$@
+#endif /* CppFileTarget */
+
+/*
+ * MakeDirectories - generate rules to create a hierarchy of directories.
+ */
+#ifndef MakeDirectories
+#define MakeDirectories(step,dirs)                                     @@\
+step::                                                                 @@\
+       @case '${MFLAGS}' in *[i]*) set +e;; esac;                      @@\
+       DirFailPrefix@for i in dirs; do if [ -d $(DESTDIR)$$i ]; then \ @@\
+               set +x; else (set -x; $(MKDIRHIER) $(DESTDIR)$$i); fi \ @@\
+       done
+#endif /* MakeDirectories */
+
+
+/*
+ * MakeFontsDir - generate rules to build fonts.dir database.
+ */
+#ifndef MakeFontsDir
+#define MakeFontsDir(deplist)                                          @@\
+all:: fonts.dir                                                                @@\
+                                                                       @@\
+fonts.dir:  deplist                                                    @@\
+       $(MKFONTDIR) .                                                  @@\
+                                                                       @@\
+clean::                                                                        @@\
+       $(RM) fonts.dir
+#endif /* MakeFontsDir */
+
+
+/*
+ * MakeFonts - generate rules to build font database.
+ */
+#ifndef MakeFonts
+#define MakeFonts()                                                    @@\
+all::  $(OBJS)                                                         @@\
+                                                                       @@\
+MakeFontsDir($(OBJS))                                                  @@\
+                                                                       @@\
+clean::                                                                        @@\
+       $(RM) *.snf *.snf.Z *.pcf *.pcf.Z
+#endif /* MakeFonts */
+
+
+/*
+ * InstallFontObjs - generate rules to install font files
+ */
+#ifndef InstallFontObjs
+#define InstallFontObjs(objs,dest)                                     @@\
+InstallMultipleFlags(objs,dest,$(INSTDATFLAGS))                                @@\
+                                                                       @@\
+install::  fonts.dir                                                   @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTDATFLAGS) fonts.dir $(DESTDIR)dest
+#endif /* InstallFontObjs */
+
+
+/*
+ * InstallFonts - generate rules to install font files
+ */
+#ifndef InstallFonts
+#define InstallFonts(dest)                                             @@\
+InstallFontObjs($(OBJS),dest)
+#endif /* InstallFonts */
+
+
+/*
+ * InstallFontAliases - generate rules to install font aliases databases. 
+ */
+#ifndef InstallFontAliases
+#define InstallFontAliases(dest)                                       @@\
+install::  fonts.alias                                                 @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTDATFLAGS) fonts.alias $(DESTDIR)dest
+#endif /* InstallFontAliases */
+
+#ifndef FontSrc
+#define FontSrc(basename) basename.bdf
+#endif
+
+#ifndef FontBaseObj
+#ifdef SnfFonts
+#define FontBaseObj(basename)basename.snf
+#else
+#define FontBaseObj(basename)basename.pcf
+#endif
+#endif
+
+/*
+ * InstallFontScale - generate rules to install font scale database.
+ */
+#ifndef InstallFontScale
+#define InstallFontScale(dest)                                         @@\
+install::  fonts.scale                                                 @@\
+       MakeDir($(DESTDIR)dest)                                         @@\
+       $(INSTALL) -c $(INSTDATFLAGS) fonts.scale $(DESTDIR)dest
+#endif /* InstallFontScale */
+
+/*
+ * UncompressedFontTarget
+ */
+#ifndef UncompressedFontTarget
+#ifdef SnfFonts
+#define UncompressedFontTarget(basename)                               @@\
+FontBaseObj(basename):  FontSrc(basename)                              @@\
+       $(FONTC) $(FONTCFLAGS) $? >$@
+#else
+#define UncompressedFontTarget(basename)                               @@\
+FontBaseObj(basename):  FontSrc(basename)                              @@\
+       $(FONTC) $(FONTCFLAGS) $? -o $@
+#endif
+#endif /* CompressedFontTarget */
+
+/*
+ * CompressedFontTarget
+ */
+#ifndef CompressedFontTarget
+#define CompressedFontTarget(basename)                                 @@\
+FontBaseObj(basename).Z:  FontSrc(basename)                            @@\
+       $(FONTC) $(FONTCFLAGS) $? | $(COMPRESS) > $@
+#endif /* CompressedFontTarget */
+
+#ifdef CompressAllFonts
+#define FontTarget(basename) CompressedFontTarget(basename)
+#define FontObj(basename) FontBaseObj(basename).Z
+#else
+#define FontTarget(basename) UncompressedFontTarget(basename)
+#define FontObj(basename) FontBaseObj(basename)
+#endif /* CompressAllFonts */
+
+/*
+ * AllTarget - generate rules to build necessary things during make all.
+ */
+#ifndef AllTarget
+#define AllTarget(depends)                                             @@\
+all:: depends
+#endif /* AllTarget */
+
+#ifdef DefineOldLibraryRules
+#include <oldlib.rules>
+#endif