summaryrefslogtreecommitdiff
path: root/jmake/files
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2008-05-30 14:15:43 -0500
committerManoj Srivastava <srivasta@debian.org>2008-05-30 14:15:43 -0500
commitd902bed25e446508e9dcbe84001f738e77dd1979 (patch)
tree378d1e978b67c2c78904a81b454d303def969a97 /jmake/files
parent13da8069e56806306f6b42e2af5f03e89a835083 (diff)
parent6ed168ff814db8f9bcaad6f2e218fb2bbacbdb1c (diff)
Merge branch 'upstream'
Conflicts: jmake/files/Jmake.rules mcon/U/Chk_MANI.U Signed-off-by: Manoj Srivastava <srivasta@debian.org>
Diffstat (limited to 'jmake/files')
-rw-r--r--jmake/files/Jmake.rules649
-rw-r--r--jmake/files/Jmake.tmpl67
2 files changed, 342 insertions, 374 deletions
diff --git a/jmake/files/Jmake.rules b/jmake/files/Jmake.rules
index 2144911..7d3aff0 100644
--- a/jmake/files/Jmake.rules
+++ b/jmake/files/Jmake.rules
@@ -1,22 +1,25 @@
;########################################################################
;# Jmake rules for building libraries, programs, scripts, and data files
-;# $Id: Jmake.rules,v 3.0.1.6 1997/02/28 14:56:01 ram Exp $
+;# $Id$
/*
* MACHINE-INDEPENDENT RULES -- DO NOT MODIFY
*/
-/* $Id: Jmake.rules,v 3.0.1.6 1997/02/28 14:56:01 ram Exp $
+/* $Id$
*
- * Copyright (c) 1991-1993, Raphael Manfredi
+ * Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
*
* You may redistribute only under the terms of the Artistic Licence,
* as specified in the README file that comes with the distribution.
* You may reuse parts of this distribution only within the terms of
* that same Artistic Licence; a copy of which may be found at the root
- * of the source tree for dist 3.0.
+ * of the source tree for dist 4.0.
*
* $Log: Jmake.rules,v $
+ * Revision 3.0.1.7 2004/08/22 08:28:58 ram
+ * patch71: random cleanup
+ *
* Revision 3.0.1.6 1997/02/28 14:56:01 ram
* patch61: now handles USRINC for dependencies
* patch61: smarter about dependencies computation
@@ -53,7 +56,6 @@
* of by jmake.
*/
#define AddedByConfigure(files) @!\
->RM @!\
local_clobber:: @@\
$(RM) files
@@ -70,7 +72,6 @@ local_clobber:: @@\
* Generate rules to build necessary things during make all.
*/
#define AllTarget(depends) @!\
->RM @!\
all:: depends @!\
@!\
local_realclean:: @@\
@@ -84,10 +85,9 @@ local_realclean:: @@\
* used *inside* building rules.
*/
#define RemoveTargetProgram(program) \
->RM @!\
->MV @@\
$(RM) program @@\
- if test -f program; then $(MV) program program^^~; else exit 0; fi
+ if test -f program^^^$(_EXE); then \ @@\
+ $(MV) program^^^$(_EXE) program^^~^^^$(_EXE); fi
/*
* NormalProgramTarget:
@@ -96,10 +96,6 @@ local_realclean:: @@\
* multiple programs in the same Jmakefile.
*/
#define NormalProgramTarget(program,sources,objects) @!\
->CC @!\
->RM @!\
->JLDFLAGS @!\
->LIBS @!\
++OBJECTS objects @!\
++SOURCES sources @!\
NormalObjectRule() @!\
@@ -137,11 +133,6 @@ NormalProgramTarget(program,program.c,program.o)
* that describe a single program.
*/
#define ComplexProgramTarget(program) @!\
->CC @!\
->JLDFLAGS @!\
->LIBS @!\
->BINDIR @!\
->MANSRC @!\
++OBJECTS $(OBJS) @!\
++SOURCES $(SRCS) @!\
NormalObjectRule() @!\
@@ -166,11 +157,6 @@ LintTarget()
* program in Jmakefiles that describe multiple programs.
*/
#define ComplexProgramTarget_1(program) @!\
->CC @!\
->JLDFLAGS @!\
->LIBS @!\
->BINDIR @!\
->MANSRC @!\
++OBJECTS $(OBJS1) @!\
++SOURCES $(SRCS1) @!\
NormalObjectRule() @!\
@@ -195,11 +181,6 @@ LintTarget()
* describing more than one program.
*/
#define ComplexProgramTarget_2(program) @!\
->CC @!\
->JLDFLAGS @!\
->LIBS @!\
->BINDIR @!\
->MANSRC @!\
++OBJECTS $(OBJS2) @!\
++SOURCES $(SRCS2) @!\
NormalObjectRule() @!\
@@ -221,11 +202,6 @@ InstallManPage(program,$(MANSRC))
* more than one program.
*/
#define ComplexProgramTarget_3(program) @!\
->CC @!\
->JLDFLAGS @!\
->LIBS @!\
->BINDIR @!\
->MANSRC @!\
++OBJECTS $(OBJS3) @!\
++SOURCES $(SRCS3) @!\
NormalObjectRule() @!\
@@ -245,9 +221,6 @@ InstallManPage(program,$(MANSRC))
* .$manext files.
*/
#define ComplexShellManualTarget(manpages) @!\
->INSTALL @!\
->MANSRC @!\
->RM @!\
++MANPAGE manpages @!\
|once _ShellManualRule_ @!\
|rule:.SH.$manext: @!\
@@ -258,21 +231,18 @@ AddSuffix(.SH) @!\
AddSuffix(.$manext) @!\
AllTarget(manpages) @!\
@!\
-install.man:: @@\
- @if test "$(MANSRC)"; then \ @@\
- case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
- for file in manpages; do \ @@\
- (set -x; $(INSTALL) -c -m 444 $$file $(MANSRC)); \ @@\
- done; \ @@\
- else exit 0; fi @!\
+local_install.man:: @@\
+ _MakeInstallDirIgnore($(MANSRC)) \ @@\
+ for file in manpages; do \ @@\
+ (set -x; $(INSTALL) -c -m 444 $$file \ @@\
+ $(INSTALL_PREFIX)$(MANSRC)) || exit 1; \ @@\
+ done @!\
@!\
-deinstall.man:: @@\
- @if test "$(MANSRC)"; then \ @@\
- case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
- for file in manpages; do \ @@\
- (set -x; $(RM) $(MANSRC)/$$file); \ @@\
- done; \ @@\
- else exit 0; fi
+local_deinstall.man:: @@\
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
+ for file in manpages; do \ @@\
+ (set -x; $(RM) $(INSTALL_PREFIX)$(MANSRC)/$$file); \ @@\
+ done
/*
@@ -289,16 +259,14 @@ deinstall.man:: @@\
* Generate rules to install the indicated library.
*/
#define InstallLibrary(libname,dest) @!\
->RANLIB @!\
->INSTALL @!\
->RM @!\
-install:: lib^^libname.a @@\
- $(INSTALL) -c -m 644 lib^^libname.a dest @@\
+local_install:: lib^^libname.a @@\
+ _MakeInstallDirIgnore(dest) \ @@\
+ $(INSTALL) -c -m 644 lib^^libname.a $(INSTALL_PREFIX)^^^dest @@\
$(RANLIB) dest/lib^^libname.a @@\
chmod 444 dest/lib^^libnane.a @!\
- @!\
-deinstall:: @@\
- $(RM) dest/lib^^libname.a
+ @!\
+local_deinstall:: @@\
+ $(RM) $(INSTALL_PREFIX)^^^dest/lib^^libname.a
/*
@@ -306,13 +274,12 @@ deinstall:: @@\
* Generate rules to install the shared library.
*/
#define InstallSharedLibrary(libname,rev,dest) @!\
->INSTALL @!\
->RM @!\
-install:: lib^^libname.so.rev @@\
- $(INSTALL) -c -m 444 lib^^libname.so.rev dest @!\
- @!\
-deinstall:: @@\
- $(RM) dest/lib^^libname.so.rev
+local_install:: lib^^libname.so.rev @@\
+ _MakeInstallDirIgnore(dest) \ @@\
+ $(INSTALL) -c -m 444 lib^^libname.so.rev $(INSTALL_PREFIX)^^^dest @!\
+ @!\
+local_deinstall:: @@\
+ $(RM) $(INSTALL_PREFIX)^^^dest/lib^^libname.so.rev
/*
@@ -320,13 +287,12 @@ deinstall:: @@\
* Generate rules to install the shared library data
*/
#define InstallSharedLibraryData(libname,rev,dest) @!\
->INSTALL @!\
->RM @!\
-install:: lib^^libname.sa.rev @@\
- $(INSTALL) -c -m 444 lib^^libname.sa.rev dest @!\
- @!\
-deinstall:: @@\
- $(RM) dest/lib^^libname.sa.rev
+local_install:: lib^^libname.sa.rev @@\
+ _MakeInstallDirIgnore(dest) \ @@\
+ $(INSTALL) -c -m 444 lib^^libname.sa.rev $(INSTALL_PREFIX)^^^dest @!\
+ @!\
+local_deinstall:: @@\
+ $(RM) $(INSTALL_PREFIX)^^^dest/lib^^libname.sa.rev
/*
@@ -335,13 +301,11 @@ deinstall:: @@\
* for the purposes of aliasing.
*/
#define InstallLibraryAlias(libname,alias,dest) @!\
->LN @!\
->RM @!\
-install:: lib^^libname.a @@\
+local_install:: lib^^libname.a @@\
$(RM) lib^^alias.a @@\
-(cd dest; $(LN) lib^^libname.a lib^^alias.a) @!\
@!\
-deinstall:: @@\
+local_deinstall:: @@\
$(RM) dest/lib^^alias.a
@@ -350,13 +314,12 @@ deinstall:: @@\
* Generate rules to install the indicated lint library.
*/
#define InstallLintLibrary(libname,dest) @!\
->INSTALL @!\
->RM @!\
-install.ln:: llib-l^^libname.ln @@\
- $(INSTALL) -c -m 444 llib-l^^libname.ln dest @!\
+install.ln:: llib-l^^libname.ln @@\
+ _MakeInstallDirIgnore(dest) \ @@\
+ $(INSTALL) -c -m 444 llib-l^^libname.ln $(INSTALL_PREFIX)^^^dest @!\
@!\
deinstall.ln:: @@\
- $(RM) dest/llib-l^^libname.ln
+ $(RM) $(INSTALL_PREFIX)^^^dest/llib-l^^libname.ln
/*
@@ -368,14 +331,12 @@ deinstall.ln:: @@\
* files systems with short file names).
*/
#define InstallManPageLong(file,destdir,dest) @!\
->L @!\
->INSTALL @!\
->RM @!\
-install.man:: file.man @@\
- $(INSTALL) -c -m 444 file.man destdir/dest.$(L) @!\
- @!\
-deinstall.man:: @@\
- $(RM) destdir/dest.$(L) @!\
+local_install.man:: file.man @@\
+ _MakeInstallDirIgnore(destdir) \ @@\
+ $(INSTALL) -c -m 444 file.man $(INSTALL_PREFIX)^^^destdir/dest.$(L) @!\
+ @!\
+local_deinstall.man:: @@\
+ $(RM) $(INSTALL_PREFIX)^^^destdir/dest.$(L) @!\
/*
@@ -392,13 +353,12 @@ InstallManPageLong(file,dest,file)
* install flags.
*/
#define InstallNonExec(file,dest) @!\
->INSTALL @!\
->RM @!\
-install:: file @@\
- $(INSTALL) -c -m 444 file dest @!\
- @!\
-deinstall:: @@\
- $(RM) dest/file
+local_install:: file @@\
+ _MakeInstallDirIgnore(dest) \ @@\
+ $(INSTALL) -c -m 444 file $(INSTALL_PREFIX)^^^dest @!\
+ @!\
+local_deinstall:: @@\
+ $(RM) $(INSTALL_PREFIX)^^^dest/file
/*
@@ -407,13 +367,26 @@ deinstall:: @@\
* install flags.
*/
#define InstallProgramWithFlags(program,dest,flags) @!\
->INSTALL @!\
->RM @!\
-install:: program @@\
- $(INSTALL) -c -s -m 555 flags program dest @!\
- @!\
-deinstall:: @@\
- $(RM) dest/program
+local_install:: program @@\
+ _MakeInstallDirIgnore(dest) \ @@\
+ $(INSTALL) -c -s -m 555 flags program^^^$(_EXE) $(INSTALL_PREFIX)^^^dest @!\
+ @!\
+local_deinstall:: @@\
+ $(RM) $(INSTALL_PREFIX)^^^dest/program^^^$(_EXE)
+
+
+/*
+ * InstallProgramNoStripWithFlags:
+ * Generate rules to install an executable program using given
+ * install flags.
+ */
+#define InstallProgramNoStripWithFlags(program,dest,flags) @!\
+local_install:: program @@\
+ _MakeInstallDirIgnore(dest) \ @@\
+ $(INSTALL) -c -m 555 flags program^^^$(_EXE) $(INSTALL_PREFIX)^^^dest @!\
+ @!\
+local_deinstall:: @@\
+ $(RM) $(INSTALL_PREFIX)^^^dest/program^^^$(_EXE)
/*
@@ -426,18 +399,27 @@ InstallProgramWithFlags(program,dest,^^)
/*
+ * InstallProgramNoStrip:
+ * Generate rules to install an executable program using any special
+ * install flags set in $(INSTALLFLAGS), but without stripping the
+ * executable from debugging symbols.
+ */
+#define InstallProgramNoStrip(program,dest) @!\
+InstallProgramNoStripWithFlags(program,dest,^^)
+
+
+/*
* InstallScriptWithFlags:
* Generate rules to install an executable script using given
* install flags.
*/
#define InstallScriptWithFlags(script,dest,flags) @!\
->INSTALL @!\
->RM @!\
-install:: script @@\
- $(INSTALL) -c -m 555 flags script dest @!\
- @!\
-deinstall:: @@\
- $(RM) dest/script
+local_install:: script @@\
+ _MakeInstallDirIgnore(dest) \ @@\
+ $(INSTALL) -c -m 555 flags script $(INSTALL_PREFIX)^^^dest @!\
+ @!\
+local_deinstall:: @@\
+ $(RM) $(INSTALL_PREFIX)^^^dest/script
/*
@@ -455,20 +437,19 @@ InstallScriptWithFlags(script,dest,^^)
* $(SCRIPTS) and $(LSCRIPTS) macros.
*/
#define InstallScripts() @!\
->SCRIPTDIR @!\
->INSTALL @!\
->RM @!\
|once _InstallScripts_ @!\
-install:: $(SCRIPTS) $(LSCRIPTS) @@\
- @for file in $(SCRIPTS) $(LSCRIPTS); do \ @@\
- case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
- (set -x; $(INSTALL) -c -m 555 $$file $(SCRIPTDIR)); \ @@\
+local_install:: $(SCRIPTS) $(LSCRIPTS) @@\
+ _MakeInstallDirIgnore($(SCRIPTDIR)) \ @@\
+ for file in $(SCRIPTS) $(LSCRIPTS); do \ @@\
+ (set -x; \ @@\
+ $(INSTALL) -c -m 555 $$file $(INSTALL_PREFIX)$(SCRIPTDIR)) || \ @@\
+ exit 1; \ @@\
done @!\
@!\
-deinstall:: @@\
+local_deinstall:: @@\
@for file in $(SCRIPTS) $(LSCRIPTS); do \ @@\
- case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
- (set -x; $(RM) $(SCRIPTDIR)/$$file); \ @@\
+ case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
+ (set -x; $(RM) $(INSTALL_PREFIX)$(SCRIPTDIR)/$$file); \ @@\
done @!\
-once
@@ -478,30 +459,24 @@ deinstall:: @@\
* in the automatically generated $(SCRIPTS) macro.
*/
#define InstallManScripts() @!\
->RM @!\
->INSTALL @!\
->MANSRC @!\
->L @!\
|once _InstallManScripts_ @!\
?NOMAN:|skip @!\
-install.man:: @@\
- @if test "$(MANSRC)"; then \ @@\
- case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
- for file in $(SCRIPTS); do \ @@\
- if test -f $$file.man; then \ @@\
- (set -x; \ @@\
- $(INSTALL) -c -m 444 $$file.man $(MANSRC)/$$file.$(L)); \ @@\
- fi; \ @@\
- done; \ @@\
- else exit 0; fi @!\
+local_install.man:: @@\
+ _MakeInstallDirIgnore($(MANSRC)) \ @@\
+ for file in $(SCRIPTS); do \ @@\
+ if test -f $$file.man; then \ @@\
+ (set -x; \ @@\
+ $(INSTALL) -c -m 444 $$file.man \ @@\
+ $(INSTALL_PREFIX)$(MANSRC)/$$file.$(L)) || \ @@\
+ exit 1; \ @@\
+ fi; \ @@\
+ done @!\
@!\
-deinstall.man:: @@\
- @if test "$(MANSRC)"; then \ @@\
- case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
- for file in $(SCRIPTS); do \ @@\
- (set -x; $(RM) $(MANSRC)/$$file.$(L)); \ @@\
- done; \ @@\
- else exit 0; fi @!\
+local_deinstall.man:: @@\
+ case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
+ for file in $(SCRIPTS); do \ @@\
+ (set -x; $(RM) $(INSTALL_PREFIX)$(MANSRC)/$$file.$(L)); \ @@\
+ done @!\
@!\
-skip @!\
-once
@@ -513,7 +488,6 @@ deinstall.man:: @@\
* Link a list of list of files from one place to another
*/
#define LinkFileList(step,list,dir,sub) @!\
->LN @!\
step:: list @@\
@case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
echo " cd" dir; cd dir; for i in list; do (set -x; $(LN) sub/$$i .); done
@@ -522,40 +496,37 @@ step:: list @@\
/*
* InstallMultipleDestFlags:
* Generate rules to install multiple files at once during a particular
- * step in the build using a specific set of install flags. The `step'
- * must begin with "install".
+ * step in the build using a specific set of install flags.
*/
#define InstallMultipleDestFlags(step,list,dest,flags) @!\
->INSTALL @!\
->RM @!\
step:: list @@\
- @case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
+ _MakeInstallDirIgnore(dest) \ @@\
for i in list; do \ @@\
- (set -x; $(INSTALL) -c flags $$i dest); \ @@\
- done @!\
- @!\
-de^^step:: @@\
- @case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
- for i in list; do \ @@\
- (set -x; $(RM) dest/$$i); \ @@\
+ (set -x; $(INSTALL) -c flags \ @@\
+ $$i $(INSTALL_PREFIX)^^^dest) || exit 1;\ @@\
done
-
/*
- * InstallMultipleDest:
- * Generate rules to install multiple files at once during a particular
- * step in the build using any install flags set in $(INSTALLFLAGS).
+ * DeinstallMultipleDest:
+ * Generate rules to deinstall multiple files at once during a particular
+ * step in the build.
*/
-#define InstallMultipleDest(step,list,dest) @!\
-InstallMultipleDestFlags(step,list,dest,$(INSTALLFLAGS))
+#define DeinstallMultipleDest(step,list,dest) @!\
+step:: @@\
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
+ for i in list; do \ @@\
+ (set -x; $(RM) $(INSTALL_PREFIX)^^^dest/$$i); \ @@\
+ done
/*
* InstallMultiple:
* Generate rules to install multiple files at once during the install
- * step of the build using any install flags set in $(INSTALLFLAGS).
+ * step of the build using any install flags set in $(INSTALLFLAGS)
+ * and deinstall them.
*/
#define InstallMultiple(list,dest) @!\
-InstallMultipleDest(install,list,dest)
+InstallMultipleDestFlags(local_install,list,dest,$(INSTALLFLAGS)) @!\
+DeinstallMultipleDest(local_deinstall,list,dest)
/*
@@ -564,7 +535,8 @@ InstallMultipleDest(install,list,dest)
* install step of the build using the given install flags.
*/
#define InstallMultipleFlags(list,dest,flags) @!\
-InstallMultipleDestFlags(install,list,dest,flags)
+InstallMultipleDestFlags(local_install,list,dest,flags) @!\
+DeinstallMultipleDest(local_deinstall,list,dest)
/*
@@ -573,8 +545,8 @@ InstallMultipleDestFlags(install,list,dest,flags)
* during the install.man step of the build.
*/
#define InstallMultipleMan(list,dest) @!\
->L @!\
-InstallMultipleDest(install.$(L),list,dest)
+InstallMultipleDestFlags(local_install.man,list,dest,$(INSTALLFLAGS)) @!\
+DeinstallMultipleDest(local_deinstall.man,list,dest)
/*
@@ -595,9 +567,6 @@ TOPDIR/mkdep: @!\
* in $(SOURCES) (automatically generated macro).
*/
#define DependTarget() @!\
->MKDEP @!\
->SED @!\
->RM @!\
+USRINC = $usrinc @!\
|once _DependTarget_ @!\
DependDependency() @!\
@@ -605,9 +574,9 @@ DependDependency() @!\
depend:: @@\
($(SED) '/^# DO NOT DELETE/q' Makefile && \ @@\
$(MKDEP) $(SOURCES) | \ @@\
- $(SED) -e 's:/usr/include[^ ]*::g; s:$(USRINC)[^ ]*::g; ' \ @@\
- -e '/: / b print' -e 'H; d; n; : print' -e 'x; s/\\\n//g' \ @@\
- -e 's/ ^^ */ /g; s/ :/:/;' -e '/: *$$/d' \ @@\
+ $(SED) -e 's:/usr/lib[^ ]*::g; s:$(USRINC)[^ ]*::g; ' \ @@\
+ -e '/: / b print' -e '$$ b print' -e 'H; d; n; : print' \ @@\
+ -e 'x; s/\\$$//; s/\\\n//g; s/ ^^ */ /g; s/ :/:/;' -e '/: *$$/d' \ @@\
) > Makefile.new @@\
cp Makefile Makefile.bak @@\
cp Makefile.new Makefile @@\
@@ -621,7 +590,6 @@ depend:: @@\
* Generate rules to remove any garbage files.
*/
#define CleanTarget() @!\
->RM @!\
?SUBDIRS:clean: sub_clean local_clean @!\
%SUBDIRS:clean: local_clean @!\
?SUBDIRS:realclean: sub_realclean local_realclean @!\
@@ -630,7 +598,8 @@ depend:: @@\
%SUBDIRS:clobber: local_clobber @!\
@!\
local_clean:: @@\
- $(RM) core *~ *.o @!\
+ if test -f core; then $(RM) core; fi @@\
+ $(RM) *~ *.o @!\
@!\
local_realclean:: local_clean @!\
?TOP: $(RM) -r UU @!\
@@ -643,12 +612,30 @@ local_clobber:: local_realclean @!\
/*
+ * InstallTarget:
+ * Generate rules to recursively install files
+ */
+#define InstallTarget() @!\
+?SUBDIRS:install:: local_install sub_install @!\
+%SUBDIRS:install:: local_install @!\
+?SUBDIRS:install.man:: maybe_install.man sub_install.man @!\
+%SUBDIRS:install.man:: maybe_install.man @!\
+?SUBDIRS:deinstall:: sub_deinstall local_deinstall @!\
+%SUBDIRS:deinstall:: local_deinstall @!\
+?SUBDIRS:deinstall.man:: sub_deinstall.man maybe_deinstall.man @!\
+%SUBDIRS:deinstall.man:: maybe_deinstall.man @!\
+ @!\
+?MANSRC:install.man-yes: local_install.man @!\
+install.man-no: @!\
+?MANSRC:deinstall.man-yes: local_deinstall.man @!\
+deinstall.man-no: @!\
+
+
+/*
* TagsTarget:
* Generate rules to compute tags files for C source code.
*/
#define TagsTarget() @!\
->CTAGS @!\
->RM @!\
tags:: @@\
$(CTAGS) -w *.[ch] @@\
$(CTAGS) -xw *.[ch] > tags @!\
@@ -667,8 +654,6 @@ local_clobber:: @@\
* exists, assuming the Jmakefile is not in a production environment.
*/
#define BuildMakefileSH(jmakeflags) @!\
->RM @!\
->MV @!\
Makefile.SH: Jmakefile @@\
-@if test -f $(TOP)/.package; then \ @@\
if test -f Makefile.SH; then \ @@\
@@ -677,7 +662,7 @@ Makefile.SH: Jmakefile @@\
fi; \ @@\
echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" jmakeflags; \ @@\
$(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) jmakeflags; \ @@\
- else touch $@; exit 0; fi
+ else touch $@; fi
/*
@@ -703,8 +688,6 @@ BuildMakefile()
* Generate make rule to build usual object files.
*/
#define NormalObjectRule() @!\
->CC @!\
->JCFLAGS @!\
|once _ObjectRule_ @!\
|rule:.c.o: @!\
|rule: $(CC) -c $(JCFLAGS) $< @!\
@@ -716,9 +699,6 @@ BuildMakefile()
* Generate make rules to build "normal" objects.
*/
#define NormalLibraryObjectRule() @!\
->CC @!\
->JCFLAGS @!\
->RM @!\
|once _ObjectRule_ @!\
|rule:.c.o: @!\
|rule: $(RM) $@ @!\
@@ -731,12 +711,8 @@ BuildMakefile()
* Generate make rules to build both profiled and "normal" objects.
*/
#define ProfiledLibraryObjectRule() @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d profiled ]; then mkdir profiled; else exit 0; fi @!\
+ @if [ ! -d profiled ]; then mkdir profiled; fi @!\
@!\
|rule:.c.o: @!\
|rule: $(RM) $@ profiled/$@ @!\
@@ -746,7 +722,7 @@ all:: @@\
|rule: @!\
local_clean:: @@\
-@if [ -d profiled ]; then echo " $(RM) profiled/?*.o"; \ @@\
- $(RM) profiled/?*.o; else exit 0; fi
+ $(RM) profiled/?*.o; fi
/*
@@ -755,12 +731,8 @@ local_clean:: @@\
* objects.
*/
#define DebuggedLibraryObjectRule() @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi @!\
+ @if [ ! -d debugger ]; then mkdir debugger; fi @!\
@!\
|rule:.c.o: @!\
|rule: $(RM) $@ debugger/$@ @!\
@@ -770,7 +742,7 @@ all:: @@\
|rule: @!\
local_clean:: @@\
-@if [ -d debugger ]; then echo " $(RM) debugger/?*.o"; \ @@\
- $(RM) debugger/?*.o; else exit 0; fi
+ $(RM) debugger/?*.o; fi
/*
@@ -779,13 +751,9 @@ local_clean:: @@\
* objects.
*/
#define DebuggedAndProfiledLibraryObjectRule() @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d profiled ]; then mkdir profiled; else exit 0; fi @@\
- @if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi @!\
+ @if [ ! -d profiled ]; then mkdir profiled; fi @@\
+ @if [ ! -d debugger ]; then mkdir debugger; fi @!\
@!\
|rule:.c.o: @!\
|rule: $(RM) $@ profiled/$@ debugger/$@ @!\
@@ -797,9 +765,9 @@ all:: @@\
|rule: @!\
local_clean:: @@\
-@if [ -d profiled ]; then echo " $(RM) profiled/?*.o"; \ @@\
- $(RM) profiled/?*.o; else exit 0; fi @@\
+ $(RM) profiled/?*.o; fi @@\
-@if [ -d debugger ]; then echo " $(RM) debugger/?*.o"; \ @@\
- $(RM) debugger/?*.o; else exit 0; fi
+ $(RM) debugger/?*.o; fi
/*
@@ -807,12 +775,8 @@ local_clean:: @@\
* Generate make rules to build shared and "normal" object files.
*/
#define SharedLibraryObjectRule() @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d shared ]; then mkdir shared; else exit 0; fi @!\
+ @if [ ! -d shared ]; then mkdir shared; fi @!\
@!\
|rule:.c.o: @!\
|rule: $(RM) $@ shared/$@ @!\
@@ -822,7 +786,7 @@ all:: @@\
|rule: @!\
local_clean:: @@\
-@if [ -d shared ]; then echo " $(RM) shared/?*.o"; \ @@\
- $(RM) shared/?*.o; else exit 0; fi
+ $(RM) shared/?*.o; fi
/*
* SharedAndDebuggedLibraryObjectRule:
@@ -830,13 +794,9 @@ local_clean:: @@\
* object files.
*/
#define SharedAndDebuggedLibraryObjectRule() @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d shared ]; then mkdir shared; else exit 0; fi @@\
- @if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi @!\
+ @if [ ! -d shared ]; then mkdir shared; fi @@\
+ @if [ ! -d debugger ]; then mkdir debugger; fi @!\
@!\
|rule:.c.o: @!\
|rule: $(RM) $@ shared/$@ debugger/$@ @!\
@@ -848,9 +808,9 @@ all:: @@\
|rule: @!\
local_clean:: @@\
-@if [ -d shared ]; then echo " $(RM) shared/?*.o"; \ @@\
- $(RM) shared/?*.o; else exit 0; fi @@\
+ $(RM) shared/?*.o; fi @@\
-@if [ -d debugger ]; then echo " $(RM) debugger/?*.o"; \ @@\
- $(RM) debugger/?*.o; else exit 0; fi
+ $(RM) debugger/?*.o; fi
/*
* SpecialSharedAndDebuggedObjectRule:
@@ -858,13 +818,9 @@ local_clean:: @@\
* shared and debuggable versions.
*/
#define SpecialSharedAndDebuggedObjectRule(objs,depends,options) @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d shared ]; then mkdir shared; else exit 0; fi @@\
- @if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi @!\
+ @if [ ! -d shared ]; then mkdir shared; fi @@\
+ @if [ ! -d debugger ]; then mkdir debugger; fi @!\
@!\
objs: depends @@\
$(RM) $@ shared/$@ debugger/$@ @@\
@@ -880,12 +836,8 @@ objs: depends @@\
* shared and debuggable versions.
*/
#define SpecialSharedObjectRule(objs,depends,options) @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d shared ]; then mkdir shared; else exit 0; fi @!\
+ @if [ ! -d shared ]; then mkdir shared; fi @!\
@!\
objs: depends @@\
$(RM) $@ shared/$@ @@\
@@ -899,9 +851,6 @@ objs: depends @@\
* Generate rules to compile a file with special flags.
*/
#define SpecialObjectRule(objs,depends,options) @!\
->RM @!\
->CC @!\
->JCFLAGS @!\
objs: depends @@\
$(RM) $@ @@\
$(CC) -c $(JCFLAGS) options $*.c
@@ -913,12 +862,8 @@ objs: depends @@\
* profiled version.
*/
#define SpecialProfiledObjectRule(objs,depends,options) @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d profiled ]; then mkdir profiled; else exit 0; fi @!\
+ @if [ ! -d profiled ]; then mkdir profiled; fi @!\
@!\
objs: depends @@\
$(RM) $@ profiled/$@ @@\
@@ -933,12 +878,8 @@ objs: depends @@\
* debuggable version.
*/
#define SpecialDebuggedObjectRule(objs,depends,options) @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi @!\
+ @if [ ! -d debugger ]; then mkdir debugger; fi @!\
@!\
objs: depends @@\
$(RM) $@ debugger/$@ @@\
@@ -953,13 +894,9 @@ objs: depends @@\
* debuggable and profiled versions.
*/
#define SpecialDebuggedAndProfiledObjectRule(objs,depends,options) @!\
->RM @!\
->CC @!\
->MV @!\
->JCFLAGS @!\
all:: @@\
- @if [ ! -d profiled ]; then mkdir profiled; else exit 0; fi @@\
- @if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi @!\
+ @if [ ! -d profiled ]; then mkdir profiled; fi @@\
+ @if [ ! -d debugger ]; then mkdir debugger; fi @!\
@!\
objs: depends @@\
$(RM) $@ profiled/$@ debugger/$@ @@\
@@ -977,9 +914,6 @@ objs: depends @@\
* is not otherwise used by this rule, but is necessary for make depend.
*/
#define NormalLibraryTarget(libname,srclist,objlist) @!\
->RM @!\
->AR @!\
->RANLIB @!\
++OBJECTS objlist @!\
++SOURCES srclist @!\
NormalLibraryObjectRule() @!\
@@ -998,9 +932,6 @@ lib^^libname.a: objlist @@\
* library gone for long periods.
*/
#define NormalSharedLibraryTarget(libname,rev,solist) @!\
->RM @!\
->LD @!\
->MV @!\
AllTarget(lib^^libname.so.rev) @!\
@!\
lib^^libname.so.rev: solist @@\
@@ -1016,9 +947,6 @@ lib^^libname.so.rev: solist @@\
* library gone for long periods.
*/
#define NormalSharedLibraryDataTarget(libname,rev,salist) @!\
->RM @!\
->AR @!\
->RANLIB @!\
AllTarget(lib^^libname.sa.rev) @!\
@!\
lib^^libname.sa.rev: salist @@\
@@ -1033,9 +961,6 @@ lib^^libname.sa.rev: salist @@\
* create libraries with large numbers of files.
*/
#define NormalLibraryTarget2(libname,srclist,objlist1,objlist2) @!\
->RM @!\
->AR @!\
->RANLIB @!\
++SOURCES srclist @!\
++OBJECTS objlist1 @!\
++OBJECTS objlist2 @!\
@@ -1054,9 +979,6 @@ lib^^libname.a: objlist1 objlist2 @@\
* Generate rules to create a profiled library.
*/
#define ProfiledLibraryTarget(libname,srclist,objlist) @!\
->RM @!\
->AR @!\
->RANLIB @!\
++SOURCES srclist @!\
++OBJECTS objlist @!\
AllTarget(lib^^libname^^_p.a) @!\
@@ -1072,9 +994,6 @@ lib^^libname^^_p.a: objlist @@\
* Generate rules to create a debuggable library.
*/
#define DebuggedLibraryTarget(libname,srclist,objlist) @!\
->RM @!\
->AR @!\
->RANLIB @!\
++SOURCES srclist @!\
++OBJECTS objlist @!\
AllTarget(lib^^libname^^_d.a) @!\
@@ -1090,8 +1009,6 @@ lib^^libname^^_d.a: objlist @@\
* Generate rules to link one library to another.
*/
#define AliasedLibraryTarget(libname,alias) @!\
->RM @!\
->LN @!\
AllTarget(lib^^alias.a) @!\
@!\
lib^^alias.a: lib^^libname.a @@\
@@ -1105,30 +1022,33 @@ lib^^alias.a: lib^^libname.a @@\
* library.
*/
#define PrelinkedRelocatableTarget(objname,objlist,libs) @!\
->RM @!\
->LD @!\
->JLKFLAGS @!\
AllTarget(objname.o) @!\
@!\
objname.o: objlist @@\
$(RM) $@ @@\
- $(LD) $(JLKFLAGS) -r objlist -o $@ libs
+ $(LD) $(JLDFLAGS) -r objlist -o $@ libs
/*
+ * NormalObjectTarget:
+ * Generate rules to produce a single object file.o from a file.c.
+ */
+#define NormalObjectTarget(file) @!\
+++SOURCES file^^.c @!\
+AllTarget(file^^.o) @!\
+NormalObjectRule()
+
+/*
* NormalRelocatableTarget:
* Generate rules to produce a relocatable object file instead of a
* library.
*/
#define NormalRelocatableTarget(objname,objlist) @!\
->RM @!\
->LD @!\
->JLKFLAGS @!\
AllTarget(objname.o) @!\
@!\
objname.o: objlist @@\
$(RM) $@ @@\
- $(LD) $(JLKFLAGS) -r objlist -o $@
+ $(LD) $(JLDFLAGS) -r objlist -o $@
/*
@@ -1137,8 +1057,6 @@ objname.o: objlist @@\
* instead of a library.
*/
#define ProfiledRelocatableTarget(objname,objlist) @!\
->RM @!\
->LD @!\
AllTarget(objname^^_p.o) @!\
@!\
objname^^_p.o: objlist @@\
@@ -1152,8 +1070,6 @@ objname^^_p.o: objlist @@\
* instead of a library.
*/
#define DebuggedRelocatableTarget(objname,objlist) @!\
->RM @!\
->LD @!\
AllTarget(objname^^_d.o) @!\
@!\
objname^^_d.o: objlist @@\
@@ -1166,8 +1082,6 @@ objname^^_d.o: objlist @@\
* library is always forced to be newer than the library itself.
*/
#define LintLibraryTarget(libname,srclist) @!\
->RM @!\
->LINT @!\
lintlib:: llib-l^^libname.ln @!\
@!\
llib-l^^libname.ln: srclist @@\
@@ -1180,7 +1094,6 @@ llib-l^^libname.ln: srclist @@\
* Generate rules to lint a set of sources.
*/
#define NormalLintTarget(srclist) @!\
->LINT @!\
lint: @@\
$(LINT) $(LINTFLAGS) srclist $(LINTLIBS)
@@ -1200,8 +1113,6 @@ NormalLintTarget($(SOURCES)) @!\
* Snag source file from some other directory
*/
#define LinkSourceFile(src,dir) @!\
->RM @!\
->LN @!\
src: dir/src @@\
$(RM) $@ @@\
$(LN) $? $@ @!\
@@ -1212,13 +1123,11 @@ src: dir/src @@\
* Make includes in sub directories.
*/
#define MakeSubincludesForBuild(step,dir,srclist) @!\
->RM @!\
->LN @!\
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 .); \ @@\
+ (set -x; cd dir; $(LN) ../$$i .) || exit 1; \ @@\
done @!\
@!\
MakeDirectories(dir,dir) @!\
@@ -1226,7 +1135,7 @@ MakeDirectories(dir,dir) @!\
local_realclean:: @@\
@-(if [ -d dir ]; then \ @@\
list=`echo srclist | sed -e 's/[^ ]*\///g'`; \ @@\
- set -x; cd dir; $(RM) $$list; else exit 0; fi)
+ set -x; cd dir; $(RM) $$list; fi)
/*
@@ -1235,13 +1144,12 @@ local_realclean:: @@\
* verbose message and $(FLAGS) as additional flags.
*/
#define CommonSubdirsRule(dirs) @!\
->MAKE @!\
subdirs: @@\
@case '${MFLAGS}' in *[ik]*) set +e;; *) set -e;; esac; \ @@\
for i in dirs ;\ @@\
do \ @@\
(cd $$i ; echo $(VERB) "in $(DIR)$$i..."; \ @@\
- $(MAKE) $(MFLAGS) $(FLAGS) $(TARGET)) || false; \ @@\
+ $(MAKE) $(MFLAGS) $(FLAGS) $(TARGET)) || exit 1; \ @@\
done
@@ -1250,13 +1158,12 @@ subdirs: @@\
* Recursively make a series of steps in the specified directories.
*/
#define NamedTargetSubdirsRule(dirs,name,verb,flags) @!\
->MAKE @!\
name:: @@\
@case '${MFLAGS}' in *[ik]*) set +e;; *) set -e;; esac; \ @@\
for i in dirs ;\ @@\
do \ @@\
(cd $$i ; echo verb "in $(DIR)$$i..."; \ @@\
- $(MAKE) $(MFLAGS) flags name) || false; \ @@\
+ $(MAKE) $(MFLAGS) flags name) || exit 1; \ @@\
done
@@ -1265,20 +1172,27 @@ name:: @@\
* Recursively make a series of steps.
*/
#define NamedTargetSubdirs(name,verb,flags) @!\
->MAKE @!\
-name:: @@\
+name:: @@\
@$(MAKE) subdirs TARGET=name VERB=verb FLAGS=flags
/*
- * NamedCleanTargetSubdirs:
- * Recursively make a series of cleaning. We first clean the
- * subdirectories, in case the Makefile is removed by the
- * clean entry.
+ * NamedSubTargetSubdirs:
+ * Recursively make a series of steps, like NamedTargetSubdirs.
+ * However, the supplied "name" has "sub_" prefixed to it.
+ */
+#define NamedSubTargetSubdirs(name,verb,flags) @!\
+sub_^^^name:: @@\
+ @$(MAKE) subdirs TARGET=name VERB=verb FLAGS=flags
+
+/*
+ * NamedDepthTargetSubdirs:
+ * Recursively make a series of steps. We first enter the
+ * subdirectories, then perform the local entries.
+ * The supplied "name" has "sub_" prefixed to it.
*/
-#define NamedCleanTargetSubdirs(name,verb,flags) @!\
->MAKE @!\
-sub_^^name:: @@\
+#define NamedDepthTargetSubdirs(name,verb,flags) @!\
+sub_^^^name:: @@\
@$(MAKE) subdirs TARGET=name VERB=verb FLAGS=flags @@\
@echo "Back to $(CURRENT) for "name^^...
@@ -1315,8 +1229,8 @@ DependDirs($(SUBDIRS))
* files.
*/
#define InstallSubdirs() \
-NamedTargetSubdirs(install,"Installing",^^) @!\
-NamedTargetSubdirs(deinstall,"Deinstalling",^^)
+NamedSubTargetSubdirs(install,"Installing",^^) @!\
+NamedDepthTargetSubdirs(deinstall,"Deinstalling",^^)
/*
@@ -1324,8 +1238,8 @@ NamedTargetSubdirs(deinstall,"Deinstalling",^^)
* Generate rules to recursively install and deinstall manual pages.
*/
#define InstallManSubdirs() \
-NamedTargetSubdirs(install.man,"Installing man pages",^^) @!\
-NamedTargetSubdirs(deinstall.man,"Deinstalling man pages",^^)
+NamedSubTargetSubdirs(install.man,"Installing man pages",^^) @!\
+NamedDepthTargetSubdirs(deinstall.man,"Deinstalling man pages",^^)
/*
@@ -1341,9 +1255,9 @@ NamedTargetSubdirs(includes,including,^^)
* Generate rules to recursively clean out garbage files.
*/
#define CleanSubdirs() \
-NamedCleanTargetSubdirs(clean,"Cleaning",^^) @!\
-NamedCleanTargetSubdirs(realclean,"Real cleaning",^^) @!\
-NamedCleanTargetSubdirs(clobber,"Clobbering",^^)
+NamedDepthTargetSubdirs(clean,"Cleaning",^^) @!\
+NamedDepthTargetSubdirs(realclean,"Real cleaning",^^) @!\
+NamedDepthTargetSubdirs(clobber,"Clobbering",^^)
/*
@@ -1383,14 +1297,54 @@ LintDirs($(SUBDIRS))
/*
* MakeDirs:
* Creates a set of directories, even if some directories in the path
- * do not already exist.There should be no '@!' at the end of the
+ * do not already exist. There should be no '@!' at the end of the
+ * '#define' line, because this macro is used *inside* building rules.
+ */
+#define MakeDirs(dirs) \
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
+ for dir in dirs; do \ @@\
+ (set -x; test -d $$dir || $(INSTALLDIR) $$dir) || \ @@\
+ exit 1; \ @@\
+ done
+
+/*
+ * _MakeInstallDirs:
+ * Creates a set of intall directories, even if some directories in the path
+ * do not already exist. There should be no '@!' at the end of the
* '#define' line, because this macro is used *inside* building rules.
*/
-#define MakeDirs(dirs) \
->INSTALLDIR @@\
- @for dir in dirs; do \ @@\
- case '${MFLAGS}' in *[i]*) set +e;; *) set -e;; esac; \ @@\
- (set -x; test -d $$dir || $(INSTALLDIR) $$dir); \ @@\
+#define _MakeInstallDirs(dirs) \
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
+ for dir in dirs; do \ @@\
+ _MakeInstallDir($$dir) \ @@\
+ done
+
+/*
+ * _MakeInstallDir:
+ * Internal macro to create a missing install directory.
+ */
+#define _MakeInstallDir(dir) \
+ (set -x; test -d $(INSTALL_PREFIX)^^^dir || \ @@\
+ $(INSTALLDIR) $(INSTALL_PREFIX)^^^dir);
+
+/*
+ * _MakeInstallDirIgnore:
+ * Same as _MakeInstallDir but handles "make -i" as well.
+ */
+#define _MakeInstallDirIgnore(dir) \
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
+ _MakeInstallDir(dir)
+
+/*
+ * _RmInstallDirs:
+ * Removes a set of intall directories.
+ * There should be no '@!' at the end of the '#define' line, because this
+ * macro is used *inside* building rules.
+ */
+#define _RmInstallDirs(dirs) \
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
+ for dir in dirs; do \ @@\
+ (set -x; test -d $$dir && $(RM) -r $(INSTALL_PREFIX)$$dir); \ @@\
done
/*
@@ -1408,12 +1362,11 @@ step:: @@\
* time (removed by deinstall).
*/
#define MakeInstallDirectories(dirs) @!\
->RM @!\
-install:: @@\
- MakeDirs(dirs) @!\
- @!\
-deinstall:: @@\
- $(RM) -r dirs
+local_install:: @@\
+ _MakeInstallDirs(dirs) @!\
+ @!\
+local_deinstall:: @@\
+ _RmInstallDirs(dirs)
/*
@@ -1432,7 +1385,6 @@ MakeLintSubdirs(dirs,lintlib)
* not rely on the existence of a Makefile.
*/
#define MakeMakeSubdirs(target) @!\
->MAKE @!\
target:: @@\
@case '${MFLAGS}' in *[ik]*) set +e;; *) set -e;; esac; \ @@\
for i in $(SUBDIRS);\ @@\
@@ -1440,7 +1392,7 @@ target:: @@\
echo "Making "target" in $(DIR)$$i..."; \ @@\
(cd $$i || exit 1; \ @@\
if test ! -f Makefile; then /bin/sh Makefile.SH; fi; \ @@\
- $(MAKE) $(MFLAGS) target) || false\ @@\
+ $(MAKE) $(MFLAGS) target) || exit 1;\ @@\
done
@@ -1452,7 +1404,6 @@ target:: @@\
* outside of the source tree to be much easier.
*/
#define MakeMakefilesSH() @!\
->MAKE @!\
Makefiles.SH:: Makefile.SH @@\
@case '${MFLAGS}' in *[ik]*) set +e;; *) set -e;; esac; \ @@\
for i in $(SUBDIRS);\ @@\
@@ -1467,9 +1418,13 @@ Makefiles.SH:: Makefile.SH @@\
/^^*) newtop="$(TOP)" ;; \ @@\
esac; \ @@\
echo "Making Makefiles.SH in $(DIR)$$i..."; \ @@\
- (cd $$i || exit 1; $(MAKE) $(MFLAGS) -f ../Makefile \ @@\
- Makefile TOP=$$newtop CURRENT=$(DIR)$$i;\ @@\
- $(MAKE) $(MFLAGS) Makefiles.SH) \ @@\
+ (cd $$i || exit 1; \ @@\
+ if test -f Jmakefile; then \ @@\
+ $(MAKE) $(MFLAGS) -f ../Makefile \ @@\
+ Makefile TOP=$$newtop CURRENT=$(DIR)$$i && \ @@\
+ $(MAKE) $(MFLAGS) Makefiles.SH; \ @@\
+ fi; \ @@\
+ ) || exit 1; \ @@\
done
@@ -1488,8 +1443,6 @@ MakeMakefilesSH()
* through cpp.
*/
#define CppScriptTarget(dst,src,defs,deplist) @!\
->RM @!\
->CPP @!\
dst:: src deplist @@\
$(RM) $@ @@\
$(CPP) defs <src | \ @@\
@@ -1537,7 +1490,6 @@ ShellScriptTargetExt(scripts,.SH)
* extension you like..
*/
#define SimpleShellScriptTargetExt(scripts,ext) @!\
->RM @!\
AllTarget(scripts) @!\
@!\
|expand s!scripts! @!\
@@ -1563,8 +1515,6 @@ SimpleShellScriptTargetExt(scripts,.SH)
* extension would not leave enough space for RCS ,v extension).
*/
#define ShellScriptLongTarget(basename,scriptname) @!\
->RM @!\
->MANSRC @!\
++LSCRIPTS scriptname @!\
AllTarget(scriptname) @!\
@!\
@@ -1596,9 +1546,8 @@ InstallManPageLong(basename,$(MANSRC),scriptname) @!\
* and forces a make of that dependency in the remote directory.
*/
#define RemoteTargetDependency(target,directory,dependency) @!\
->MAKE @!\
RemoteDependency(directory,dependency) @!\
-target: directory/dependency @!\
+target: directory/^^^dependency @!\
/*
@@ -1606,12 +1555,11 @@ target: directory/dependency @!\
* Specify rules for making a remote dependency.
*/
#define RemoteDependency(directory,dependency) @!\
->MAKE @!\
ForceTarget() @!\
-|once =directory/dependency= @!\
-directory/dependency: .FORCE @@\
- @echo "Checking "dependency" in "directory"..." @@\
- cd directory; $(MAKE) dependency @@\
+|once =directory/^^^dependency= @!\
+directory/^^^dependency: .FORCE @@\
+ @echo "Checking "^^^dependency" in "^^^directory"..." @@\
+ cd ^^^directory; $(MAKE) ^^^dependency @@\
@echo "Continuing in $(CURRENT)..." @!\
@!\
-once
@@ -1674,10 +1622,6 @@ AddSuffix(.y) @!\
* derived from the source file basename provided.
*/
#define SimpleYaccTarget(program,base) @!\
->JYFLAGS @!\
->YACC @!\
->RM @!\
->MV @!\
++SOURCES base.y @!\
++OBJECTS base.o @!\
YaccRule() @!\
@@ -1697,10 +1641,6 @@ local_realclean:: @@\
* where all the 'yy' are replaced by the specified prefix.
*/
#define ComplexYaccTarget(program,base,prefix) @!\
->JYFLAGS @!\
->YACC @!\
->RM @!\
->SED @!\
++SOURCES base.y @!\
++OBJECTS base.o @!\
program: base.c @!\
@@ -1724,14 +1664,10 @@ local_realclean:: @@\
* to be manually given in the Jmakefile.
*/
#define SimpleYaccInclude(base) @!\
->MV @!\
->RM @!\
base.h: base.c @@\
@if test -f y.tab.h; then \ @@\
echo " $(MV) y.tab.h $@"; \ @@\
$(MV) y.tab.h $@; \ @@\
- else \ @@\
- exit 0; \ @@\
fi @!\
@!\
local_realclean:: @@\
@@ -1748,9 +1684,6 @@ local_realclean:: @@\
* to be manually given in the Jmakefile.
*/
#define ComplexYaccInclude(base,prefix) @!\
->RM @!\
->SED @!\
->CP @!\
base.h: base.c @@\
@if test -f y.tab.h; then \ @@\
echo " $(SED) -e 's/yy\(.\)/prefix\1/g' < y.tab.h > base.h"; \ @@\
@@ -1764,8 +1697,6 @@ base.h: base.c @@\
$(SED) -e 's/yy\(.\)/prefix\1/g' < base.ht > base.h; \ @@\
echo " $(RM) base.ht"; \ @@\
$(RM) base.ht; \ @@\
- else \ @@\
- exit 0; \ @@\
fi @!\
@!\
local_realclean:: @@\
@@ -1802,10 +1733,6 @@ ComplexYaccInclude(base,prefix)
* lex to produce a base.c file.
*/
#define SimpleLexTarget(program,base) @!\
->JLFLAGS @!\
->LEX @!\
->RM @!\
->MV @!\
++SOURCES base.l @!\
++OBJECTS base.o @!\
|once _LexRule_ @!\
@@ -1828,10 +1755,6 @@ local_realclean:: @@\
* the 'yy', so that the lexical analyzer may be identified.
*/
#define IdentifiedLexTarget(program,base,prefix) @!\
->JLFLAGS @!\
->LEX @!\
->RM @!\
->SED @!\
++SOURCES base.l @!\
++OBJECTS base.o @!\
program: base.c @!\
diff --git a/jmake/files/Jmake.tmpl b/jmake/files/Jmake.tmpl
index dceb604..80549b5 100644
--- a/jmake/files/Jmake.tmpl
+++ b/jmake/files/Jmake.tmpl
@@ -1,15 +1,15 @@
/*
* Generic jmake template
*
- * $Id: Jmake.tmpl,v 3.0.1.3 1997/02/28 14:56:16 ram Exp $
+ * $Id$
*
- * Copyright (c) 1991-1993, Raphael Manfredi
+ * Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
*
* You may redistribute only under the terms of the Artistic Licence,
* as specified in the README file that comes with the distribution.
* You may reuse parts of this distribution only within the terms of
* that same Artistic Licence; a copy of which may be found at the root
- * of the source tree for dist 3.0.
+ * of the source tree for dist 4.0.
*
* $Log: Jmake.tmpl,v $
* Revision 3.0.1.3 1997/02/28 14:56:16 ram
@@ -27,7 +27,7 @@
*/
: Makefile.SH generated from Jmake.tmpl and Jmakefile <TAG>
-: $Id: Jmake.tmpl,v 3.0.1.3 1997/02/28 14:56:16 ram Exp $
+: $Id$
/*************************************************************************
* *
@@ -83,10 +83,14 @@ DIR = $DIR
?AR:AR = ar rc /* FIXME */
?BINDIR:BINDIR = $installbin
?CC:CC = $cc
+?CHMOD:CHMOD = $chmod
?CP:CP = $cp
?CPP:CPP = $cpp $cppminus $cppflags
?CTAGS:CTAGS = ctags /* FIXME */
+?_EXE:_EXE = $_exe
+?INSTALLPREFIX:INSTALLPREFIX = $prefix
?JCFLAGS:JCFLAGS = \$(CFLAGS) $optimize $ccflags $large
+?JCPPFLAGS:JCPPFLAGS = $cppflags
?JLDFLAGS:JLDFLAGS = \$(LDFLAGS) $optimize $ldflags
?JLFLAGS:JLFLAGS = \$(LFLAGS)
?JYFLAGS:JYFLAGS = \$(YFLAGS) $yaccflags
@@ -97,8 +101,8 @@ DIR = $DIR
?LINT:LINT = lint
?LN:LN = $ln
?MANSRC:MANSRC = $installmansrc
-?MAKE:MAKE = make /* Otherwise $(MAKE) doesn't work on SONY */
-?MKDEP:MKDEP = $mkdep \$(DPFLAGS) --
+?MAKE:$make_set_make
+?MKDEP:MKDEP = $mkdep \$(DPFLAGS) \$(JCPPFLAGS) --
?MV:MV = $mv
?PRIVLIB:PRIVLIB = $installprivlib
?RANLIB:RANLIB = $ranlib
@@ -147,9 +151,41 @@ all:: .FORCE_DEPEND
* These need to be here so that rules in Jmakefile occur first; the blank
* all is to make sure that an empty Jmakefile doesn't default to make clean.
*/
-emptyrule::
+all::
CleanTarget()
+InstallTarget()
+
+/*
+ * The installation of manual pages is optional. When they say "none" in
+ * Configure, then they don't want any manual page and $installmansrc will
+ * be empty.
+ *
+ * To avoid protecting all the jmake rules for an empty destination, we use
+ * this clever hack: there is an "install.man-no" and an "install.man-yes"
+ * target defined, where the first does nothing and the second triggers
+ * the local install. The same goes for deinstall.
+ *
+ * If the `MANSRC' symbol is not wanted, then there is no manual page
+ * and we can force the -no version of the targets.
+ */
+%MANSRC:|skip /* Skip if no manual targets */
+!NO!SUBS!
+case "$installmansrc" in
+'') man=no;;
+*) man=yes;;
+esac
+$spitshell >>Makefile <<!GROK!THIS!
+maybe_install.man: install.man-$man
+maybe_deinstall.man: deinstall.man-$man
+!GROK!THIS!
+$spitshell >>Makefile <<'!NO!SUBS!'
+-skip
+?MANSRC:|skip /* Skip if it has manual targets */
+maybe_install.man: install.man-no
+maybe_deinstall.man: deinstall.man-no
+-skip
+
MakefileTarget()
TagsTarget()
@@ -165,21 +201,30 @@ TagSubdirs($(SUBDIRS))
MakefileSubdirs()
MakeSubdirs()
+/*
+ * Empty rules in case they don't define anything to be installed
+ * in this directory.
+ */
+local_install::
+local_deinstall::
+local_install.man::
+local_deinstall.man::
+
-skip /* Sub-directories */
?SUBDIRS:|skip /* Skip if sub-directories */
;########################################################################
;# Empty rules for directories with no sub-directories -- do not edit
-install::
+local_install::
@echo "install in $(CURRENT) done."
-deinstall::
+local_deinstall::
@echo "deinstall in $(CURRENT) done."
-install.man::
+local_install.man::
@echo "install.man in $(CURRENT) done."
-deinstall.man::
+local_deinstall.man::
@echo "deinstall.man in $(CURRENT) done."
/*