summaryrefslogtreecommitdiff
path: root/jmake
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
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')
-rw-r--r--jmake/Jmakefile12
-rwxr-xr-x[-rw-r--r--]jmake/Makefile.SH198
-rwxr-xr-xjmake/bindex.SH7
-rw-r--r--jmake/files/Jmake.rules649
-rw-r--r--jmake/files/Jmake.tmpl67
-rwxr-xr-x[-rw-r--r--]jmake/fixcpp.SH15
-rwxr-xr-xjmake/jmake.SH195
-rw-r--r--jmake/jmake.man113
-rwxr-xr-xjmake/jmkmf.SH53
-rw-r--r--jmake/jmkmf.man20
10 files changed, 799 insertions, 530 deletions
diff --git a/jmake/Jmakefile b/jmake/Jmakefile
index 5fdb3eb..ae82b24 100644
--- a/jmake/Jmakefile
+++ b/jmake/Jmakefile
@@ -2,15 +2,15 @@
* Jmakefile for jmake
*/
-;# $Id: Jmakefile,v 3.0.1.2 1995/03/21 08:34: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: Jmakefile,v $
;# Revision 3.0.1.2 1995/03/21 08:34:16 ram
@@ -32,8 +32,6 @@ Index: bindex
ShellScriptTarget(jmake jmkmf)
SimpleShellScriptTarget(bindex fixcpp)
->PRIVLIB /* We need the privlib definition */
-
MakeInstallDirectories($(PRIVLIB) $(PRIVLIB)/files)
InstallNonExec(Index,$(PRIVLIB))
InstallScript(bindex,$(PRIVLIB))
@@ -42,10 +40,6 @@ InstallMultipleFlags(files/Jmake*,$(PRIVLIB)/files,-m 444)
BINSH = jmake.SH fixcpp.SH
->SED
->RM
->MKDEP
-
depend::
($(SED) '/^# DO NOT DELETE/q' Makefile && \
grep '^\$$grep' $(BINSH) | \
diff --git a/jmake/Makefile.SH b/jmake/Makefile.SH
index 987b3ab..6a651e3 100644..100755
--- a/jmake/Makefile.SH
+++ b/jmake/Makefile.SH
@@ -1,5 +1,6 @@
-: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.0 PL51]
-: $X-Id: Jmake.tmpl,v 3.0.1.2 1995/01/11 14:50:21 ram Exp ram $
+: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.5 PL0]
+: $X-Id: Jmake.tmpl 8 2006-08-25 22:27:18Z rmanfredi $
+
case $CONFIG in
'')
if test -f config.sh; then TOP=.;
@@ -40,10 +41,9 @@ INSTALLDIR = $INSTALLDIR
# Parameters set by Configure -- edit config.sh if changes are needed
CTAGS = ctags
+JCPPFLAGS = $cppflags
L = $manext
MANSRC = $installmansrc
-MAKE = make
-MKDEP = $mkdep \$(DPFLAGS) --
MV = $mv
PRIVLIB = $installprivlib
RM = $rm -f
@@ -59,26 +59,20 @@ SCRIPTS = jmake jmkmf
$spitshell >>Makefile <<'!NO!SUBS!'
########################################################################
# Jmake rules for building libraries, programs, scripts, and data files
-# $X-Id: Jmake.rules,v 3.0.1.2 1995/01/11 14:49:55 ram Exp ram $
-########################################################################
-# Force 'make depend' to be performed first -- do not edit
-
-.FORCE_DEPEND::
-
-all:: .FORCE_DEPEND
+# $X-Id: Jmake.rules 8 2006-08-25 22:27:18Z rmanfredi $
########################################################################
# Start of Jmakefile
-# $X-Id: Jmakefile,v 3.0.1.2 1995/03/21 08:34:16 ram Exp ram $
+# $X-Id: Jmakefile 3 2006-08-25 21:39:07Z rmanfredi $
+#
+# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
#
-# Copyright (c) 1991-1993, 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.
#
# $X-Log: Jmakefile,v $
# Revision 3.0.1.2 1995/03/21 08:34:16 ram
@@ -112,34 +106,40 @@ jmkmf: jmkmf.SH
/bin/sh jmkmf.SH
-install:: $(SCRIPTS) $(LSCRIPTS)
- @for file in $(SCRIPTS) $(LSCRIPTS); do \
- case '${MFLAGS}' in *[i]*) set +e;; esac; \
- (set -x; $(INSTALL) -c -m 555 $$file $(SCRIPTDIR)); \
+local_install:: $(SCRIPTS) $(LSCRIPTS)
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(SCRIPTDIR) || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(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;; esac; \
- (set -x; $(RM) $(SCRIPTDIR)/$$file); \
+ case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; $(RM) $(INSTALL_PREFIX)$(SCRIPTDIR)/$$file); \
done
-install.man::
- @if test "$(MANSRC)"; then \
- case '${MFLAGS}' in *[i]*) set +e;; esac; \
+local_install.man::
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(MANSRC) || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(MANSRC)); \
for file in $(SCRIPTS); do \
- (set -x; \
- $(INSTALL) -c -m 444 $$file.man $(MANSRC)/$$file.$(L)); \
- done; \
- else exit 0; fi
+ 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 \
+local_deinstall.man::
case '${MFLAGS}' in *[i]*) set +e;; esac; \
for file in $(SCRIPTS); do \
- (set -x; $(RM) $(MANSRC)/$$file.$(L)); \
- done; \
- else exit 0; fi
+ (set -x; $(RM) $(INSTALL_PREFIX)$(MANSRC)/$$file.$(L)); \
+ done
all:: bindex fixcpp
@@ -153,43 +153,59 @@ fixcpp: fixcpp.SH
/bin/sh fixcpp.SH
-install::
- @for dir in $(PRIVLIB) $(PRIVLIB)/files; do \
- case '${MFLAGS}' in *[i]*) set +e;; esac; \
- (set -x; test -d $$dir || $(INSTALLDIR) $$dir); \
+local_install::
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ for dir in $(PRIVLIB) $(PRIVLIB)/files; do \
+ (set -x; test -d $(INSTALL_PREFIX)$$dir || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \
done
-deinstall::
- $(RM) -r $(PRIVLIB) $(PRIVLIB)/files
-
-install:: Index
- $(INSTALL) -c -m 444 Index $(PRIVLIB)
-
-deinstall::
- $(RM) $(PRIVLIB)/Index
-
-install:: bindex
- $(INSTALL) -c -m 555 bindex $(PRIVLIB)
-
-deinstall::
- $(RM) $(PRIVLIB)/bindex
-
-install:: fixcpp
- $(INSTALL) -c -m 555 fixcpp $(PRIVLIB)/files
-
-deinstall::
- $(RM) $(PRIVLIB)/files/fixcpp
-
-install:: files/Jmake*
+local_deinstall::
@case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ for dir in $(PRIVLIB) $(PRIVLIB)/files; do \
+ (set -x; test -d $$dir && $(RM) -r $(INSTALL_PREFIX)$$dir); \
+ done
+
+local_install:: Index
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB) || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)); \
+ $(INSTALL) -c -m 444 Index $(INSTALL_PREFIX)$(PRIVLIB)
+
+local_deinstall::
+ $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/Index
+
+local_install:: bindex
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB) || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)); \
+ $(INSTALL) -c -m 555 bindex $(INSTALL_PREFIX)$(PRIVLIB)
+
+local_deinstall::
+ $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/bindex
+
+local_install:: fixcpp
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB)/files || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)/files); \
+ $(INSTALL) -c -m 555 fixcpp $(INSTALL_PREFIX)$(PRIVLIB)/files
+
+local_deinstall::
+ $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/files/fixcpp
+
+local_install:: files/Jmake*
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB)/files || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)/files); \
for i in files/Jmake*; do \
- (set -x; $(INSTALL) -c -m 444 $$i $(PRIVLIB)/files); \
+ (set -x; $(INSTALL) -c -m 444 \
+ $$i $(INSTALL_PREFIX)$(PRIVLIB)/files) || exit 1;\
done
-deinstall::
+local_deinstall::
@case '${MFLAGS}' in *[i]*) set +e;; esac; \
for i in files/Jmake*; do \
- (set -x; $(RM) $(PRIVLIB)/files/$$i); \
+ (set -x; $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/files/$$i); \
done
BINSH = jmake.SH fixcpp.SH
@@ -206,29 +222,51 @@ depend::
########################################################################
# Common rules for all Makefiles -- do not edit
-emptyrule::
+all::
clean: local_clean
realclean: local_realclean
clobber: local_clobber
local_clean::
- $(RM) core *~ *.o
+ if test -f core; then $(RM) core; fi
+ $(RM) *~ *.o
local_realclean:: local_clean
local_clobber:: local_realclean
$(RM) Makefile config.sh
+install:: local_install
+install.man:: maybe_install.man
+deinstall:: local_deinstall
+deinstall.man:: maybe_deinstall.man
+
+install.man-yes: local_install.man
+install.man-no:
+deinstall.man-yes: local_deinstall.man
+deinstall.man-no:
+
+!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!'
+
Makefile.SH: Jmakefile
-@if test -f $(TOP)/.package; then \
- if test -f Makefile.SH; then \
- echo " $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~"; \
- $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~; \
- fi; \
- echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \
- $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \
- else touch $@; exit 0; fi
+ if test -f Makefile.SH; then \
+ echo " $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~"; \
+ $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~; \
+ fi; \
+ echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \
+ $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \
+ else touch $@; fi
Makefile: Makefile.SH
/bin/sh Makefile.SH
@@ -243,28 +281,22 @@ local_clobber::
########################################################################
# 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."
+
Makefiles::
Makefiles.SH::
-########################################################################
-# Dependencies generated by make depend
-# DO NOT DELETE THIS LINE -- make depend relies on it
-
-# Put nothing here or make depend will gobble it up
-.FORCE_DEPEND::
- @echo "You must run 'make depend' in $(TOP) first."; exit 1
!NO!SUBS!
chmod 644 Makefile
$eunicefix Makefile
diff --git a/jmake/bindex.SH b/jmake/bindex.SH
index f419d78..3905f85 100755
--- a/jmake/bindex.SH
+++ b/jmake/bindex.SH
@@ -22,15 +22,15 @@ $spitshell >>bindex <<'!NO!SUBS!'
eval 'exec perl -S $0 "$@"'
if $runnning_under_some_shell;
-# $Id: bindex.SH,v 3.0.1.1 1993/08/19 06:42:12 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: bindex.SH,v $
# Revision 3.0.1.1 1993/08/19 06:42:12 ram
@@ -103,6 +103,7 @@ while (<RULES>) {
s/\|suffix/.SUFFIXES:/; # Make suffix command explicit
s/\t/ /g; # Expand all tabs to 4 chars
s/\s*$/\n/; # Remove any trailing space
+ s|\^\^\^|/***/|; # Change ^^^ to the more visual /***/
s|\^\^|/**/|; # Restore ^^ to the more visual /**/
if (/^$/) { # If empty line
$Index{$current} .= "\n" if $last_was_text;
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."
/*
diff --git a/jmake/fixcpp.SH b/jmake/fixcpp.SH
index 804325b..f3e8db5 100644..100755
--- a/jmake/fixcpp.SH
+++ b/jmake/fixcpp.SH
@@ -20,15 +20,15 @@ $startperl
eval 'exec perl -S \$0 "\$@"'
if \$runnning_under_some_shell;
-# $Id: fixcpp.SH,v 3.0.1.1 1995/03/21 08:35:37 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: fixcpp.SH,v $
# Revision 3.0.1.1 1995/03/21 08:35:37 ram
@@ -43,7 +43,7 @@ $startperl
# This program is meant to be called from jmake. All it does is pre-process
# the file it is given as argument, focusing on #include directives and
# resolving them as cpp would (but without the #line stuff since we don't
-# really care about it), escaping all the trailing \ into '\ ^M'. The resulting
+# really care about it), escaping all the trailing \ into '\ ^A'. The resulting
# temporary file is then handed off to the real cpp for macro processing, and
# the output is printed on stdout, after restoration of any original trailing \.
# Again, thanks HP-UX for making this so challenging and exciting... :-)
@@ -52,9 +52,10 @@ $startperl
# in macros and must go away some way or the other. Also trailing backslashes
# on #define lines are really continuations and are left un-escaped.
-\$cpp = '$cpp';
+\$cpp = '$cpp_trad';
\$version = '$VERSION';
\$patchlevel = '$PATCHLEVEL';
+\$revision = '$REVISION';
!GROK!THIS!
$spitshell >>fixcpp <<'!NO!SUBS!'
@@ -135,7 +136,7 @@ sub escape {
# Don't escape trailing backslashes in macro definition or cpp
# won't see them as macro continuation any longer, and also within
# macro definitions, all those @@ or @! continuations...
- s/\\$/\\ \015/ unless /\@[!@]\\$/ || /^#define/;
+ s/\\$/\\ \001/ unless /\@[!@]\\$/ || /^#define/;
}
# Append file to given (opened) file descriptor
@@ -172,7 +173,7 @@ sub cpp {
local($file) = @_;
open(CPP, "$cpp $cpp_opt $file |") || die "Can't fork: $!\n";
while (<CPP>) {
- s/\\ \015$/\\/; # Un-escape trailing \
+ s/\\ \001$/\\/; # Un-escape trailing \
print STDOUT;
}
close CPP;
diff --git a/jmake/jmake.SH b/jmake/jmake.SH
index 38a49eb..b6d1277 100755
--- a/jmake/jmake.SH
+++ b/jmake/jmake.SH
@@ -20,17 +20,30 @@ $startperl
eval 'exec perl -S \$0 "\$@"'
if \$runnning_under_some_shell;
-# $Id: jmake.SH,v 3.0.1.6 1995/09/25 09:08: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.SH,v $
+# Revision 3.0.1.9 2004/08/22 09:01:42 ram
+# patch71: renamed |test as |case as the construct has its syntax
+# patch71: added |subst section to allow variable substitutions
+#
+# Revision 3.0.1.8 2004/08/21 23:19:46 ram
+# patch71: added '|shell' section to emit verbatim code in Makefile.SH
+# patch71: new '|test' to conditionally generate Makefile sections
+#
+# Revision 3.0.1.7 2004/08/21 20:59:57 ram
+# patch71: replaced old "do foo()" with modern "&foo()" syntax
+# patch71: take care of junk emitted by GNU make when running commands
+# patch71: new ^^^ escape sequence, removing extra spaces afterwards
+#
# Revision 3.0.1.6 1995/09/25 09:08:01 ram
# patch59: will now force macro definitions to the left
#
@@ -58,6 +71,7 @@ $startperl
\$cpp = '$cpp';
\$version = '$VERSION';
\$patchlevel = '$PATCHLEVEL';
+\$revision = '$REVISION';
!GROK!THIS!
$spitshell >>jmake <<'!NO!SUBS!'
@@ -73,6 +87,18 @@ while ($ARGV[0] =~ /^-/) {
}
$cpp_opt .= "-I$dir";
+# Pass 0 is looking at the template for "?CP:CP =" lines that are to be
+# emitted if the CP variable is needed. Later on, when we see $(CP) being
+# used, we'll be able to set the $symbol{CP} entry to 1 to have the CP
+# variable initialized by the template.
+
+open(TMPL, $file) || die "$me: can't open $file: $!\n";
+while (<TMPL>) {
+ next unless /^\?([\w_]+):\1\s+=/;
+ $wanted{$1}++;
+}
+close TMPL;
+
# Thank you HP-UX for having a cpp that blindly strips trailing backslashes
# in the text. Run through cpp by using the fixcpp script...
@@ -104,9 +130,12 @@ while (<CPP>) {
# Restore possibly escaped C comments
s|/#\*|/*|g;
s|\*#/|*/|g;
+ # Remove all ^^^ (null space character) up to next non-space character
+ s|\^\^\^\s*||g;
# Remove all ^^ (null space character)
s|\^\^||g;
- # Restore escaped ^^ sequence
+ # Restore escaped ^^ and ^^^ sequences
+ s|\^\\\^\\\^|^^^|g;
s|\^\\\^|^^|g;
next if /^#\s+\d+/; # Skip cpp commments
@@ -115,13 +144,11 @@ while (<CPP>) {
s/@!\s?/\n/g;
s/@@\s?/\n\t/g;
- $* = 1;
# A '\r' is added to all lines, in order to let 'split' keep them
# As lines ending with '\' won't fit in the next regular
# expression (why ?), we have to treat that special case separately
- s/\n$/\r\n/g;
- s/\\\s*$/\\\r/g; # Remove spaces after final '\' and add '\r'
- $* = 0;
+ s/\n$/\r\n/gm;
+ s/\\\s*$/\\\r/gm; # Remove spaces after final '\' and add '\r'
@macro = split(/\n/);
for ($i = 0; $i <= $#macro; $i++) {
chop($_ = $macro[$i]); # Remove final '\r'
@@ -129,7 +156,10 @@ while (<CPP>) {
if (/^TOP\s*=\s*(\S+)/) { # Get the top from generated file
$top = $1;
}
+ find_wanted($_); # Look for known $(VAR) usage
if (s/^\s*>//) { # '>' means "symbol wanted"
+ warn "$me: the '>$_' construct is deprecated for known symbols\n"
+ if $wanted{$_} && !$warned_wanted_symbol_deprecated++;
$symbol{$_} = 1;
} elsif (s/^\s*\+//) { # '+' means "initialization section"
if (s/^\+(\w+)//) { # '++' means add to variable list
@@ -148,7 +178,7 @@ while (<CPP>) {
push(@makefile, "|$_"); # Skip handled in pass 2
} elsif (/^expand/) {
push(@makefile, "|$_"); # Expand handled in pass 2
- } elsif (/^once\s+(\S+)/) { # Once handled in pass 1
+ } elsif (/^once\s+(.*)/) { # Once handled in pass 1
if ($Once{$1}++) { # Symbol already seen -- skip
for (; $i <= $#macro; $i++) {
last if $macro[$i] =~/^-once/;
@@ -156,6 +186,12 @@ while (<CPP>) {
warn("$me: -once not found for $1")
unless $macro[$i] =~/^-once/;
}
+ } elsif (/^shell/) { # Escaping to shell
+ push(@makefile, "|$_"); # will be handled in pass 2
+ } elsif (/^case/) { # Conditional generation
+ push(@makefile, "|$_"); # will be handled in pass 2
+ } elsif (/^subst/) { # Section with var substitution
+ push(@makefile, "|$_"); # will be handled in pass 2
} else {
print "$me: Warning: unknown command $_\n";
}
@@ -173,13 +209,23 @@ $symbol{'INIT'} = 1 if ($#init >= 0 || $#key >=0); # Initializations
$symbol{'SUFFIX'} = 1 if ($#suffix >= 0 || $#rule >=0); # Rules or suffixes
$symbol{'TOP'} = 1 if $top eq '.'; # If imake invoked for the top
+$shellmode = 0; # Set to true within "shell" section
+$casemode = 0; # Counts nesting levels within "case" section
+$substmode = 0; # True when within section with variable substitution
+
+$SPIT_START = "\$spitshell >>Makefile <<'!NO!SUBS!'\n";
+$SPIT_END = "!NO!SUBS!\n";
+$GROK_START = "\$spitshell >>Makefile <<!GROK!THIS!\n";
+$GROK_END = "!GROK!THIS!\n";
+
open(MAKEFILE, ">Makefile.SH");
# We have to use for instead of foreach to handle 'skip' easily
line: for ($i = 0; $i <= $#makefile; $i++) {
$_ = $makefile[$i];
next if /^-skip|-expand/; # They might have made a mistake
- s/<TAG>/[jmake $version PL$patchlevel]/;
+ # Strip consecutive blank lines in generated file
+
if (/^\s*$/) {
next if ($last_was_blank);
$last_was_blank = 1;
@@ -187,6 +233,81 @@ line: for ($i = 0; $i <= $#makefile; $i++) {
$last_was_blank = 0;
}
+ # In shell mode, we're transparent, untill we reach a "-shell"
+ # We don't call print_makefile() as we don't want to record
+ # those non-makefile lines in the @Generated array.
+
+ if ($shellmode) {
+ if (/^-shell/) { # Ending shell mode, back to Makefile
+ print MAKEFILE $substmode ? $GROK_START : $SPIT_START;
+ $shellmode = 0;
+ } elsif (/^\|shell/) {
+ die "$me: can't nest 'shell' sections.\n";
+ } else {
+ print MAKEFILE "$_\n";
+ }
+ next;
+ } elsif (/^\|shell/) {
+ print MAKEFILE $substmode ? $GROK_END : $SPIT_END;
+ $shellmode = 1; # Next lines emitted verbatim as shell
+ next;
+ }
+
+ # In subst mode, the section until "-subst" is emitted regularily,
+ # excepted that it will be in a grok section, so its $var will be
+ # substituted by the shell.
+
+ if ($substmode) {
+ if (/^-subst/) { # Ending subst mode, back to regular
+ print MAKEFILE $GROK_END;
+ print MAKEFILE $SPIT_START;
+ $substmode = 0;
+ next;
+ } elsif (/^\|subst/) {
+ die "$me: can't nest 'subst' sections.\n";
+ }
+ # Continue with line
+ } elsif (/^\|subst/) {
+ print MAKEFILE $SPIT_END; # End spit section in Makefile.SH
+ print MAKEFILE $GROK_START;
+ $substmode = 1; # Next lines subject to $ interpretation
+ next;
+ }
+
+ # In a "case" section, the Makefile will be conditionally generated
+ # based on the value of the supplied variable, as evaluated by the shell.
+ # We can nest "case" sections without problems.
+
+ if (/^-case/) { # Ending current case section
+ if ($casemode == 0) {
+ warn "$me: ignoring spurious '-case'\n";
+ next;
+ }
+ print MAKEFILE $substmode ? $GROK_END : $SPIT_END;
+ my $indent = "\t" x ($casemode - 1);
+ print MAKEFILE "${indent}\t;;\n";
+ print MAKEFILE "${indent}esac\n";
+ print MAKEFILE "${indent}", $substmode ? $GROK_START : $SPIT_START;
+ $casemode--;
+ next;
+ }
+
+ if (/^\|case/) {
+ my ($var, $value) = /^\|case\s+(\w+)\s+in\s+(.*)/;
+ die "$me: unparseable directive '$_'\n" if $var eq '';
+ $casemode++;
+ print MAKEFILE $substmode ? $GROK_END : $SPIT_END;
+ my $indent = "\t" x ($casemode - 1);
+ print MAKEFILE "${indent}case \"\$$var\" in\n";
+ print MAKEFILE "${indent}$value)\n";
+ print MAKEFILE "${indent}\t", $substmode ? $GROK_START : $SPIT_START;
+ next;
+ }
+
+ # Process regular line to be generated in Makefile.SH
+
+ s/<TAG>/[jmake $version-$revision]/;
+
# Lines starting with ?SYMBOL: (resp. %SYMBOL:) are to be processed
# only if SYMBOL is defined (resp. undefined).
@@ -212,13 +333,13 @@ line: for ($i = 0; $i <= $#makefile; $i++) {
s/^\s+(\w+\s+=)/$1/; # Left justify variable definition
s/^;#/#/; # Comments in Jmakefile
- if (s/^\|//) { # Command for us
- if (/^skip/) { # Skip until -skip
+ if (s/^\|//) { # Command for us
+ if (/^skip/) { # Skip until -skip
for (; $i <= $#makefile; $i++) {
last if $makefile[$i] =~ /^-skip/;
}
} elsif (s/^expand//) {
- do init_expand($_); # Initializes data structures
+ &init_expand($_); # Initializes data structures
$i++; # Skip expand line
undef @Expand; # Storage for expanded lines
$pattern = ''; # Assume no pattern
@@ -233,9 +354,9 @@ line: for ($i = 0; $i <= $#makefile; $i++) {
s/^\s/\t/; # Make sure leading tab is there
push(@Expand, $_); # Line to be expanded
}
- do expand($pattern); # Expand all lines in buffer
+ &expand($pattern); # Expand all lines in buffer
} else {
- print "$me: Warning: unknown command $_\n";
+ die "$me: unknown command $_\n";
}
} elsif (/^INIT/) { # Initialization section
# All the initializations are put in the variable substitution
@@ -243,16 +364,16 @@ line: for ($i = 0; $i <= $#makefile; $i++) {
# the '$' signs that are not followed by an alphanumeric character.
foreach (@init) {
# Dumps core sometimes with perl 4.0 PL10
- # do protect_dollars(*_);
- $_ = do protect_dollars($_);
- do print_makefile($_);
+ # &protect_dollars(*_);
+ $_ = &protect_dollars($_);
+ &print_makefile($_);
}
foreach (@key) { # @key set earlier to keys(%added)
$_ .= " = " . $added{$_};
# Dumps core sometimes with perl 4.0 PL10
- # do protect_dollars(*_);
- $_ = do protect_dollars($_);
- do print_makefile($_);
+ # &protect_dollars(*_);
+ $_ = &protect_dollars($_);
+ &print_makefile($_);
}
} elsif (/^SUFFIX/) { # Suffixes/Rules section
# Rules and suffixes are put in the variable substitution
@@ -262,20 +383,20 @@ line: for ($i = 0; $i <= $#makefile; $i++) {
print MAKEFILE ".SUFFIXES:";
foreach (@suffix) {
# Dumps core sometimes with perl 4.0 PL10
- # do protect_dollars(*_);
- $_ = do protect_dollars($_);
+ # &protect_dollars(*_);
+ $_ = &protect_dollars($_);
print MAKEFILE " $_";
}
print MAKEFILE "\n\n";
}
foreach (@rule) {
# Dumps core sometimes with perl 4.0 PL10
- # do protect_dollars(*_);
- $_ = do protect_dollars($_);
+ # &protect_dollars(*_);
+ $_ = &protect_dollars($_);
print MAKEFILE "$_\n";
}
} else {
- do print_makefile($_);
+ &print_makefile($_);
}
}
close MAKEFILE;
@@ -299,15 +420,19 @@ sub init_expand {
if (/\$\(\w+\)/) { # If at least one macro
local($make) = "/tmp/mkjm$$";
open(MAKE, ">$make") || die "$me: can't create $make: $!\n";
- do gen_variables(); # Generates already computed variables
+ &gen_variables(); # Generates already computed variables
foreach $var (@Order) { # Print each in order we found them
print MAKE "$var = $Makesym{$var}\n" if !$Gvars{$var};
}
- print MAKE "all:\n\t\@echo '$_'\n";
+ # We prepend OUTPUT: in front of the line that interests us, because
+ # some makes can print extra information, especially GNU make with
+ # its entering/leaving blurb when invoked from another makefile.
+ print MAKE "all:\n\t\@echo 'OUTPUT: $_'\n";
close MAKE;
- chop($_ = `make -f $make all`);
+ chop($_ = `make -f $make all | grep ^OUTPUT:`);
unlink($make);
}
+ s/^OUTPUT: //;
while (s/^\s*(\w+)!([^!]*)!//) {
$Vars{$1} = $2;
# Record only length for _first_ expanded symbol
@@ -345,7 +470,7 @@ sub expand {
}
# Protect substitution in an 'eval' in case of error
eval "s/${pattern}\$//" if $pattern && $i == ($Vars_len - 1);
- do print_makefile($_);
+ &print_makefile($_);
}
}
}
@@ -384,6 +509,16 @@ sub gen_variables {
print MAKE "void::\n"; # Cut incomplete escape sequence
}
+# Parse line to extract all $(VAR) usage and trigger the symbol if VAR
+# is among the wanted set, as if they had manually said ">VAR" like in
+# the old days.
+sub find_wanted {
+ my ($l) = @_;
+ while ($l =~ s/\$\(([\w_]+)\)//) {
+ $symbol{$1}++ if $wanted{$1};
+ }
+}
+
!NO!SUBS!
$grep -v '^;#' ../pl/tilde.pl >>jmake
chmod 755 jmake
diff --git a/jmake/jmake.man b/jmake/jmake.man
index 235b0ba..5c837e4 100644
--- a/jmake/jmake.man
+++ b/jmake/jmake.man
@@ -1,14 +1,22 @@
-''' $Id: jmake.man,v 3.0.1.1 1995/05/12 11:57:58 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.man,v $
+''' Revision 3.0.1.3 2004/08/22 09:01:55 ram
+''' patch71: renamed |test as |case as the construct has its syntax
+''' patch71: added |subst section to allow variable substitutions
+'''
+''' Revision 3.0.1.2 2004/08/21 23:19:52 ram
+''' patch71: added '|shell' section to emit verbatim code in Makefile.SH
+''' patch71: new '|test' to conditionally generate Makefile sections
+'''
''' Revision 3.0.1.1 1995/05/12 11:57:58 ram
''' patch54: updated my e-mail address
'''
@@ -152,19 +160,50 @@ Available commands are:
.sp
.IP \(bu
|suffix <sx>: adds <sx> to the .SUFFIXES: list in the makefile.
+.sp
.IP \(bu
|rule:<text>: adds <text> to the building rule section.
+.sp
.IP \(bu
|rule: <text>: same as before, with a leading tab.
+.sp
.IP \(bu
|skip: skips text until a line starting with '-skip' is found.
+.sp
+.IP \(bu
+|subst: begins section where lines will be subject to variable substitution,
+until '-subst' is found. This means that when the Makefile.SH is run, all
+instances of $var within the \fIsubst\fR section will be substituted by the
+shell.
+.sp
+.IP \(bu
+|shell: emits section until matching '-shell' as-is in the generated
+Makefile.SH. This can be useful to prepare \fI|case\fR sections. It is
+not allowed to nest \fIshell\fR sections.
+.sp
+.IP \(bu
+|case: this command must be followed by a shell variable name (without
+its leading '$' sign) and a case-style pattern, for instance the string
+"var in f*". It will generate the corresponding "case" test in the
+Makefile.SH on the "$var" value and only if this test is true will the
+section until the matching '-case' be generated in the Makefile when
+Makefile.SH is run. It is possible to nest \fIcase\fR sections freely.
+.sp
.IP \(bu
|expand <pattern>: expand lines until '-expand' with <pattern>. A
complete example is shown below.
+.sp
.IP \(bu
|once <symbol>: text up to '-once' appears only the first time.
.sp
.PP
+The '|' commands cannot be nested, unless otherwise noted.
+In particular, due to the simple
+implementation of \fI|skip\fR, it is impossible to put \fI|skip\fR inside
+a skipped part. However, a \fI|once\fR section may have \fI|skip\fR sections.
+It is allowed to nest \fI|case\fR sections at will.
+.sp
+.PP
Here is a way to implement a logical OR:
.sp
.in +5
@@ -180,11 +219,6 @@ Here is a way to implement a logical OR:
Actually, this is ugly, because the text has to appear twice.
Fortunately, I did not use it. :-)
.sp
-.PP
-The '|' commands cannot be nested. In particular, due to the simple
-implementation of \fI|skip\fR, it is impossible to put \fI|skip\fR inside
-a skipped part. However, a \fI|once\fR section may have \fI|skip\fR sections.
-.sp
But actually, as you have surely already guessed, the best way to
implement a logical OR is to use De Morgan's Law:
.sp
@@ -199,7 +233,7 @@ text /* If SYMBOL or not TOKEN */
.sp
.in -5
.fi
-Who said they don't care ? ;-)
+Who said they didn't care ? ;-)
.sp
.PP
Expansion is done with the \fIexpand\fR command. It has been provided to
@@ -225,6 +259,12 @@ use Makefile macros in the <pattern>, and they will be expanded by
jmake. If this is not what you want, escape the first '$' sign (this is
a Makefile escape, i.e. you must double the '$', not precede it with a
backslash). A // stands for the null substitution value.
+.PP
+The ^^^ construct behaves like ^^, i.e. it is stripped out, but it also
+removes any following white space after the ^^^. If you prepend something
+to a macro argument, and that macro argument was written with spaces before
+it, then this will let you concatenate something right before that argument's
+final value.
.sp
.PP
Here is another example which shows how the macro Expand can be used.
@@ -346,7 +386,60 @@ Example:
.in -5
.fi
.sp
+.PP
+The \fIshell\fR command can be used to generate a shell fragment
+in the Makefile.SH. For instance, the following section in the Jmakefile:
+.sp
+.in +5
+.nf
+|shell
+case "$d_usegtk1" in
+define) glib=1; gtk=1;;
+esac
+-shell
+.sp
+.in -5
+.fi
+will cause the generation of the enclosed fragment in the Makefile.SH to
+compute the values of the \fIglib\fR and \fIgtk\fR variables based on the
+configuration variable \fId_usegtk1\fR set by running Configure.
+.sp
+.PP
+In turn, this can be used in subsequent \fIcase\fR sections to activate
+parts of the Makefile only when building for GTK1 using glib-1.x:
+.sp
+.in +5
+.nf
+|case glib in 1
+display:
+ echo "Building for glib-1.x"
+-case
+.sp
+.in -5
+.fi
+This section will generate something like this in the Makefile.SH:
+.sp
+.in +5
+.nf
+!NO!SUBS!
+case "$glib" in
+1)
+ $spitshell >>Makefile <<'!NO!SUBS!'
+display:
+ echo "Building for glib-1.x"
+!NO!SUBS!
+ ;;
+esac
+$spitshell >>Makefile <<'!NO!SUBS!'
+.sp
+.in -5
+.fi
+And when running Makefile.SH, the "display" rule above will only appear
+when building for glib-1.x. The form of the final \fIMakefile\fR can
+therefore depend on the configuration options chosen when \fIConfigure\fR
+was run.
.RE
+.sp
.IP 4)
Initializations:
.sp
@@ -367,7 +460,7 @@ sub-directories.
.sp
.PD
.SH AUTHOR
-Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
+Raphael Manfredi <Raphael_Manfredi@pobox.com>
.SH FILES
.PD 0
.TP 20
diff --git a/jmake/jmkmf.SH b/jmake/jmkmf.SH
index 8648306..64edf18 100755
--- a/jmake/jmkmf.SH
+++ b/jmake/jmkmf.SH
@@ -21,17 +21,21 @@ $startsh
$spitshell >>jmkmf <<'!NO!SUBS!'
# @(#) Generates a Makefile from a Jmakefile
-# $Id: jmkmf.SH,v 3.0.1.1 1993/08/19 06:42:14 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: jmkmf.SH,v $
+# Revision 3.0.1.2 2004/08/21 23:18:13 ram
+# patch71: automatically figures the top dir and the current dir
+# patch71: don't run Makefile.SH if the jmake call failed
+#
# Revision 3.0.1.1 1993/08/19 06:42:14 ram
# patch1: leading config.sh searching was not aborting properly
#
@@ -41,11 +45,19 @@ $spitshell >>jmkmf <<'!NO!SUBS!'
usage="usage: $0 [top_of_sources_pathname [current_directory]]"
-topdir=.
-curdir=.
+curdir=
case $# in
- 0) ;;
+ 0)
+ if test -f .package; then topdir=.;
+ elif test -f ../.package; then topdir=..;
+ elif test -f ../../.package; then topdir=../..;
+ elif test -f ../../../.package; then topdir=../../..;
+ elif test -f ../../../../.package; then topdir=../../../..;
+ else
+ echo "$0: WARNING: can't determine top package directory" >&2
+ fi
+ ;;
1) topdir=$1 ;;
2) topdir=$1 curdir=$2 ;;
*) echo "$usage" 1>&2; exit 1 ;;
@@ -55,6 +67,25 @@ case "$topdir" in
-*) echo "$usage" 1>&2; exit 1 ;;
esac
+case "$curdir" in
+'')
+ here=`pwd`
+ top=`cd $topdir; pwd`
+ curdir=`perl -e \
+ 'print substr($ARGV[0], length($ARGV[1])+1), "\n";' $here $top`
+ case "$curdir" in
+ '') curdir=.;;
+ esac
+ ;;
+esac
+
+if test -f Jmakefile; then
+ : ok
+else
+ echo "$0: no Jmakefile found in current directory" >&2
+ exit 1
+fi
+
if test -f Makefile.SH; then
echo mv Makefile.SH Makefile.SH~
mv Makefile.SH Makefile.SH~
@@ -63,9 +94,13 @@ fi
args="-DTOPDIR=$topdir -DCURDIR=$curdir"
echo jmake $args
-jmake $args
-echo sh Makefile.SH
-sh Makefile.SH
+if jmake $args; then
+ echo sh Makefile.SH
+ sh Makefile.SH
+else
+ echo "jmake failed, aborting" >&2
+ exit 1
+fi
!NO!SUBS!
chmod 755 jmkmf
$eunicefix jmkmf
diff --git a/jmake/jmkmf.man b/jmake/jmkmf.man
index d39b1f7..bea60d1 100644
--- a/jmake/jmkmf.man
+++ b/jmake/jmkmf.man
@@ -1,12 +1,12 @@
-''' $Id: jmkmf.man,v 3.0.1.1 1995/05/12 11:58:03 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: jmkmf.man,v $
''' Revision 3.0.1.1 1995/05/12 11:58:03 ram
@@ -43,11 +43,18 @@ to produce a
.PP
.I Jmkmf
is useful when you generate a makefile for the first time.
+.PP
+When ran without arguments,
+.I jmkmf
+will scan the directories upwards, looking for a .package file marking
+the top of your sources. It will then derive the top-level directory
+and the name of the current directory by itself.
+.PP
Once you have a
.I Makefile.SH
generated by
.I jmake,
-you can use
+and have run Configure already, you can use
.I make Makefile.SH
to build the Makefile.SH again and
.I make Makefile
@@ -65,6 +72,9 @@ Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
.TP 20
Jmakefile
High level description of makefile
+.TP
+.package
+The file marking the top of your package tree
.PD
.SH "SEE ALSO"
-jmake(1).
+jmake(1), packinit(1).