1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 11:42:21 +00:00

build system: do not look for nmake in $PATH

nmake was removed long ago (2940b3f5) and so were the outdated
Makefiles (6cc2f6a0). However, the build system still looked for an
AT&T nmake in $PATH. If a user had it installed, the build would
fail as the system tried to use it.

https://groups.google.com/g/korn-shell/c/2VK8kS0_VhA/m/-Rlnv7PRAgAJ

bin/package, src/cmd/INIT/package.sh:
- Remove all the code supporting nmake.
- Make 'bin/package test' work by simply exec'ing bin/shtests.

src/cmd/INIT/Mamfile:
- Do not install *.mk nmake support files.

lib/package/*.mk, src/cmd/INIT/*.mk:
- nmake support files removed.
This commit is contained in:
Martijn Dekker 2021-05-11 01:45:39 +02:00
parent 65fb288564
commit aa601a397d
13 changed files with 108 additions and 4708 deletions

View file

@ -136,10 +136,12 @@ all_types='*.*|sun4' # all but sun4 match *.*
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
0123) USAGE=$'
[-?
@(#)$Id: package (AT&T Research) 2012-06-28 $
@(#)$Id: package (ksh 93u+m) 2021-05-11 $
]
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
[-author?Contributors to https://github.com/ksh93/ksh]
[-copyright?(c) 1994-2012 AT&T Intellectual Property]
[-copyright?(c) 2020-2021 Contributors to https://github.com/ksh93/ksh]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?package - source and binary package control]
[+DESCRIPTION?The \bpackage\b command controls source and binary
@ -609,8 +611,6 @@ ifs=${IFS-'
lo=
make=
makeflags='-K'
nmakeflags=
nmakesep=
nl="
"
noexec=
@ -1645,17 +1645,6 @@ onpath() # command
return 1
}
# true if no nmake or nmake not from AT&T or nmake too old
nonmake() # nmake
{
_nonmake_version=`( $1 -n -f - 'print $(MAKEVERSION:@/.*AT&T.* //:/-//G:@/.* .*/19960101/)' . ) </dev/null 2>/dev/null || echo 19840919`
if test $_nonmake_version -lt 20001031
then return 0
fi
return 1
}
# determine local host attributes
hostinfo() # attribute ...
@ -2715,8 +2704,7 @@ case $x in
OK=ok
KSH=$EXECROOT/bin/ksh
MAKE=nmake
NMAKE=$EXECROOT/bin/$MAKE
MAKE=mamake
SUM=$EXECROOT/bin/sum
TEE=$EXECROOT/bin/tee
INITROOT=$PACKAGEROOT/src/cmd/INIT
@ -3106,7 +3094,7 @@ cat $INITROOT/$i.sh
$show export PATH
export PATH
;;
*) for i in package proto nmake
*) for i in package proto
do if onpath $i
then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'`
EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'`
@ -3143,8 +3131,7 @@ cat $INITROOT/$i.sh
OK=ok
KSH=$EXECROOT/bin/ksh
MAKE=nmake
NMAKE=$EXECROOT/bin/$MAKE
MAKE=mamake
SUM=$EXECROOT/bin/sum
TEE=$EXECROOT/bin/tee
@ -3537,44 +3524,41 @@ int main(int argc, char** argv) { return argc || argv; }
echo "$command: $INITROOT: INIT package source not found" >&2
return 1
}
executable $INSTALLROOT/bin/nmake || {
# check for prototyping cc
# NOTE: proto.c must be K&R compatible
$CC -c $INITROOT/p.c >/dev/null 2>&1
c=$?
rm -f p.*
test 0 != "$c" && {
checkaout proto || return
PROTOROOT=$PACKAGEROOT/proto
$show PROTOROOT=$PACKAGEROOT/proto
export PROTOROOT
INITPROTO=$PROTOROOT/src/cmd/INIT
note proto convert $PACKAGEROOT/src into $PROTOROOT/src
if test -d $PACKAGEROOT/src/cmd/nmake
then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake"
else dirs="src"
# check for prototyping cc
# NOTE: proto.c must be K&R compatible
$CC -c $INITROOT/p.c >/dev/null 2>&1
c=$?
rm -f p.*
test 0 != "$c" && {
checkaout proto || return
PROTOROOT=$PACKAGEROOT/proto
$show PROTOROOT=$PACKAGEROOT/proto
export PROTOROOT
INITPROTO=$PROTOROOT/src/cmd/INIT
note proto convert $PACKAGEROOT/src into $PROTOROOT/src
dirs="src"
(
if test -f $PROTOROOT/UPDATE
then newer="-newer $PROTOROOT/UPDATE"
else newer=""
fi
(
if test -f $PROTOROOT/UPDATE
then newer="-newer $PROTOROOT/UPDATE"
else newer=""
fi
case $exec in
'') cd $PACKAGEROOT
find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto
;;
*) $exec cd $PACKAGEROOT
$exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto"
;;
esac
$exec touch $PROTOROOT/UPDATE
)
VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH
$show VPATH=$VPATH
export VPATH
}
case $exec in
'') cd $PACKAGEROOT
find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto
;;
*) $exec cd $PACKAGEROOT
$exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto"
;;
esac
$exec touch $PROTOROOT/UPDATE
)
VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH
$show VPATH=$VPATH
export VPATH
}
for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return
done
@ -5925,10 +5909,7 @@ cat $j $k
*-*) a=
for t in $target
do case $t in
-[eiknFKNV]*|--*-symbols)
makeflags="$makeflags $t"
;;
-*) nmakeflags="$nmakeflags $t"
-*) makeflags="$makeflags $t"
;;
*) a="$a $t"
;;
@ -5938,76 +5919,6 @@ cat $j $k
;;
esac
# generate nmake first if possible
if executable ! $NMAKE && test -d $PACKAGEROOT/src/cmd/nmake
then if nonmake $MAKE
then note make $NMAKE with mamake
c=$CC
a=$assign
case $HOSTTYPE in
win32*|cygwin*)
CC="$CC -D_BLD_STATIC"
accept="libast"
case $assign in
*' CC='*) ;;
*) assign="$assign CC=\"\$CC\"" ;;
esac
;;
*) accept=nmake
;;
esac
eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign
assign=$a
CC=$c
case $make$noexec in
'') if executable ! $NMAKE
then echo "$command: $action: errors making $NMAKE" >&2
exit 1
fi
;;
*) make=echo
;;
esac
if test '' != "$PROTOROOT"
then VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH
$show VPATH=$VPATH
export VPATH
fi
note believe generated files for $accept
eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign
$exec touch $INSTALLROOT/bin/.paths
note make the remaining targets with $NMAKE
else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign
case $make$noexec in
'') if executable ! $NMAKE
then echo "$command: $action: errors making $NMAKE" >&2
exit 1
fi
;;
*) make=echo
;;
esac
fi
fi
# generate ksh next if possible
if nonmake $MAKE
then : no need to generate ksh next -- it could be the only package
elif test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH
then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign
case $make$noexec in
'') if executable ! $KSH
then echo "$command: $action: errors making $KSH" >&2
exit 1
fi
;;
*) make=echo
;;
esac
fi
# mamprobe data should have been generated by this point
case $exec in
@ -6082,7 +5993,7 @@ cat $j $k
;;
esac
# run from separate copies since nmake and ksh may be rebuilt
# run from separate copies since ksh may be rebuilt
case $EXECROOT in
$INSTALLROOT)
@ -6100,7 +6011,7 @@ cat $j $k
else rm=rm
fi
for i in \
ksh nmake tee cp ln mv rm \
ksh tee cp ln mv rm \
*ast*.dll *cmd*.dll *dll*.dll *shell*.dll
do executable $i && {
cmp -s $i $OK/$i 2>/dev/null || {
@ -6110,7 +6021,7 @@ cat $j $k
$exec $execrate $mv $OK/$i $OK/$i.old </dev/null
test -f $OK/$i &&
case $exec:$i in
:nmake|:ksh)
:ksh)
echo "$command: $OK/$i: cannot update [may be in use by a running process] remove manually and try again" >&2
exit 1
;;
@ -6124,9 +6035,6 @@ cat $j $k
$exec $execrate $cp -p ../lib/make/makerules.mo $OK/lib/makerules.mo ||
$exec $execrate $cp ../lib/make/makerules.mo $OK/lib/makerules.mo
fi
if executable $OK/nmake
then MAKE="$INSTALLROOT/bin/$OK/nmake LOCALRULESPATH=$INSTALLROOT/bin/$OK/lib"
fi
if executable $OK/tee
then TEE=$INSTALLROOT/bin/$OK/tee
fi
@ -6145,19 +6053,13 @@ cat $j $k
;;
esac
# fall back to mamake if nmake not found or too old
# build with mamake
if nonmake $MAKE
then note make with mamake
case $target in
'') target="install" ;;
esac
eval capture mamake \$makeflags \$noexec \$target $assign
else case $target in
'') target="install cc-" ;;
esac
eval capture \$MAKE \$makeflags \$nmakeflags \$noexec recurse \$target \$nmakesep \$package $assign
fi
note make with mamake
case $target in
'') target="install" ;;
esac
eval capture mamake \$makeflags \$noexec \$target $assign
;;
read) case ${PWD:-`pwd`} in
@ -6811,32 +6713,8 @@ results)set '' $target
esac
;;
test) requirements source $package
components $package
package=$_components_
case $only in
0) only= ;;
1) only=--recurse=only ;;
esac
# must have nmake
if nonmake $MAKE
then echo $command: $action: must have $MAKE to test >&2
exit 1
fi
# all work under $INSTALLROOT/src
$make cd $INSTALLROOT/src
# disable core dumps (could be disastrous over nfs)
(ulimit -c 0) > /dev/null 2>&1 && ulimit -c 0
# do the tests
eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign
test) # pass control to ksh 93u+m test script
exec "$PACKAGEROOT/bin/shtests"
;;
update) # download the latest release.version for selected packages
@ -7446,10 +7324,9 @@ write) set '' $target
exit 1
;;
esac
if nonmake $MAKE
then echo "$command: must have $MAKE to generate archives" >&2
exit 1
fi
echo "$command: not yet reimplemented after removing nmake" >&2
exit 1
# all work under $PACKAGEBIN

View file

@ -1,260 +0,0 @@
/*
* {automake|configure} => {nmake|iffe} conversion support
*
* The first command line target overrides the default original source
* directory name $(MAKEFILE:D). The hard work is in the makefile using
* these assertions, since it must (manually) provide the nmake makefiles
* and config equivalent iffe scripts. The conversion makefile is typically
* named lib/package/PACKAGE.cvt in an ast package $PACKAGEROOT directory,
* and the conversion is run from the $PACKAGEROOT directory, e.g.:
*
* nmake -I lib/package -f PACKAGE-VERSION/PACKAGE.cvt
*
* The conversion requires the ast nmake, pax and tw commands.
*
* After the conversion you will be liberated from ./configure, *.in,
* *.am, automake, autom4te, libtool, make depend, and makefile
* recursion ordering. You can build from $PACKAGEROOT using the ast
* package(1) (which sets up the { HOSTTYPE PATH VPATH } environment):
*
* package make
*
* or cd into any arch/$HOSTTYPE/src subdirectory and rebuild that portion
* of the hierarchy with the ast nmake(1) (after setting PATH and VPATH):
*
* nmake
*
* The conversion assertions are:
*
* package :CONVERT: file ...
*
* files in the original source directory are copied
* and converted into the ./src and ./lib subdirectories
* the default original source directory is ./original
*
* package package name
* file original source file that must exist
*
* :OMIT: pattern
*
* files matching pattern are not copied into the converted
* directory
*
* pattern ksh pattern of files to omit
*
* :COPY: from to [ file ... ]
*
* files in the from directory are copied to the to directory
* the action may contain :MOVE: exceptions to the copy
*
* from original directory subdirectory
* . names the original directory
* .. names the
* to converted subdirectory
* libNAME => src/lib/libNAME
* NAME => src/cmd/NAME
* file files or files in subdirectories to be copied;
* explicit files are copied to the to directory;
* if no files are specified then the from hierarchy
* is recursively copied to the converted directory
*
* :MOVE: to file ...
*
* :COPY: assertion exceptions placed in the assertion's action
*
* to files or subdirectory files are copied to this directory
* file file or files in subdirectories to be copied
*
* :FILE: to file <<!
* contents
* !
*
* the :FILE: action is copied to the named file in the to directory
* the :FILE: action is usually specified using the here syntax to
* avoid make comment, quote and variable expansion
*
* :EDIT: to file ... | - pattern <<!
* edit script
* !
*
* the :EDIT: action is an ed(1) script applied to each file in the
* to directory after it has been copied from the original source
* directory; if to is - then the :EDIT: action is a sed(1) script
* that is applied to all files matching the file pattern during the
* copy from the original source directory; a file may be subject to
* both a sed(1) and ed(1) :EDIT:; the :EDIT: action is usually
* specified using the here syntax to avoid make comment, quote and
* variable expansion
*/
.CONVERT.ID. = "@(#)$Id: CONVERT (AT&T Research) 2004-03-19 $"
set nojobs noscan nowriteobject writestate=$$(MAKEFILE).ms
package = $(PWD:B)
here = !-=-=-=-=-!
hierarchy = src src/cmd src/lib
omit = .*|*.?(l)[ao]
original = $(MAKEFILE:D)
showedit = $(-debug:?p??)
CPFLAGS = -u
PAXFLAGS = -u -v
STDEDFLAGS = -
TW = tw
TWFLAGS = -CP
all : .VIRTUAL file
file : .VIRTUAL edit
edit : .VIRTUAL copy
copy : .VIRTUAL init
init : .VIRTUAL
.MAKEINIT : .cvt.init
.cvt.init : .MAKE .VIRTUAL .FORCE
local D
if D = "$(~.ARGS:O=1)"
if "$(D:T>FD)"
original := $(D)
.ARGS : .CLEAR $(~.ARGS:O>1)
end
end
.cvt.filter =
.cvt.package =
.cvt.atom : .FUNCTION
local N V
V := $(%:O=1)
let .cvt.$(V) = .cvt.$(V) + 1
return .cvt.$(V).$(.cvt.$(V))
.cvt.omit : .FUNCTION
return -s',^\(\(?K)?(*/)($(omit))?(/*))$,,$(showedit)'
.cvt.to : .FUNCTION
if "$(%)" == "."
return src
end
if "$(%)" == "*/*"
return src/$(%)
end
if "$(%)" == "lib*"
return src/lib/$(%)
end
return src/cmd/$(%)
":CONVERT:" : .MAKE .OPERATOR
local I
package := $(<)
I := $(hierarchy:C,$,/Makefile)
init : .cvt.verify $(I)
$(I) : .ACCEPT
test -d $(<:D) || $(MKDIR) -p $(<:D)
echo :MAKE: > $(<)
.cvt.verify : .MAKE .FORCE .REPEAT
local I
if I = "$(.cvt.package:T!=F)"
error 3 $(original): not a $(package) source directory: missing $(I)
end
.cvt.package := $(>:C,^,$$(original)/,)
":COPY:" : .MAKE .OPERATOR
local F T I A
F := $(>:O=1)
T := $(.cvt.to $(>:O=2))
A := $(.cvt.atom copy)
copy : $(A)
$(A) : .VIRTUAL
if F == "."
$(A) : $(T)
$(T) :
test -d $(<) || $(MKDIR) -p $(<)
for I $(>:O>2)
eval
$$(A) : $(I:D=$(T):B:S)
$(I:D=$(T):B:S) : $$(original)/$(I)
$$(CP) $$(CPFLAGS) $$(*) $$(<)
end
end
elif "$(F:T=FF)" || "$(F:N=*.(pax|t[bg]z))"
eval
$$(A) : $$(F)
test -d $(T) || $$(MKDIR) -p $(T)
cd $(T)
$$(PAX) $$(PAXFLAGS) -rf $$(*:P=A) -s ',^$(>:O=2)/*,,' $(.cvt.omit) $(.cvt.filter)
end
else
F := $$(original)/$(F)
if ! "$(@:V)"
eval
$$(A) : .FORCE
test -d $(T) || $$(MKDIR) -p $(T)
cd $(F:V)
$$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.filter) $(T:P=A)
end
else
.cvt.move =
: $(@:V:@R)
eval
$$(A) : .FORCE
test -d $(T) || $$(MKDIR) -p $(T)
cd $(F:V)
$$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.move) $(.cvt.filter) $(T:P=A)
end
end
end
":EDIT:" : .MAKE .OPERATOR
local A D F
D := $(>:O=1)
if D == "-"
A := ^$(>:O=2)^$$(SED) -e $(@:Q:/'\n'/ -e /G)
.cvt.filter += --action=$(A:@Q)
else
D := $(.cvt.to $(D))
F := $(>:O>1:C,^,$(D)/,)
edit : $(F)
eval
$$(F) :
$$(STDED) $$(STDEDFLAGS) $$(<) <<'$(here)'
$(@:V)
w
q
$(here)
end
end
":FILE:" : .MAKE .OPERATOR
local ( D F ) $(>)
local A
A := $(.cvt.atom file)
$(A) := $(@:V)
D := $(.cvt.to $(D))
file : $(D)/$(F)
eval
$$(D)/$$(F) :
test -d $$(<:D) || $$(MKDIR) -p $$(<:D)
cat > $$(<) <<'$(here)'
$$($(A):V)
$(here)
end
":MOVE:" : .MAKE .OPERATOR
local T I
T := ../../../$(.cvt.to $(>:O=1))
for I $(>:O>1)
if I == "*/"
.cvt.move += -s',^\(\(?K)$(I)),$(T)/,$(showedit)'
.cvt.move += -s',^\(\(?K)$(I:C%/$%%))$,,$(showedit)'
else
.cvt.move += -s',^\(\(?K)$(I))$,$(T)/$(I:B:S),$(showedit)'
end
end
":OMIT:" : .MAKE .OPERATOR
local P
for P $(>)
omit := $(omit)|$(P)
end

File diff suppressed because it is too large Load diff

View file

@ -1,260 +0,0 @@
/*
* {automake|configure} => {nmake|iffe} conversion support
*
* The first command line target overrides the default original source
* directory name $(MAKEFILE:D). The hard work is in the makefile using
* these assertions, since it must (manually) provide the nmake makefiles
* and config equivalent iffe scripts. The conversion makefile is typically
* named lib/package/PACKAGE.cvt in an ast package $PACKAGEROOT directory,
* and the conversion is run from the $PACKAGEROOT directory, e.g.:
*
* nmake -I lib/package -f PACKAGE-VERSION/PACKAGE.cvt
*
* The conversion requires the ast nmake, pax and tw commands.
*
* After the conversion you will be liberated from ./configure, *.in,
* *.am, automake, autom4te, libtool, make depend, and makefile
* recursion ordering. You can build from $PACKAGEROOT using the ast
* package(1) (which sets up the { HOSTTYPE PATH VPATH } environment):
*
* package make
*
* or cd into any arch/$HOSTTYPE/src subdirectory and rebuild that portion
* of the hierarchy with the ast nmake(1) (after setting PATH and VPATH):
*
* nmake
*
* The conversion assertions are:
*
* package :CONVERT: file ...
*
* files in the original source directory are copied
* and converted into the ./src and ./lib subdirectories
* the default original source directory is ./original
*
* package package name
* file original source file that must exist
*
* :OMIT: pattern
*
* files matching pattern are not copied into the converted
* directory
*
* pattern ksh pattern of files to omit
*
* :COPY: from to [ file ... ]
*
* files in the from directory are copied to the to directory
* the action may contain :MOVE: exceptions to the copy
*
* from original directory subdirectory
* . names the original directory
* .. names the
* to converted subdirectory
* libNAME => src/lib/libNAME
* NAME => src/cmd/NAME
* file files or files in subdirectories to be copied;
* explicit files are copied to the to directory;
* if no files are specified then the from hierarchy
* is recursively copied to the converted directory
*
* :MOVE: to file ...
*
* :COPY: assertion exceptions placed in the assertion's action
*
* to files or subdirectory files are copied to this directory
* file file or files in subdirectories to be copied
*
* :FILE: to file <<!
* contents
* !
*
* the :FILE: action is copied to the named file in the to directory
* the :FILE: action is usually specified using the here syntax to
* avoid make comment, quote and variable expansion
*
* :EDIT: to file ... | - pattern <<!
* edit script
* !
*
* the :EDIT: action is an ed(1) script applied to each file in the
* to directory after it has been copied from the original source
* directory; if to is - then the :EDIT: action is a sed(1) script
* that is applied to all files matching the file pattern during the
* copy from the original source directory; a file may be subject to
* both a sed(1) and ed(1) :EDIT:; the :EDIT: action is usually
* specified using the here syntax to avoid make comment, quote and
* variable expansion
*/
.CONVERT.ID. = "@(#)$Id: CONVERT (AT&T Research) 2004-03-19 $"
set nojobs noscan nowriteobject writestate=$$(MAKEFILE).ms
package = $(PWD:B)
here = !-=-=-=-=-!
hierarchy = src src/cmd src/lib
omit = .*|*.?(l)[ao]
original = $(MAKEFILE:D)
showedit = $(-debug:?p??)
CPFLAGS = -u
PAXFLAGS = -u -v
STDEDFLAGS = -
TW = tw
TWFLAGS = -CP
all : .VIRTUAL file
file : .VIRTUAL edit
edit : .VIRTUAL copy
copy : .VIRTUAL init
init : .VIRTUAL
.MAKEINIT : .cvt.init
.cvt.init : .MAKE .VIRTUAL .FORCE
local D
if D = "$(~.ARGS:O=1)"
if "$(D:T>FD)"
original := $(D)
.ARGS : .CLEAR $(~.ARGS:O>1)
end
end
.cvt.filter =
.cvt.package =
.cvt.atom : .FUNCTION
local N V
V := $(%:O=1)
let .cvt.$(V) = .cvt.$(V) + 1
return .cvt.$(V).$(.cvt.$(V))
.cvt.omit : .FUNCTION
return -s',^\(\(?K)?(*/)($(omit))?(/*))$,,$(showedit)'
.cvt.to : .FUNCTION
if "$(%)" == "."
return src
end
if "$(%)" == "*/*"
return src/$(%)
end
if "$(%)" == "lib*"
return src/lib/$(%)
end
return src/cmd/$(%)
":CONVERT:" : .MAKE .OPERATOR
local I
package := $(<)
I := $(hierarchy:C,$,/Makefile)
init : .cvt.verify $(I)
$(I) : .ACCEPT
test -d $(<:D) || $(MKDIR) -p $(<:D)
echo :MAKE: > $(<)
.cvt.verify : .MAKE .FORCE .REPEAT
local I
if I = "$(.cvt.package:T!=F)"
error 3 $(original): not a $(package) source directory: missing $(I)
end
.cvt.package := $(>:C,^,$$(original)/,)
":COPY:" : .MAKE .OPERATOR
local F T I A
F := $(>:O=1)
T := $(.cvt.to $(>:O=2))
A := $(.cvt.atom copy)
copy : $(A)
$(A) : .VIRTUAL
if F == "."
$(A) : $(T)
$(T) :
test -d $(<) || $(MKDIR) -p $(<)
for I $(>:O>2)
eval
$$(A) : $(I:D=$(T):B:S)
$(I:D=$(T):B:S) : $$(original)/$(I)
$$(CP) $$(CPFLAGS) $$(*) $$(<)
end
end
elif "$(F:T=FF)" || "$(F:N=*.(pax|t[bg]z))"
eval
$$(A) : $$(F)
test -d $(T) || $$(MKDIR) -p $(T)
cd $(T)
$$(PAX) $$(PAXFLAGS) -rf $$(*:P=A) -s ',^$(>:O=2)/*,,' $(.cvt.omit) $(.cvt.filter)
end
else
F := $$(original)/$(F)
if ! "$(@:V)"
eval
$$(A) : .FORCE
test -d $(T) || $$(MKDIR) -p $(T)
cd $(F:V)
$$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.filter) $(T:P=A)
end
else
.cvt.move =
: $(@:V:@R)
eval
$$(A) : .FORCE
test -d $(T) || $$(MKDIR) -p $(T)
cd $(F:V)
$$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.move) $(.cvt.filter) $(T:P=A)
end
end
end
":EDIT:" : .MAKE .OPERATOR
local A D F
D := $(>:O=1)
if D == "-"
A := ^$(>:O=2)^$$(SED) -e $(@:Q:/'\n'/ -e /G)
.cvt.filter += --action=$(A:@Q)
else
D := $(.cvt.to $(D))
F := $(>:O>1:C,^,$(D)/,)
edit : $(F)
eval
$$(F) :
$$(STDED) $$(STDEDFLAGS) $$(<) <<'$(here)'
$(@:V)
w
q
$(here)
end
end
":FILE:" : .MAKE .OPERATOR
local ( D F ) $(>)
local A
A := $(.cvt.atom file)
$(A) := $(@:V)
D := $(.cvt.to $(D))
file : $(D)/$(F)
eval
$$(D)/$$(F) :
test -d $$(<:D) || $$(MKDIR) -p $$(<:D)
cat > $$(<) <<'$(here)'
$$($(A):V)
$(here)
end
":MOVE:" : .MAKE .OPERATOR
local T I
T := ../../../$(.cvt.to $(>:O=1))
for I $(>:O>1)
if I == "*/"
.cvt.move += -s',^\(\(?K)$(I)),$(T)/,$(showedit)'
.cvt.move += -s',^\(\(?K)$(I:C%/$%%))$,,$(showedit)'
else
.cvt.move += -s',^\(\(?K)$(I))$,$(T)/$(I:B:S),$(showedit)'
end
end
":OMIT:" : .MAKE .OPERATOR
local P
for P $(>)
omit := $(omit)|$(P)
end

View file

@ -1,45 +0,0 @@
/*
* normalize local -l* library conventions
*
* L [ [ G11 ... G1n ] ... [ Gg1 ... Ggn ] ] :MAPLIB: T1.c ... Tn.c
*
* if Giji not specified then G11 == L
* the first Ti.c that compiles/links with group -lGi1 ... -lGin
* but does not compile/link with no libraries maps
* -lL to require -lGi1 ... -lGin
* otherwise -lL is not required and maps to "no library required"
*/
":MAPLIB:" : .MAKE .OPERATOR
local L P
L := $(<:B:O=1)
if ! ( P = "$(<:B:O>1)" )
P := $(L)
end
$(LIBDIR)/lib/$(L) :INSTALL: $(L).req
eval
$(L).req : (CC) $$(>)
set -
r='-'
for i in $$(*)
do if $$(CC) -c $i > /dev/null
then g=
for p in $(P) -
do case $p in
-) if $$(CC) -o $$(<:B:S=.exe) $i $g > /dev/null 2>&1
then $$(CC) -o $$(<:B:S=.exe) $i > /dev/null 2>&1 || {
r="$g"
break 2
}
fi
g=
;;
*) g="$g -l$p"
;;
esac
done
fi
done 2>/dev/null
echo " $r" > $$(<)
rm -f $$(<:B:S=.exe) $$(*:B:S=$$(CC.SUFFIX.OBJECT))
end

View file

@ -1,2 +0,0 @@
/* stub for pre-2000-05-01 nmake */
":MSGFUN:" : .MAKE .OPERATOR

View file

@ -1,2 +0,0 @@
/* stub for pre-2000-05-01 nmake */
":MSGKEY:" : .MAKE .OPERATOR

View file

@ -726,57 +726,6 @@ make install
exec - then mkdir -p ${PACKAGEROOT}/lib/package
exec - fi
done ${PACKAGEROOT}/lib/package generated
make ${PACKAGEROOT}/lib/package/package.mk
prev ${PACKAGEROOT}/lib/package
make package.mk
done package.mk
exec - test '' = 'package.mk' || ${STDCMP} 2>/dev/null -s package.mk ${PACKAGEROOT}/lib/package/package.mk || { ${STDMV} ${PACKAGEROOT}/lib/package/package.mk ${PACKAGEROOT}/lib/package/package.mk.old 2>/dev/null || true; ${STDCP} package.mk ${PACKAGEROOT}/lib/package/package.mk ;}
done ${PACKAGEROOT}/lib/package/package.mk generated
make ${PACKAGEROOT}/lib/package/CONVERT.mk
make CONVERT.mk
done CONVERT.mk
exec - test '' = 'CONVERT.mk' || ${STDCMP} 2>/dev/null -s CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk || { ${STDMV} ${PACKAGEROOT}/lib/package/CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk.old 2>/dev/null || true; ${STDCP} CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk ;}
done ${PACKAGEROOT}/lib/package/CONVERT.mk generated
make ${INSTALLROOT}/lib/make
exec - if test ! -d ${INSTALLROOT}/lib/make
exec - then mkdir -p ${INSTALLROOT}/lib/make
exec - fi
done ${INSTALLROOT}/lib/make generated
make ${INSTALLROOT}/lib/make/package.mk
prev ${INSTALLROOT}/lib/make
prev package.mk
exec - test '' = 'package.mk' || ${STDCMP} 2>/dev/null -s package.mk ${INSTALLROOT}/lib/make/package.mk || { ${STDMV} ${INSTALLROOT}/lib/make/package.mk ${INSTALLROOT}/lib/make/package.mk.old 2>/dev/null || true; ${STDCP} package.mk ${INSTALLROOT}/lib/make/package.mk ;}
done ${INSTALLROOT}/lib/make/package.mk generated
make ${INSTALLROOT}/lib/make/PROBE.mk
make PROBE.mk
done PROBE.mk
exec - test '' = 'PROBE.mk' || ${STDCMP} 2>/dev/null -s PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk || { ${STDMV} ${INSTALLROOT}/lib/make/PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk.old 2>/dev/null || true; ${STDCP} PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk ;}
done ${INSTALLROOT}/lib/make/PROBE.mk generated
make ${INSTALLROOT}/lib/make/TEST.mk
make TEST.mk
done TEST.mk
exec - test '' = 'TEST.mk' || ${STDCMP} 2>/dev/null -s TEST.mk ${INSTALLROOT}/lib/make/TEST.mk || { ${STDMV} ${INSTALLROOT}/lib/make/TEST.mk ${INSTALLROOT}/lib/make/TEST.mk.old 2>/dev/null || true; ${STDCP} TEST.mk ${INSTALLROOT}/lib/make/TEST.mk ;}
done ${INSTALLROOT}/lib/make/TEST.mk generated
make ${INSTALLROOT}/lib/make/WWW.mk
make WWW.mk
done WWW.mk
exec - test '' = 'WWW.mk' || ${STDCMP} 2>/dev/null -s WWW.mk ${INSTALLROOT}/lib/make/WWW.mk || { ${STDMV} ${INSTALLROOT}/lib/make/WWW.mk ${INSTALLROOT}/lib/make/WWW.mk.old 2>/dev/null || true; ${STDCP} WWW.mk ${INSTALLROOT}/lib/make/WWW.mk ;}
done ${INSTALLROOT}/lib/make/WWW.mk generated
make ${INSTALLROOT}/lib/make/MSGFUN.mk
make MSGFUN.mk
done MSGFUN.mk
exec - test '' = 'MSGFUN.mk' || ${STDCMP} 2>/dev/null -s MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk.old 2>/dev/null || true; ${STDCP} MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk ;}
done ${INSTALLROOT}/lib/make/MSGFUN.mk generated
make ${INSTALLROOT}/lib/make/MSGKEY.mk
make MSGKEY.mk
done MSGKEY.mk
exec - test '' = 'MSGKEY.mk' || ${STDCMP} 2>/dev/null -s MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk.old 2>/dev/null || true; ${STDCP} MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk ;}
done ${INSTALLROOT}/lib/make/MSGKEY.mk generated
make ${INSTALLROOT}/lib/make/MAPLIB.mk
make MAPLIB.mk
done MAPLIB.mk
exec - test '' = 'MAPLIB.mk' || ${STDCMP} 2>/dev/null -s MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk.old 2>/dev/null || true; ${STDCP} MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk ;}
done ${INSTALLROOT}/lib/make/MAPLIB.mk generated
make ${INSTALLROOT}/bin/mamake
prev mamake
exec - test '' = 'mamake' || ${STDCMP} 2>/dev/null -s mamake ${INSTALLROOT}/bin/mamake || { ${STDMV} ${INSTALLROOT}/bin/mamake ${INSTALLROOT}/bin/mamake.old 2>/dev/null || true; ${STDCP} mamake ${INSTALLROOT}/bin/mamake ;}

View file

@ -1,13 +0,0 @@
/*
* @(#)probe (AT&T Bell Laboratories) 11/11/91
*
* <lang> <tool> :PROBE: *.probe *.sh *
*
* common probe script installation
* generates probe.sh and probe in .
*/
":PROBE:" : .MAKE .OPERATOR
probe.sh : $(LIBDIR)/probe/$(<:O=1)/probe $(>:N=*.(probe|sh))
cat $(*) > $(<)
$(LIBDIR)/probe/$(<:O=1)/$(<:O=2) :INSTALLDIR: probe $(>:N!=*.(probe|sh))

View file

@ -1,197 +0,0 @@
/*
* regression test support
*
* @(#)TEST.mk (AT&T Research) 2010-05-19
*
* test management is still in the design phase
*/
/*
* three forms for :TEST:
*
* :TEST: xxx yyy ...
*
* $(REGRESS) $(REGRESSFLAGS) xxx.tst
* $(REGRESS) $(REGRESSFLAGS) yyy.tst
*
* :TEST: xxx.tst yyy ...
*
* $(REGRESS) $(REGRESSFLAGS) xxx.tst yyy ...
*
* :TEST: xxx.c [ :: test-prereq ... :: ] [ args [ : args ... ] ]
*
* :TEST: xxx.sh [ :: test-prereq ... :: ] [ args [ : args ... ] ]
*
* xxx :TEST: prereq ...
* [ action ]
*
* $(*) if no action
*/
":TEST:" : .MAKE .OPERATOR
local B G P S T
test : .INSERT .TESTINIT
if "$("tests":T=FD)"
.SOURCE : tests
end
P := $(>:O=1)
if "$(P:N=*.tst)" && ! "$(@:V)"
B := $(P:B)
if ! ( T = "$(<:V)" )
T := $(B)
end
test : - test.$(T)
eval
test.$$(T) : $$(B).tst
$$(REGRESS) $$(REGRESSFLAGS) $$(*) $(>:V:O>1)
:SAVE: $$(B).tst
end
elif "$(P:N=*@(.sh|$(.SUFFIX.c:/ /|/G)|$(.SUFFIX.C:/ /|/G)))"
B := $(P:B)
if ! ( T = "$(<:V)" )
T := $(B)
end
:INSTALLDIR: $(B)
$(B) :: $(P) $(*:-l*|*$(CC.SUFFIX.ARCHIVE))
if "$(P:N=*.sh)"
TESTCC == $(CC)
$(B) : (TESTCC)
end
test : - test.$(T)
if "$(@:V)"
eval
test.$$(T) : $$(B) $(>:V:O>1)
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
$(@:V)
end
elif "$(>:V:O>1)"
local I A V X S R=0
for A $(>:V:O>1)
if A == "::"
let R = !R
elif A == ":"
let I = I + 1
test.$(T).$(I) := $(V:V)
V =
X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*)
S = $("\n")
elif A != "-l*|*$(CC.SUFFIX.ARCHIVE)"
if R
test.$(A) : .VIRTUAL .FORCE
test.$(T) : test.$(A)
else
V += $(A:V)
end
end
end
if V
let I = I + 1
test.$(T).$(I) := $(V:V)
X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*)
end
eval
test.$$(T) : $$(B)
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
$(X:V)
end
else
eval
test.$$(T) : $$(B)
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
$$(*)
end
end
elif ! "$(<:V)"
G = 1
for B $(>)
if B == "-|--"
let G = !G
else
if ! G
T =
elif ! ( T = "$(B:A=.COMMAND)" ) && ! "$(B:A=.TARGET)"
for S .c .sh
if "$(B:B:S=$(S):T=F)"
:INSTALLDIR: $(B)
$(B) :: $(B:B:S=$(S))
T := $(B)
break
end
end
end
test : - test.$(B)
test.$(B) : $(T) - $(B).tst
$(REGRESS) $(REGRESSFLAGS) $(*:N=*.tst) $(*:N!=*.tst)
:SAVE: $(B).tst
end
end
else
if "$(>:V)" || "$(@:V)"
P := $(>)
T := $(P:O=1)
B := $(T:B)
if "$(T)" != "$(B)" && "$(T:G=$(B))"
:INSTALLDIR: $(B)
$(B) :: $(T) $(P:O>1:N=-*)
T := $(B)
P := $(B) $(P:O>1:N!=-*)
end
if "$(<:V)"
T := $(<:V)
end
test : - test.$(T)
if "$(@:V)"
eval
test.$$(T) : $$(P) $(>:V:O>1)
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
$(@:V)
end
else
test.$(T) : $(P)
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
$(*)
end
else
test : - test.$(<)
test.$(<) : $(<).tst $(<:A=.COMMAND)
$(REGRESS) $(REGRESSFLAGS) $(*)
end
end
.TESTINIT : .MAKE .VIRTUAL .FORCE .REPEAT
if VARIANT == "DLL"
error 1 :DLL: tests skipped
exit 0
end
set keepgoing
REGRESSFLAGS &= $(TESTS:@/ /|/G:/.*/--test=&/:@Q)
.SCAN.tst : .SCAN
$(@.SCAN.sh)
I| INCLUDE@ % |
.ATTRIBUTE.%.tst : .SCAN.tst
MKTEST = mktest
MKTESTFLAGS = --style=regress
/*
* test scripts are only regenerated from *.rt when --force
* is specified or the .rt file is newer than the script
* otherwise the script is accepted if it exists
*
* this avoids the case where a fresh build with no state
* would regenerate the test script and capture current
* behavior instead of expected behavior
*/
%.tst : %.rt
if [[ "$(-force)" || "$(>)" -nt "$(^|<)" ]]
then $(MKTEST) $(MKTESTFLAGS) $(>) > $(<)
fi
test%.sh test%.out : %.rt
if [[ "$(-force)" || "$(>)" -nt "$(^|<:O=1)" ]]
then $(MKTEST) --style=shell $(>) > $(<:N=*.sh)
$(SHELL) $(<:N=*.sh) --accept > $(<:N=*.out)
fi

View file

@ -1,450 +0,0 @@
/*
* post stuff to WWWDIR for web access
* index generated from *.mm
*/
WWWDIR = wwwfiles public_html
WWWSAVE =
WWWSTYLE =
WWWTYPES =
.WWW.semaphore : .SEMAPHORE
.EXPORT : WWWSTYLE WWWTYPES
/*
* item :WWW: [style=frame] [save=pattern] file ...
*
* `item'.mm generates index.html
* other files copied to $(WWWDIR)/`item'
* sets up www.bin
*/
":WWW:" : .MAKE .OPERATOR
local A B D I J L X E P R M
.WWW.LOCAL .WWW.REMOTE : .DO.NOTHING
WWWDIR := $(HOME:X=$(WWWDIR):T=F:O=1)
B := $(*:N=*.mm::O=1:B)
D := $(WWWDIR)/$(B)
M := $(WWWDIR)/man/man1
R := $(>:N!=*=*)
for I $(>:N=*=*)
A := WWW$(I:/=.*//:F=%(upper)s)
$(A) := $(I:/.*=//)
end
(html_info) : $$(MM2HTMLINFO) $$(MM2HTMLINIT)
if WWWSTYLE == "frame"
%.html %-index.html : %.mm (html_info)
$(MM2HTML) $(MM2HTMLFLAGS) $(%:N=faq.*:?> $(<:O=1)?-f $(%) -x?) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(WWWSOURCE.$(%)) $(>)
else
%.html : %.mm (html_info)
$(MM2HTML) $(MM2HTMLFLAGS) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(>) $(WWWSOURCE.$(%)) > $(<)
end
%.html : %.1 (html_info)
$(MM2HTML) $(MM2HTMLFLAGS) $(>) $(WWWSOURCE.$(%)) > $(<)
%-man.html : $(BINDIR)/% (html_info)
ignore $(>) --html 2> $(<)
.DO.WWW.MAN : .USE
if { test '' = '$(*)' || { strings $(*) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.' ;} ;} && [[ "$( $(<:B) '--???html' -- 2>&1 )" == version=[1-9]* ]]
then ( $(<:B) '--??html' -- 2>$(<) ) || true
fi
if 0
$(M)/%.html : .DONTCARE $(INSTALLROOT)/bin/%
$(@.DO.WWW.MAN)
end
if "$(<)"
D := $(<)
elif ! "$(R)"
return
end
.WWW .WWW.BIN : $(D) $(M) -
$(D) $(M) :
$(SILENT) test -d $(<) || mkdir $(<)
if ( J = "$(R:N=*.mm)" )
for I $(J:G=%.html)
if I == "*-index.html"
O := $(D)/index.html
else
O := $(I:D=$(D):B:S)
end
.WWW : $(O)
$(O) :COPY: $(I)
end
end
.WWW.req : .FUNCTION
return $(*$(%:T=SR):N=-l*:T=F:P=B:N!=-l*|/*)
A = 0
for I $(R:N!=*.mm)
if I == "-"
let A = ! A
elif I == "-l*"
L := $(I:/-l//)
if J = "$(.DLL.NAME. $(L) $($(L).VERSION):T=F)"
X += $(J)
end
elif A || "$(I:A=.COMMAND|.ARCHIVE)" || "$(I:D:D:N=$(INSTALLROOT))" || "$(I:N=*-www)"
X += $(I)
if "$(I:A=.COMMAND)"
X += $$(.WWW.req $(I))
J := $(I:/-www$//)
eval
.WWW : $(J:D=$(M):B:S=.html)
$(J:D=$(M):B:S=.html) : $(I) $(I:B:S=.1:T=F:?$(I:B:S=.1)??)
if strings $$(*:O=1) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.'
then $$(IGNORE) $$(*:O=1) '--??html' -- 2>&1
elif test '' != '$$(*:N=*.1)'
then $$(MM2HTML) $$(*:N=*.1)
fi > $$(<)
end
end
else
if I == "*.html"
$(I) : .TERMINAL
end
.WWW : $(D)/$(I)
$(D)/$(I) :COPY: $(I)
end
end
if "$(X:V)"
.WWW.EDIT. : .FUNCTION
local E I J
for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*)
for J $(%)
if "$(I:B:S)" == "$(J:B:S)"
E += -s ',^$(J)$,$(I),'
end
end
end
return $(E)
.WWW.LIST. : .FUNCTION
local E I J
for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*)
for J $(%)
if "$(I:B:S)" == "$(J:B:S)"
E += $(I)
end
end
end
return $(E)
.WWW .WWW.BIN : $(D)/$(B)-$(CC.HOSTTYPE).tgz
$(D)/$(B)-$(CC.HOSTTYPE).tgz : $(X:V)
cat > X.$(tmp).X <<!
This archive contains $(CC.HOSTTYPE) binaries for
$(.WWW.LIST. $(*))
Add the bin directory to PATH and the lib directory
to LD_LIBRARY_PATH or its equivalent for your system.
Use the --?help and --man options for online help,
documentation and contact info.
!
$(PAX) -wvf $(<) -x tar:gzip -s "/X.$(tmp).X/README/" $(.WWW.EDIT. $(*)) -s ',\(.*\)-www$,bin/\1,' -s ',.*/lib/,lib/,' X.$(tmp).X $(*:N!=-l*)
$(RM) -f X.$(tmp).X
end
/*
* item ... :WWWBIN: index.mm file ... host:arch ...
*
* home page control
* `host' of type `arch' for www.bin files
*/
":WWWBIN:" : .MAKE .OPERATOR
local HOST ITEM ARCH BINS DIRS G
.WWW.NOMAN. += $(<)
for HOST $(>)
TYPE := $(HOST:/.*://)
HOST := $(HOST:/:.*//)
WWWTYPES += $(TYPE)
ARCH := $(PWD:D:C,/$(CC.HOSTTYPE)/,/$(TYPE)/)
BINS :=
DIRS :=
for ITEM $(<)
if TYPE == "$(CC.HOSTTYPE)"
G := $("index.mm":G=%.html:D=$(WWWDIR)/$(ITEM):B:S)
.WWW.LOCAL : $(G)
eval
$(G) : .JOINT $(ARCH)/$(ITEM)/$(ITEM).mm (html_info) .WWW.semaphore .FORCE
cd $$(*:D)
$$(MAKE) $$(-) $$(=) www
end
else
BINS += $(WWWDIR)/$(ITEM)/$(ITEM)-$(TYPE).tgz
DIRS += $(ARCH)/$(ITEM)
end
end
.WWW.REMOTE : $(BINS)
ARCH := $(ARCH:C,/src/.*,,)
eval
$(BINS) :JOINT: .FORCE .WWW.semaphore
rsh $(HOST) "
eval \"\`bin/package debug use\`\"
PATH=\$PATH:$(PATH):/usr/ccs/bin
umask 022
for dir in $(DIRS)
do cd \$dir
$(MAKE) $(-) $(=) --errorid=\$dir www.bin
done
"
end
end
/*
* :WWWPOST: [ host [ dir [ tmp ] ] ]
*
* post local $(WWWDIR) to host:dir putting archives in host:tmp/www-*.pax
* defaults: host=www dir=$(WWWDIR) tmp=tmp
*/
":WWWPOST:" : .MAKE .OPERATOR
local ( host dir tmp ignore ... ) $(>) www $(WWWDIR:B:S) tmp ignore
:ALL: delta.pax
.WWW.ALL : .WWW.REMOTE - .WWW.LOCAL
eval
.POST : .VIRTUAL base.pax delta.pax
case "$$(>)" in
'') ;;
*) $$(>:C,.*,rcp & $(host):$(tmp)/$(dir)-&;,)
rsh $(host) '
umask 022
PATH=$HOME/bin:$PATH
cd $(dir)
pax -rvf $HOME/$(tmp)/$(dir)-delta.pax -z $HOME/$(tmp)/$(dir)-base.pax
'
;;
esac
end
base.pax :
cd $(WWWDIR)
pax -wvf $(<:P=A) .
.base.list. : .FUNCTION
local X
X := $(sh pax -f $(%:N=*.pax):C,\n, ,G:C,^,$$(WWWDIR)/,)
$(X) : .DONTCARE
return $(X)
delta.pax : .WWW.ALL base.pax $$(.base.list. $$(*))
cd $(WWWDIR)
pax -wvf $(<:P=A) -z $(*:N=*.pax:P=A) .
.WWW.FAQ : .USE
{
set -o noglob
print .xx title=\"$(<:B:/\..*//) FAQ index\"
print .MT 4
print .TL
print
print .H 1 \"$(<:B:/\..*//) FAQ index\"
print .BL
for i in $(*)
do exec < $i || exit 1
e=0 l=0 x=y
while read -r op a1 a2
do case $op in
.H) case $e in
0) e=1 ;;
1) print .LE ;;
esac
print .sp
print .LI
a2=${a2//\"/}
a2=${a2%\ [Ff][Aa][Qq]}
f=${i%.*}.html
f=${f#*/}
print .xx link=\"$f' '$a2\"
print .sp
print .NL
;;
.AL|.BL|.NL)
case $x in
y) x=x ;;
*) x=xx$x ;;
esac
;;
.LE) x=${x%xx}
;;
.LI) case $x in
x) x=
print .LI
;;
esac
;;
.sp) case $x in
'') x=x ;;
esac
;;
*) case $x in
'') print -r -- $op $a1 $a2 ;;
esac
;;
esac
done
case $e in
1) print .LE ;;
esac
done
print .LE
} > $(<)
/*
* [ dir ] :WWWPAGE: [ source ... ] file.mm file
*
* *.mm generates *.html
* faq.*.mm generates faq.mm
* other files copied to $(WWWDIR)[/dir]
* files after - (toggle) are just asserted on ::
*/
":WWWPAGE:" : .MAKE .OPERATOR
local B D I J O P Q S X G A
A = 0
D := $(<:O=1)
P := $(>:N!=*=*)
S := $(>:N=*=*)
if X = "$(P:B:S:N=faq.*.mm)"
Q := $(D:+$(D).)faq.mm
$(Q) : .WWW.FAQ $(X)
P += $(Q)
end
if D
B := $(D:B)
if D != "/*"
D := $(WWWDIR)/$(D)
$(D) :INSTALLDIR:
.WWW.LOCAL : $(D)
end
for I $(<:B)
.WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html
$(WWWDIR)/man/man1/$(I).html : .DONTCARE
end
for I $(P)
if I == "-"
let A = !A
continue
end
if A || I == "$(WWWSAVE)"
:: $(I)
continue
end
if "$(I:T=FD)"
.SOURCE : $(I)
if "$(<)"
WWWSOURCE.$(<:O=1) += $(I:T=F:P=L=*)
end
continue
end
if I == "*.html"
$(I) : .TERMINAL
O := $(I)
X := $(I)
elif ( G = "$(I:G=%.html)" )
$(G) : .IMPLICIT $(S) $(I)
if $(G:O) > 1
for J $(G)
if J == "*-index.html"
if J == "faq.*.*"
continue
end
O := index.html
else
O := $(J)
end
.WWW.LOCAL : $(D)/$(O)
$(D)/$(O) :INSTALL: $(J)
end
continue
end
if X
X := $(I)
else
X := index
end
I := $(I:B:S=.html)
O := $(X:B:S=.html)
else
O := $(I)
end
$(D)/$(O) :INSTALL: $(I)
.WWW.LOCAL : $(D)/$(O)
end
else
for I $(P)
if I == "-"
let A = !A
continue
end
if A || I == "$(WWWSAVE)"
:: $(I)
continue
end
if "$(I:T=FD)"
.SOURCE : $(I)
continue
end
if I == "*.html"
$(I) : .TERMINAL
O := $(I)
elif ( O = "$(I:G=%.html)" )
$(O) : $(S) .IMPLICIT $(I)
end
for J $(O)
if J == "*-index.html"
X := index.html
else
X := $(J)
end
X := $(WWWDIR)/$(X)
.WWW.LOCAL : $(X)
$(X) :COPY: $(J)
end
end
end
/*
* rhs done by default
*/
":WWWALL:" : .MAKE .OPERATOR
.WWW.ALL : $(>)
":WWWMAN:" : .MAKE .OPERATOR
.INIT : .WWW.MAN
.WWW.MAN. := $(>)
.WWW.MAN : .MAKE .FORCE
local H I
for I $(.WWW.MAN.)
.WWW.LOCAL : $(WWWDIR)/man/man1/$(I:B).html
$(WWWDIR)/man/man1/$(I:B).html : .DO.WWW.MAN $(I)
end
for I $(sh builtin:B)
.WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html
$(WWWDIR)/man/man1/$(I).html : .DO.WWW.MAN -
end
for I $("$(BINDIR)/*([!-.])":P=G:B)
if I != "*_*"
H := $(WWWDIR)/man/man1/$(I).html
if ! "$(*$(H))" && I != "$(.WWW.NOMAN.:/ /|/G)"
.WWW.LOCAL : $(H)
end
elif "$(PATH:/:/ /G:X=$(I:/.*_//):T=F:O=1)"
H := $(WWWDIR)/man/man1/$(I:/.*_//).html
.WWW.LOCAL : $(H)
$(H) : .DO.WWW.MAN $(BINDIR)/$(I)
end
end
.WWW.SED. : .FUNCTION
local E T
E = s/^\(\.xx.link=.*\)%HOSTTYPE%\(.*\)%HOSTTYPE%\(.*\)/
for T $(%)
E := $(E:V)\$$("\n").LI\$$("\n")\1$(T)\2$(T)\3
end
return $(E:V)/
/*
* mm scan support
*/
.SCAN.mm : .SCAN
O|S|
I|.sn %|A.DONTCARE|M$$(%)|
I|.so %|A.DONTCARE|M$$(%)|
.ATTRIBUTE.%.mm : .SCAN.mm

File diff suppressed because it is too large Load diff

View file

@ -136,10 +136,12 @@ all_types='*.*|sun4' # all but sun4 match *.*
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
0123) USAGE=$'
[-?
@(#)$Id: package (AT&T Research) 2012-06-28 $
@(#)$Id: package (ksh 93u+m) 2021-05-11 $
]
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
[-author?Contributors to https://github.com/ksh93/ksh]
[-copyright?(c) 1994-2012 AT&T Intellectual Property]
[-copyright?(c) 2020-2021 Contributors to https://github.com/ksh93/ksh]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?package - source and binary package control]
[+DESCRIPTION?The \bpackage\b command controls source and binary
@ -609,8 +611,6 @@ ifs=${IFS-'
lo=
make=
makeflags='-K'
nmakeflags=
nmakesep=
nl="
"
noexec=
@ -1645,17 +1645,6 @@ onpath() # command
return 1
}
# true if no nmake or nmake not from AT&T or nmake too old
nonmake() # nmake
{
_nonmake_version=`( $1 -n -f - 'print $(MAKEVERSION:@/.*AT&T.* //:/-//G:@/.* .*/19960101/)' . ) </dev/null 2>/dev/null || echo 19840919`
if test $_nonmake_version -lt 20001031
then return 0
fi
return 1
}
# determine local host attributes
hostinfo() # attribute ...
@ -2715,8 +2704,7 @@ case $x in
OK=ok
KSH=$EXECROOT/bin/ksh
MAKE=nmake
NMAKE=$EXECROOT/bin/$MAKE
MAKE=mamake
SUM=$EXECROOT/bin/sum
TEE=$EXECROOT/bin/tee
INITROOT=$PACKAGEROOT/src/cmd/INIT
@ -3106,7 +3094,7 @@ cat $INITROOT/$i.sh
$show export PATH
export PATH
;;
*) for i in package proto nmake
*) for i in package proto
do if onpath $i
then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'`
EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'`
@ -3143,8 +3131,7 @@ cat $INITROOT/$i.sh
OK=ok
KSH=$EXECROOT/bin/ksh
MAKE=nmake
NMAKE=$EXECROOT/bin/$MAKE
MAKE=mamake
SUM=$EXECROOT/bin/sum
TEE=$EXECROOT/bin/tee
@ -3537,44 +3524,41 @@ int main(int argc, char** argv) { return argc || argv; }
echo "$command: $INITROOT: INIT package source not found" >&2
return 1
}
executable $INSTALLROOT/bin/nmake || {
# check for prototyping cc
# NOTE: proto.c must be K&R compatible
$CC -c $INITROOT/p.c >/dev/null 2>&1
c=$?
rm -f p.*
test 0 != "$c" && {
checkaout proto || return
PROTOROOT=$PACKAGEROOT/proto
$show PROTOROOT=$PACKAGEROOT/proto
export PROTOROOT
INITPROTO=$PROTOROOT/src/cmd/INIT
note proto convert $PACKAGEROOT/src into $PROTOROOT/src
if test -d $PACKAGEROOT/src/cmd/nmake
then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake"
else dirs="src"
# check for prototyping cc
# NOTE: proto.c must be K&R compatible
$CC -c $INITROOT/p.c >/dev/null 2>&1
c=$?
rm -f p.*
test 0 != "$c" && {
checkaout proto || return
PROTOROOT=$PACKAGEROOT/proto
$show PROTOROOT=$PACKAGEROOT/proto
export PROTOROOT
INITPROTO=$PROTOROOT/src/cmd/INIT
note proto convert $PACKAGEROOT/src into $PROTOROOT/src
dirs="src"
(
if test -f $PROTOROOT/UPDATE
then newer="-newer $PROTOROOT/UPDATE"
else newer=""
fi
(
if test -f $PROTOROOT/UPDATE
then newer="-newer $PROTOROOT/UPDATE"
else newer=""
fi
case $exec in
'') cd $PACKAGEROOT
find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto
;;
*) $exec cd $PACKAGEROOT
$exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto"
;;
esac
$exec touch $PROTOROOT/UPDATE
)
VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH
$show VPATH=$VPATH
export VPATH
}
case $exec in
'') cd $PACKAGEROOT
find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto
;;
*) $exec cd $PACKAGEROOT
$exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto"
;;
esac
$exec touch $PROTOROOT/UPDATE
)
VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH
$show VPATH=$VPATH
export VPATH
}
for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return
done
@ -5925,10 +5909,7 @@ cat $j $k
*-*) a=
for t in $target
do case $t in
-[eiknFKNV]*|--*-symbols)
makeflags="$makeflags $t"
;;
-*) nmakeflags="$nmakeflags $t"
-*) makeflags="$makeflags $t"
;;
*) a="$a $t"
;;
@ -5938,76 +5919,6 @@ cat $j $k
;;
esac
# generate nmake first if possible
if executable ! $NMAKE && test -d $PACKAGEROOT/src/cmd/nmake
then if nonmake $MAKE
then note make $NMAKE with mamake
c=$CC
a=$assign
case $HOSTTYPE in
win32*|cygwin*)
CC="$CC -D_BLD_STATIC"
accept="libast"
case $assign in
*' CC='*) ;;
*) assign="$assign CC=\"\$CC\"" ;;
esac
;;
*) accept=nmake
;;
esac
eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign
assign=$a
CC=$c
case $make$noexec in
'') if executable ! $NMAKE
then echo "$command: $action: errors making $NMAKE" >&2
exit 1
fi
;;
*) make=echo
;;
esac
if test '' != "$PROTOROOT"
then VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH
$show VPATH=$VPATH
export VPATH
fi
note believe generated files for $accept
eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign
$exec touch $INSTALLROOT/bin/.paths
note make the remaining targets with $NMAKE
else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign
case $make$noexec in
'') if executable ! $NMAKE
then echo "$command: $action: errors making $NMAKE" >&2
exit 1
fi
;;
*) make=echo
;;
esac
fi
fi
# generate ksh next if possible
if nonmake $MAKE
then : no need to generate ksh next -- it could be the only package
elif test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH
then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign
case $make$noexec in
'') if executable ! $KSH
then echo "$command: $action: errors making $KSH" >&2
exit 1
fi
;;
*) make=echo
;;
esac
fi
# mamprobe data should have been generated by this point
case $exec in
@ -6082,7 +5993,7 @@ cat $j $k
;;
esac
# run from separate copies since nmake and ksh may be rebuilt
# run from separate copies since ksh may be rebuilt
case $EXECROOT in
$INSTALLROOT)
@ -6100,7 +6011,7 @@ cat $j $k
else rm=rm
fi
for i in \
ksh nmake tee cp ln mv rm \
ksh tee cp ln mv rm \
*ast*.dll *cmd*.dll *dll*.dll *shell*.dll
do executable $i && {
cmp -s $i $OK/$i 2>/dev/null || {
@ -6110,7 +6021,7 @@ cat $j $k
$exec $execrate $mv $OK/$i $OK/$i.old </dev/null
test -f $OK/$i &&
case $exec:$i in
:nmake|:ksh)
:ksh)
echo "$command: $OK/$i: cannot update [may be in use by a running process] remove manually and try again" >&2
exit 1
;;
@ -6124,9 +6035,6 @@ cat $j $k
$exec $execrate $cp -p ../lib/make/makerules.mo $OK/lib/makerules.mo ||
$exec $execrate $cp ../lib/make/makerules.mo $OK/lib/makerules.mo
fi
if executable $OK/nmake
then MAKE="$INSTALLROOT/bin/$OK/nmake LOCALRULESPATH=$INSTALLROOT/bin/$OK/lib"
fi
if executable $OK/tee
then TEE=$INSTALLROOT/bin/$OK/tee
fi
@ -6145,19 +6053,13 @@ cat $j $k
;;
esac
# fall back to mamake if nmake not found or too old
# build with mamake
if nonmake $MAKE
then note make with mamake
case $target in
'') target="install" ;;
esac
eval capture mamake \$makeflags \$noexec \$target $assign
else case $target in
'') target="install cc-" ;;
esac
eval capture \$MAKE \$makeflags \$nmakeflags \$noexec recurse \$target \$nmakesep \$package $assign
fi
note make with mamake
case $target in
'') target="install" ;;
esac
eval capture mamake \$makeflags \$noexec \$target $assign
;;
read) case ${PWD:-`pwd`} in
@ -6811,32 +6713,8 @@ results)set '' $target
esac
;;
test) requirements source $package
components $package
package=$_components_
case $only in
0) only= ;;
1) only=--recurse=only ;;
esac
# must have nmake
if nonmake $MAKE
then echo $command: $action: must have $MAKE to test >&2
exit 1
fi
# all work under $INSTALLROOT/src
$make cd $INSTALLROOT/src
# disable core dumps (could be disastrous over nfs)
(ulimit -c 0) > /dev/null 2>&1 && ulimit -c 0
# do the tests
eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign
test) # pass control to ksh 93u+m test script
exec "$PACKAGEROOT/bin/shtests"
;;
update) # download the latest release.version for selected packages
@ -7446,10 +7324,9 @@ write) set '' $target
exit 1
;;
esac
if nonmake $MAKE
then echo "$command: must have $MAKE to generate archives" >&2
exit 1
fi
echo "$command: not yet reimplemented after removing nmake" >&2
exit 1
# all work under $PACKAGEBIN